GNU bug report logs -
#11251
Use -Wl,-rpath instead of -R on GNU/Linux with GCC 4.6
Previous Next
Reported by: ludo <at> gnu.org (Ludovic Courtès)
Date: Mon, 16 Apr 2012 10:02:01 UTC
Severity: important
Done: Chong Yidong <cyd <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):
[Message part 1 (text/plain, inline)]
Hello,
The patch below fixes linking of ‘temacs’ on GNU/Linux with GCC 4.6.
[Message part 2 (text/x-patch, inline)]
=== modified file 'configure.in'
--- configure.in 2011-09-26 18:38:31 +0000
+++ configure.in 2012-04-16 09:52:23 +0000
@@ -3406,7 +3406,7 @@ case "$opsys" in
## had not yet been defined and was expanded to null. Hence LD_SWITCH_SYSTEM
## had different values in configure (in ac_link) and src/Makefile.in.
## It seems clearer therefore to put this piece in LD_SWITCH_SYSTEM_TEMACS.
- gnu-linux) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_AUX)" ;;
+ gnu-linux) LD_SWITCH_SYSTEM_TEMACS="\$(LD_SWITCH_X_SITE_AUX_RPATH)" ;;
*) LD_SWITCH_SYSTEM_TEMACS= ;;
esac
[Message part 3 (text/plain, inline)]
GCC 4.5 used to ignore ‘-R’, but GCC 4.6 rejects it:
--8<---------------cut here---------------start------------->8---
$ echo "int main () { return 0; }" > t.c
$ ./result/bin/gcc t.c -R/foo
gcc: unrecognized option '-R/foo'
$ echo $?
0
$ ./result/bin/gcc --version | head -1
gcc (GCC) 4.5.3
$ gcc t.c -R/foo
gcc: error: unrecognized option ‘-R’
$ echo $?
1
$ gcc --version | head -1
gcc (GCC) 4.6.2
--8<---------------cut here---------------end--------------->8---
(This is why the ‘build’ job at <http://hydra.nixos.org/eval/605870> has
been failing since the standard build environment switched from GCC 4.5
to 4.6 last month.)
In fact, the above should be applied to all GNU variants, so *gnu* may
be more appropriate than gnu-linux.
Thanks,
Ludo’.
This bug report was last modified 13 years and 33 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.