public inbox for gcc-help@gcc.gnu.org
 help / color / mirror / Atom feed
* specs file problem with *link and -Wl,-rpath
@ 2006-01-11  1:51 Sal Paradise
  0 siblings, 0 replies; only message in thread
From: Sal Paradise @ 2006-01-11  1:51 UTC (permalink / raw)
  To: gcc-help

Hello,

I am building gcc 3.3.5 from source on my system (x86 Linux).  I am attempting to modify the specs file in order to give gcc a default rpath on my system.  However, I do not want gcc to insert this default rpath if the user specifies -Wl,-rpath,/whatever on the command line.

I attempted to do this in the specs file:
*link:
%{!static:--eh-frame-hdr} -m elf_i386 %{shared:-shared}   %{!shared:     %{!ibcs:       %{!static:         %{rdynamic:-export-dynamic}         %{!dynamic-linker:-dynamic-linker /mylib/ld-linux.so.2}         %{!Wl,-rpath*:-rpath /mylib}} %{static:-static}}}

Unfortunately, strace -f reveals that the "-rpath /mylib" is always passed to ld (regardless of the presence of the -Wl,-rpath argument on the gcc command line).  This is bad because this default rpath gets precedence over the one the user specifies (the user's choice gets concatenated after the default by ld).

Am I missing something here?  Is the this option treated specially in the specs file language?  For what it is worth, the conditionality of the dynamic linker option also seems broken (and that part is from the stock file; not my modification).  It gets passed to ld even when users specify -Wl,--dynamic-linker (but it ends up working inadvertently because ld takes the second one which is the one from the command line).

Please cc: me on the reply (I am not subscribed to this list).

Thanks

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2006-01-11  1:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-01-11  1:51 specs file problem with *link and -Wl,-rpath Sal Paradise

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).