Osman Zakir via llvm-dev
2018-Dec-11 19:20 UTC
[llvm-dev] Using LLD to link against third-party libraries? How?
How do I use LLD to link against third-party libraries? I've tried providing the full path along with the library name in the same argument with the -L flag (i.e. -L path/to/library.lib) without success. I really want to know how I can do this. Thanks in advance. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181211/1201f7bc/attachment.html>
blubee blubeeme via llvm-dev
2018-Dec-11 19:32 UTC
[llvm-dev] Using LLD to link against third-party libraries? How?
You might need to add -fuse-ld=lld to your LDFLAGS make sure you also built and have installed the lld component of the llvm tool chain. Best On Wed, Dec 12, 2018, 03:20 Osman Zakir via llvm-dev < llvm-dev at lists.llvm.org> wrote:> How do I use LLD to link against third-party libraries? I've tried > providing the full path along with the library name in the same argument > with the -L flag (i.e. -L path/to/library.lib) without success. I really > want to know how I can do this. Thanks in advance. > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181212/0ad219e2/attachment.html>
Osman Zakir via llvm-dev
2018-Dec-11 19:48 UTC
[llvm-dev] Using LLD to link against third-party libraries? How?
I add the -fuse-ld=lld flag to the compiler command line itself. And I included LLD when I built LLVM (I checked out the mono repo and built that version). What command line arguments should I pass to LLD when I want to link against third-party libraries? That's what I'm asking. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20181211/756f1c9b/attachment.html>
Fabian Giesen via llvm-dev
2018-Dec-11 21:38 UTC
[llvm-dev] Using LLD to link against third-party libraries? How?
What do you mean by "third-party" here? To link with a library, either: 1. Add the library to the link line. Not with any command line switches in front, just add it as you would an object file. You mention ".lib" so I'm assuming you're on Windows or something similar? In that case, you'd just have "foo.obj bar.obj path/to/library.lib". Just list it like you would any object file. 2. Add the path containing the library to the library search directory (that's what uppercase "-L" does) then specify the name of the library via "-l". In your case that would look something like "-Lpath/to foo.obj bar.obj -llibrary". For Unix-like linkers, this will search for the files "liblibrary.so" and "liblibrary.a" in the search paths specified via -L ("lib" prepended to the name of the library, and ".so" or ".a" extensions appended). I'm not sure what rules GNU LD, Gold or LLD use to figure out what files to search on Windows host platforms. -Fabian On 12/11/2018 11:20 AM, Osman Zakir via llvm-dev wrote:> How do I use LLD to link against third-party libraries? I've tried > providing the full path along with the library name in the same argument > with the -L flag (i.e. -L path/to/library.lib) without success. I > really want to know how I can do this. Thanks in advance. > > _______________________________________________ > LLVM Developers mailing list > llvm-dev at lists.llvm.org > http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev >
Apparently Analagous Threads
- Using LLD to link against third-party libraries? How?
- Using LLD to link against third-party libraries? How?
- Using LLD to link against third-party libraries? How?
- Using LLD to link against third-party libraries? How?
- Using LLD to link against third-party libraries? How?