Submitted By: Robert Connolly <robert at linuxfromscratch dot org> (ashes)
Date: 2006-08-21
Initial Package Version: 4.1.1
Upstream Status: Not Sent - LFS Specific
Origin: Idea originally developed by Ryan Oliver and Greg Schafer for
        the Pure LFS project.
        More architectures added by Zack Winkles.
        Further fine tunings by Greg Schafer.
        Modified for gcc 3.3.2 by Oliver Brakmann.
        Rediffed against gcc 3.4.0 by Zack Winkles.
        Rediffed against gcc 3.4.3 by Jim Gifford.
        Rediffed against gcc 4.0.0 by Robert Connolly.
        Rediffed against gcc 4.1.0 by Chris Staub
Description: This patch modifies the location of the dynamic linker for
        the GCC Pass 2 build in LFS Chapter 5.
	Modified to Support a 32-Bit only build on a Multilib System

diff -Naur gcc-4.1.1.orig/gcc/config/i386/t-linux64 gcc-4.1.1/gcc/config/i386/t-linux64
--- gcc-4.1.1.orig/gcc/config/i386/t-linux64	2005-08-10 10:53:01.000000000 -0700
+++ gcc-4.1.1/gcc/config/i386/t-linux64	2006-08-21 21:16:28.607248257 -0700
@@ -4,9 +4,9 @@
 SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \
 		 $(srcdir)/config/i386/libgcc-x86_64-glibc.ver
 
-MULTILIB_OPTIONS = m64/m32
-MULTILIB_DIRNAMES = 64 32 
-MULTILIB_OSDIRNAMES = ../lib64 ../lib
+MULTILIB_OPTIONS = m32/m64
+MULTILIB_DIRNAMES = 32 64
+MULTILIB_OSDIRNAMES = ../lib ../lib64
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
diff -Naur gcc-4.1.1.orig/gcc/config/mips/t-linux64 gcc-4.1.1/gcc/config/mips/t-linux64
--- gcc-4.1.1.orig/gcc/config/mips/t-linux64	2006-02-17 13:38:59.000000000 -0800
+++ gcc-4.1.1/gcc/config/mips/t-linux64	2006-08-21 21:17:58.233076589 -0700
@@ -1,6 +1,6 @@
-MULTILIB_OPTIONS = mabi=n32/mabi=32/mabi=64
-MULTILIB_DIRNAMES = n32 32 64
-MULTILIB_OSDIRNAMES = ../lib32 ../lib ../lib64
+MULTILIB_OPTIONS = mabi=32/mabi=n32/mabi=64
+MULTILIB_DIRNAMES = 32 n32 64
+MULTILIB_OSDIRNAMES = ../lib ../lib32 ../lib64
 
 EXTRA_MULTILIB_PARTS=crtbegin.o crtend.o crtbeginS.o crtendS.o crtbeginT.o
 
diff -Naur gcc-4.1.1.orig/gcc/config/rs6000/t-linux64 gcc-4.1.1/gcc/config/rs6000/t-linux64
--- gcc-4.1.1.orig/gcc/config/rs6000/t-linux64	2006-02-10 12:58:33.000000000 -0800
+++ gcc-4.1.1/gcc/config/rs6000/t-linux64	2006-08-21 21:17:15.794104784 -0700
@@ -6,12 +6,12 @@
 
 TARGET_LIBGCC2_CFLAGS += -mno-minimal-toc
 
-MULTILIB_OPTIONS        = m64/m32 msoft-float
-MULTILIB_DIRNAMES       = 64 32 nof
+MULTILIB_OPTIONS        = m32/m64 msoft-float
+MULTILIB_DIRNAMES       = 32 64 nof
 MULTILIB_EXTRA_OPTS     = fPIC mstrict-align
 MULTILIB_EXCEPTIONS     = m64/msoft-float
 MULTILIB_EXCLUSIONS     = m64/!m32/msoft-float
-MULTILIB_OSDIRNAMES	= ../lib64 ../lib nof
+MULTILIB_OSDIRNAMES	= ../lib ../lib64 nof
 MULTILIB_MATCHES        = $(MULTILIB_MATCHES_FLOAT)
 
 # We want fine grained libraries, so use the new code to build the
diff -Naur gcc-4.1.1.orig/gcc/config/s390/t-linux64 gcc-4.1.1/gcc/config/s390/t-linux64
--- gcc-4.1.1.orig/gcc/config/s390/t-linux64	2006-02-06 08:07:46.000000000 -0800
+++ gcc-4.1.1/gcc/config/s390/t-linux64	2006-08-21 21:15:48.144229005 -0700
@@ -1,6 +1,6 @@
-MULTILIB_OPTIONS = m64/m31
-MULTILIB_DIRNAMES = 64 32
-MULTILIB_OSDIRNAMES = ../lib64 ../lib
+MULTILIB_OPTIONS = m31/m64
+MULTILIB_DIRNAMES = 32 65
+MULTILIB_OSDIRNAMES = ../lib ../lib64
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
diff -Naur gcc-4.1.1.orig/gcc/config/sparc/t-linux64 gcc-4.1.1/gcc/config/sparc/t-linux64
--- gcc-4.1.1.orig/gcc/config/sparc/t-linux64	2004-04-01 08:05:22.000000000 -0800
+++ gcc-4.1.1/gcc/config/sparc/t-linux64	2006-08-26 22:02:56.222291480 -0700
@@ -1,6 +1,6 @@
-MULTILIB_OPTIONS = m64/m32
-MULTILIB_DIRNAMES = 64 32
-MULTILIB_OSDIRNAMES = ../lib64 ../lib
+MULTILIB_OPTIONS = m32/m64
+MULTILIB_DIRNAMES = 32 64
+MULTILIB_OSDIRNAMES = ../lib ../lib64
 
 LIBGCC = stmp-multilib
 INSTALL_LIBGCC = install-multilib
@@ -14,6 +14,3 @@
 SHLIB_MAPFILES = $(srcdir)/libgcc-std.ver \
 		 $(srcdir)/config/sparc/libgcc-sparc-glibc.ver
 
-CRTSTUFF_T_CFLAGS = `if test x$$($(GCC_FOR_TARGET) $(MULTILIB_CFLAGS) \
-				 -print-multi-os-directory) \
-			= x../lib64; then echo -mcmodel=medany; fi`

--- gcc-4.1.1.orig/gcc/config/sparc/linux64.h   2006-02-11 00:38:51.000000000 -0800
+++ gcc-4.1.1/gcc/config/sparc/linux64.h        2006-08-30 23:52:50.288518761 -0700
@@ -50,11 +50,13 @@
 /* A 64 bit v9 compiler with stack-bias,
    in a Medium/Low code model environment.  */

+#ifdef SPARC64_USERSPACE_FORCED_TO_32
 #undef TARGET_DEFAULT
 #define TARGET_DEFAULT \
   (MASK_V9 + MASK_PTR64 + MASK_64BIT /* + MASK_HARD_QUAD */ \
    + MASK_STACK_BIAS + MASK_APP_REGS + MASK_FPU + MASK_LONG_DOUBLE_128)
 #endif
+#endif

 #undef ASM_CPU_DEFAULT_SPEC
 #define ASM_CPU_DEFAULT_SPEC "-Av9a"

