[LLVMdev] Possible solution to a llvm-ld bug
wink at saville.com
Sat Mar 4 23:55:51 PST 2006
As previously mentioned I had a linking problem using llvm-ld
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.
More information about the llvm-dev