order of -L options created by gcc for the linker

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



I'm having a problem with gcc placing the default gcc libraries 
(-L/usr/lib/gcc/x86_64-redhat-linux/3.4.5) ahead of the correct (newer)
versions in the list of arguments being passed to ld. 

In particular, if I specify -Wl,-L/usr/local/ext/lib in the line passed to
gcc, the resultant ld command will have the default location of libraries
for gcc prior to my -L/usr/local/ext/lib entry. As a result, the linker trys
to link older libraries and fails.

In contrast, if I specify -L/usr/local/ext/lib in the line passed to gcc (no
-Wl), the resultant ld command will have -L/usr/local/ext/lib prior to the
gcc default library location and the link proceeds without error.

Why is this? I thought gcc would take any -Wl specified option and pass it
straight on to ld, I wasn't expecting a different placement within the
resultant command line.

This is causing a problem for me because our current build environment does
not support a method for generating the -L without -Wl.

Are there other arguments that can be passed to gcc so that my -L path is
before the compilers?

Any help in understanding this would be appriciated.



-- 
View this message in context: http://www.nabble.com/order-of--L-options-created-by-gcc-for-the-linker-tf3978436.html#a11293747
Sent from the gcc - Help mailing list archive at Nabble.com.



[Index of Archives]     [Linux C Programming]     [Linux Kernel]     [eCos]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [The DWARVES Debugging Tools]     [Yosemite Campsites]     [Yosemite News]     [Linux GCC]

  Powered by Linux