Possible solution to a llvm-ld bug

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

You're absolutely right. I have updated llvm-ld.cpp to parse the command
line arguments before using LibPaths. Thanks for the report.

Reid.