[LLVMdev] Possible solution to a llvm-ld bug

Wink Saville wink at saville.com
Sat Mar 4 23:55:51 PST 2006


Hello,

As previously mentioned I had a linking problem using llvm-ld
(http://lists.cs.uiuc.edu/pipermail/llvmdev/2006-February/005246.html)

I was getting a error if I used -L switch when linking using the following command line:

   llvm-ld  -o t1.app t1.bc t1.a -L/opt/llvm-1.6/llvm-gcc/lib -lcrtend

I believe I've tracked down the problem; in the "main" of tools/llvm-ld.cpp
the call to ParseCommandLineOptions is after the TheLinker.addPaths(LibPaths)
statement so the -L command line parameter is ignored.

My fix was to move the ParseCommandLineOptions to the beginning of the main routine.

Cheers,

Wink Saville





More information about the llvm-dev mailing list