[llvm-dev] Why is LTO built as a shared lib?

Antoine Pitrou via llvm-dev llvm-dev at lists.llvm.org
Tue Jan 26 03:54:22 PST 2016


Hello,

LTO is currently the only library which is always built as shared, even
under Windows.  This actually seems to lead to failure using LLVM in
another project under Windows, at least for me (the error message
complains about "LTO-NOTFOUND.OBJ"). Switching it to a static library
fixes the issue (again, at least for me under Windows).

The change was made in:
http://lists.llvm.org/pipermail/llvm-commits/Week-of-Mon-20140623/223433.html

While it seems the original complaint was the explicit "STATIC" marker
in the call to add_llvm_library(), the patch added an explicit "SHARED"
marker which isn't used elsewhere.

Also, a quick look through the bin/ directory under Linux seems to
suggest none of the executables (even llvm-lto) links dynamically
against LTO.so.

Regards

Antoine.




More information about the llvm-dev mailing list