[Bug target/26472] Default path for libgcc_s.sl is build directory

dave at hiauly1 dot hia dot nrc dot ca gcc-bugzilla@gcc.gnu.org
Wed Mar 1 14:46:00 GMT 2006



------- Comment #12 from dave at hiauly1 dot hia dot nrc dot ca  2006-03-01 14:46 -------
Subject: Re:  Default path for libgcc_s.sl is build directory

> (In reply to comment #10)
> > 
> > I see it in the manpages for both HP-UX 11.00 and 11.11.  I have
> > the following "ld(1) and linker tools" patches installed: PHSS_30965
> > and PHSS_30968.  I see in the text for PHSS_30049:
> 
> >           Provided a linker option +nodefaultrpath for
> >           not recording build-time paths in the resultant
> >           executables and shared libraries
> 
> So how can we find out cheaply whether it's supported?  Even if it is ignored
> when not supported: we could also set hardcode_minus_L=no if supported to get
> the chance to save some relinking.

The option seems to be ignored by ld when not supported (tested on
HP-UX 10.20 and HP-UX 11.11).

507 (hiauly1)dave> cat main.c
int main() {}
508 (hiauly1)dave> gcc -o main -Wl,+nodefaultrpath main.c

This is the not supported case (HP-UX 10.20):
509 (hiauly1)dave> chatr main|grep libc
             dynamic   /usr/lib/libc.1

This is the supported case (HP-UX 11.11):
-bash-2.05b$ chatr main|grep libc
             dynamic   libc.2

So, a small shell script should be able to detect the difference.
For example, 

514 (hiauly1)dave> chatr main|grep 'dynamic[ \t]*libc'
515 (hiauly1)dave> echo $?
1

-bash-2.05b$ chatr main|grep 'dynamic[ \t]*libc'
             dynamic   libc.2
-bash-2.05b$ echo $?
0

The above compilation also works using 'cc' instead of 'gcc'.

Dave


-- 


http://gcc.gnu.org/bugzilla/show_bug.cgi?id=26472



More information about the Gcc-bugs mailing list