Welson Sun
2012-Mar-14 23:26 UTC
[LLVMdev] Linking static external library into an LLVM pass library?
This document http://llvm.org/docs/Projects.html says the USEDLIBS should be used to statically link libraries: USEDLIBSThis variable holds a space separated list of libraries that should be linked into the program. These libraries must be libraries that come from your *lib* directory. The libraries must be specified without their "lib" prefix. For example, to link libsample.a, you would set USEDLIBS to sample.a. Note that this works only for statically linked libraries. But, what is that "lib" directory? How can I specify external libxyz.a file that doesn't live in this libs directory? Anybody has done this? Thanks! Welson -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120314/5581b22d/attachment.html>
Welson Sun
2012-Mar-15 00:17 UTC
[LLVMdev] Linking static external library into an LLVM pass library?
A related question and I cannot find answers by Googling: How should you write the main function to compile an executable LLVM pass? - Welson On Wed, Mar 14, 2012 at 4:26 PM, Welson Sun <welson.sun at gmail.com> wrote:> This document http://llvm.org/docs/Projects.html says the USEDLIBS > should be used to statically link libraries: > > USEDLIBSThis variable holds a space separated list of libraries that > should be linked into the program. These libraries must be libraries that > come from your *lib* directory. The libraries must be specified without > their "lib" prefix. For example, to link libsample.a, you would set > USEDLIBS to sample.a. > > Note that this works only for statically linked libraries. > > > But, what is that "lib" directory? How can I specify external libxyz.a > file that doesn't live in this libs directory? > > Anybody has done this? > > > Thanks! > Welson > >-- Welson Phone: (408) 418-8385 Email: welson.sun at gmail.com -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.llvm.org/pipermail/llvm-dev/attachments/20120314/03c796f4/attachment.html>
Roel Jordans
2012-Mar-15 08:58 UTC
[LLVMdev] Linking static external library into an LLVM pass library?
You could try to use the LIBS variable, that one gets passed directly to the linker and takes arguments in the standard linking convention. It's a few items down on the page you linked. - Roel On 03/15/2012 12:26 AM, Welson Sun wrote:> This document http://llvm.org/docs/Projects.html says the USEDLIBS > should be used to statically link libraries: > > USEDLIBS > This variable holds a space separated list of libraries that should > be linked into the program. These libraries must be libraries that > come from your *lib* directory. The libraries must be specified > without their "lib" prefix. For example, to link libsample.a, you > would set USEDLIBS to sample.a. > > Note that this works only for statically linked libraries. > > > But, what is that "lib" directory? How can I specify external libxyz.a > file that doesn't live in this libs directory? > > Anybody has done this? > > > Thanks! > Welson >