-
Notifications
You must be signed in to change notification settings - Fork 773
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Build with wineg++ wrapper #60
Comments
Hey, I have been working on this for the past two days. I managed to get it to build, and now I am working on runtime issues. A lot of my solutions are lot less clean than yours though. As for your current problem, it has to do with windows strings. If you replace both of the functions in util_env.cpp with return ""; it bypasses the issue. Also, you might want to remove the dll override thing, because it stops the backtrace from showing up, which is how I found the solution to that problem By the way, if you want to discuss this further, you might want to get on the discord. EDIT: The Vkx discord (https://discord.gg/C8EEVmy) |
If I understand correctly it must be something like : diff --git a/src/util/util_env.cpp b/src/util/util_env.cpp
index 0464bc3..f5f7fd8 100644
--- a/src/util/util_env.cpp
+++ b/src/util/util_env.cpp
@@ -5,6 +5,7 @@
namespace dxvk::env {
std::string getEnvVar(const wchar_t* name) {
+#ifndef WINEBUILD
DWORD len = ::GetEnvironmentVariableW(name, nullptr, 0);
std::wstring result;
@@ -17,10 +18,14 @@ namespace dxvk::env {
result.resize(len);
return str::fromws(result);
+#else
+ return "";
+#endif
}
std::string getExeName() {
+#ifndef WINEBUILD
std::wstring exePath;
exePath.resize(MAX_PATH + 1);
@@ -33,6 +38,9 @@ namespace dxvk::env {
return (n != std::string::npos)
? fullPath.substr(n + 1)
: fullPath;
+#else
+ return "";
+#endif
}
}
Ok, with this I have following output:
It looks like .spec file needed for build or .fake build or both. At least wine attempting to load them. |
I solved this issue a few hours ago, you need to build with a spec file. dxgi.spec: d3d11.spec Then you need to add these to the LINK_ARGS when building |
If I understand this correctly... with this we can build dxvk for Linux without relying on a cross-compiling environment, but just wine and gcc? (the end result being a wine library rather than a Windows dll) That'd be really handy for Arch users building dxvk from the AUR. |
@ssorgatem While that is one result, the main reason is to allow profiling. On linux it is impossible to profile PE executables. |
Ok, I found the problem. So: $ winebuild -w --def -o libd3dcompiler_47.def --export path/to/wine/dlls/d3dcompiler_47/d3dcompiler_47.spec -m64
$ winebuild -w --def -o libvulkan-1.def --export path/to/wine/dlls/vulkan-1/vulkan-1.spec -m64 than lib_d3dcompiler_47 = dxvk_compiler.find_library('d3dcompiler_47')
lib_vulkan = dxvk_compiler.find_library('vulkan-1') With this changes I can successfully build and run tests. |
Awesome! By the way, for some reason when I use vulkan-1.dll.so, I get undefined reference to vkGetInstanceProcAddr, however when i use wine's vulkan.dll.so, it compiles find, and even somewhat works, before crashing due to some unrelated issue. Anyway, when I do get it working with vulkan.dll.so, it crashes on a null function pointer. And maybe the reason of this is that you are compiling the tests natively as well. I am curious what would happen if you tried this dll with a PE d3d11-using executable. |
I have tested TW3 and it fails w/ Not implemented/Invalid blend/Unsupported program type errors in output. It's how it should be for now I guess. Other programs works as before even if have dependencies on d3d11 or dxgi. |
If this actually works, can you make a pull request out of if? |
I'm on it. But this requires build system modification and some problematic code dropping (e.g. env var support). Also I have no luck to build fully functional x86 version, maybe due to not portable memory management code. Also I'm trying to do my best to keep current build system and project behaviour and minimize changes and dependencies required for linux build support. But I have some options I can play with:
Also So I'm not sure you accept such PR but I'll create a separate branch in my repo and let you know. |
@doitsujin branch name winebuild |
I have set winebuild as default branch and added some options support.
Minimal requirement for functional build for now (due to crashes):
Therefore
@doitsujin if those commits are ok for you I can create PRs or grab everything your want by yourself |
64-bit winelib builds are now supported using the |
I'm trying to build project w/ wineg++ but it seems only tests/* executables wrapped correctly. Both d3d11.dll.so and dxgi.dll.so are useless and produce errors when I'm trying to replace original libraries :
[221151.875587] d3d11-triangle.[6933]: segfault at 366 ip 0000000000000366 sp 00007ffc3ed84bf8 error 14 in bash[55f36b668000+e4000]
So the question is: Is it possible to build WINE's native linux libraries to replace original ones? Or i'm doing this totally wrong and really need to configure crossdev environment w/ mingw32?
Here is the list of changes was made :
build-win64-wine.txt
actually -mwindows required only by tests/* and -lpthread by d3d11.dll.so and dxgi.dll.so
meson.build.wine
Other quick-fixes:
EDIT: typo useful/useless
The text was updated successfully, but these errors were encountered: