Antoine Pitrou via llvm-dev
2016-Jan-26 11:54 UTC
[llvm-dev] Why is LTO built as a shared lib?
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.
David Chisnall via llvm-dev
2016-Jan-26 12:08 UTC
[llvm-dev] Why is LTO built as a shared lib?
libLTO is a loadable library that linkers use to call into LLVM to do link-time optimisation. It doesn’t make sense for it to be a static library. I’m not 100% convinced that it makes sense for it to be built on Windows at all, because (as far as I am aware) neither Gold nor ld64 (the two current consumers of libLTO) are supported on Windows. David> On 26 Jan 2016, at 11:54, Antoine Pitrou via llvm-dev <llvm-dev at lists.llvm.org> wrote: > > > 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. > > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev
Antoine Pitrou via llvm-dev
2016-Jan-26 12:28 UTC
[llvm-dev] Why is LTO built as a shared lib?
On Tue, 26 Jan 2016 12:08:35 +0000 David Chisnall via llvm-dev <llvm-dev at lists.llvm.org> wrote:> libLTO is a loadable library that linkers use to call into LLVM to do link-time optimisation. It doesn’t make sense for it to be a static library. I’m not 100% convinced that it makes sense for it to be built on Windows at all, because (as far as I am aware) neither Gold nor ld64 (the two current consumers of libLTO) are supported on Windows.Thank you. I didn't have this issue on 3.6.1 (even though LTO.dll was apparently built too), so perhaps something changed during 3.6.1 and 3.7.1 that added LTO to the libraries considered by llvm_map_components_to_libnames(). Regards Antoine.
Dave Bozier via llvm-dev
2016-Jan-26 14:38 UTC
[llvm-dev] Why is LTO built as a shared lib?
> I’m not 100% convinced that it makes sense for it to be built on Windows at all, because (as far as I am aware) neither Gold nor ld64 (the two current consumers of libLTO) are supported on Windows.Hi, We use the libLTO library on windows for the linker and other binary utilities we provide as part of the PS4 toolchain so this is very important for us. There was a lightning talk provided by Gao a couple of years ago. Here are the slides if you are interested in learning more about it. http://llvm.org/devmtg/2014-10/Slides/Gao-LTO-lightning-talk.pdf On Tue, Jan 26, 2016 at 12:08 PM, David Chisnall via llvm-dev <llvm-dev at lists.llvm.org> wrote:> libLTO is a loadable library that linkers use to call into LLVM to do link-time optimisation. It doesn’t make sense for it to be a static library. I’m not 100% convinced that it makes sense for it to be built on Windows at all, because (as far as I am aware) neither Gold nor ld64 (the two current consumers of libLTO) are supported on Windows. > > David > >> On 26 Jan 2016, at 11:54, Antoine Pitrou via llvm-dev <llvm-dev at lists.llvm.org> wrote: >> >> >> 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. >> >> >> _______________________________________________ >> LLVM Developers mailing list >> llvm-dev at lists.llvm.org >> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev