This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Fix SPARC64 GNU/Linux linker specs for sysroots


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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]