Fix SPARC64 GNU/Linux linker specs for sysroots
Joseph S. Myers
joseph@codesourcery.com
Wed Aug 13 10:33:00 GMT 2008
config/sparc/linux64.h has some linker specs passing -Y P options.
These put a directory in the linker search path, and as such they need
to use %R so the right directory is used in the sysroot case. This
patch adds %R to these specs. (Other targets probably need this as
well, but this is the one I've tested and where I came across the
issue in conjunction with linker warnings for inappropriate uses of
host directories as discussed at
<http://sourceware.org/ml/binutils/2008-08/msg00070.html>.)
Tested with no regressions with cross to sparc64-linux-gnu. OK to
commit?
2008-08-13 Joseph Myers <joseph@codesourcery.com>
* config/sparc/linux64.h (LINK_ARCH32_SPEC, LINK_ARCH64_SPEC,
LINK_SPEC): Use %R in -Y P argument.
Index: config/sparc/linux64.h
===================================================================
--- config/sparc/linux64.h (revision 139036)
+++ config/sparc/linux64.h (working copy)
@@ -121,7 +121,7 @@
{ "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
{ "link_arch", LINK_ARCH_SPEC },
-#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+#define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,%R/usr/lib %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
@@ -130,7 +130,7 @@
%{static:-static}}} \
"
-#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
+#define LINK_ARCH64_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
@@ -211,7 +211,7 @@
#else /* !SPARC_BI_ARCH */
#undef LINK_SPEC
-#define LINK_SPEC "-m elf64_sparc -Y P,/usr/lib64 %{shared:-shared} \
+#define LINK_SPEC "-m elf64_sparc -Y P,%R/usr/lib64 %{shared:-shared} \
%{!shared: \
%{!ibcs: \
%{!static: \
--
Joseph S. Myers
joseph@codesourcery.com
More information about the Gcc-patches
mailing list