-
Notifications
You must be signed in to change notification settings - Fork 44
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
Don't build LLVM with the -DLLVM_BUILD_SHARED_LIBS CMAKE option #56
Comments
I have built LLVM statically in the release I just published (https://github.com/brechtsanders/winlibs_mingw/releases/tag/11.1.0-12.0.0-9.0.0-r1). |
Looks like it. Thanks. |
The static LLVM build bumps the release's size crazily. I would suggest providing a variant for users who care about the size to download a dynamic linking version of winlibs mingw llvm, though I think the dynamic linking version should be the default one.
One should know this. On Windows, shared libraries may be used when building with MinGW, including mingw-w64, but not when building with the Microsoft toolchain.
https://github.com/llvm/llvm-project/blob/main/llvm/CMakeLists.txt#L611-L623 This is not true. Actually,
This is not the reason to choose to use static build I think. If unexpected behaviors occur when using the dynamic build, why not try to report an issue to LLVM for improvement. |
I have switched LLVM from shared to static builds after issues reported #56. Main focus of winlibs.com is on GCC. Pinpointing issues in LLVM stability is not taken in scope. |
The size does increase a bit because of the AVR files, but static LLVM makes the size changing from a MB level to a GB level.
I agree with this. But the point I said is don't switch to static build, of which the goal is just for a rare, happened only once, issue that the author is encountering when we can use Anyway, the decision is yours. I've deprecated this huge thing from my workflow. |
I have encountered the problem with LLVM multiple times, not only once. The problem is that every time you run ld.lld, the LLVM linker, there is a chance it will never complete. @brechtsanders |
Currently LLVM is built dynamically, with each LLVM component being its own DLL.
However, this for some reason causes LLD, the LLVM's linker, to sometimes hang and never complete. This might also happen when invoking Clang, but it seems much rarer (it happened to me once).
Also, LLVM's CMAKE documentation states that:
Note
BUILD_SHARED_LIBS is only recommended for use by LLVM developers. If you want to build LLVM as a shared library, you should use the LLVM_BUILD_LLVM_DYLIB option.
The LLVM_BUILD_LLVM_DYLIB option is unavailable on Windows however.
Statically linking LLVM executables might also increase performance somewhat.
The text was updated successfully, but these errors were encountered: