aboutsummaryrefslogtreecommitdiffstats
path: root/main
diff options
context:
space:
mode:
Diffstat (limited to 'main')
-rw-r--r--main/gcc/APKBUILD10
-rw-r--r--main/gcc/gcc-dynamic-linker.patch425
2 files changed, 433 insertions, 2 deletions
diff --git a/main/gcc/APKBUILD b/main/gcc/APKBUILD
index 7ab9918c1b..436636740d 100644
--- a/main/gcc/APKBUILD
+++ b/main/gcc/APKBUILD
@@ -4,6 +4,8 @@ pkgver=4.4.3
_pv=4.4.2
_specsver=0.1.7
_espfver=0.3.6
+_uclibc_abiver=0.9.32
+
pkgrel=0
pkgdesc="The GNU Compiler Collection"
url="http://gcc.gnu.org"
@@ -18,6 +20,7 @@ source="ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-core-$pkgver.tar.bz2
gcc-spec-env.patch
pt_gnu_eh_frame.patch
uclibc-getipinfo.patch
+ gcc-dynamic-linker.patch
"
# ftp://gcc.gnu.org/pub/gcc/releases/gcc-$pkgver/gcc-objc-$pkgver.tar.bz2
build ()
@@ -52,7 +55,6 @@ build ()
--disable-libstdcxx-pch \
--disable-multilib \
--disable-nls \
- --disable-threads \
--disable-werror \
--enable-__cxa_atexit \
--enable-cld \
@@ -61,7 +63,10 @@ build ()
--enable-shared \
--enable-target-optspace \
--enable-tls \
+ --enable-threads \
--with-arch=i486 \
+ --with-dynamic-linker=ld-uClibc.so.$_uclibc_abiver \
+ --with-dynamic-linker-prefix=/lib \
--with-system-zlib \
--without-system-libunwind
@@ -127,4 +132,5 @@ cd179ec4f05ee17ce76464da25a2674c gcc-g++-4.4.3.tar.bz2
528926b586b2591474b6c2a7ef8ee6d7 gcc-4.4.2-specs-0.1.7.tar.bz2
c4045bfa85d8be780affd465be9d8ca8 gcc-spec-env.patch
2db1e3482c5dd59dab70f701afa2ca80 pt_gnu_eh_frame.patch
-6cc2385c5bbd6d0da6eaedd53c8bf547 uclibc-getipinfo.patch"
+6cc2385c5bbd6d0da6eaedd53c8bf547 uclibc-getipinfo.patch
+6db5c87887beee75cde3cce86625b9ed gcc-dynamic-linker.patch"
diff --git a/main/gcc/gcc-dynamic-linker.patch b/main/gcc/gcc-dynamic-linker.patch
new file mode 100644
index 0000000000..9b34664515
--- /dev/null
+++ b/main/gcc/gcc-dynamic-linker.patch
@@ -0,0 +1,425 @@
+Submitted By: Kevin Day <thekevinday AT gmail DOT com>
+Date: 2008-12-19
+Initial Package Version: 4.3.2
+Upstream Status: Not submitted
+Description: Why not just be able to define the prefix of the dynamic linker instead of hardcoding it..
+This includes the --nostdinc patch as well, so think of this as a specs-3 patch
+This also allows for specifying the dynamic-linker as well
+
+diff -r -u gcc-4.4.0.orig/gcc/Makefile.in gcc-4.4.0/gcc/Makefile.in
+--- gcc-4.4.0.orig/gcc/Makefile.in 2009-06-06 09:15:56 -0500
++++ gcc-4.4.0/gcc/Makefile.in 2009-06-06 09:40:07 -0500
+@@ -893,7 +893,7 @@
+ # This is the variable actually used when we compile. If you change this,
+ # you probably want to update BUILD_CFLAGS in configure.ac
+ ALL_CFLAGS = $(T_CFLAGS) \
+- $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
++ $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@ @NOSTDINC@
+
+ # Likewise. Put INCLUDES at the beginning: this way, if some autoconf macro
+ # puts -I options in CPPFLAGS, our include files in the srcdir will always
+@@ -1947,6 +1947,8 @@
+ -DSTANDARD_STARTFILE_PREFIX=\"$(unlibsubdir)/\" \
+ -DSTANDARD_EXEC_PREFIX=\"$(libdir)/gcc/\" \
+ -DSTANDARD_LIBEXEC_PREFIX=\"$(libexecdir)/gcc/\" \
++ -DDYNAMIC_LINKER_PREFIX=\"@DYNAMICLINKERPREFIX@\" \
++ -DDYNAMIC_LINKER=\"@DYNAMICLINKER@\" \
+ -DDEFAULT_TARGET_VERSION=\"$(version)\" \
+ -DDEFAULT_TARGET_MACHINE=\"$(target_noncanonical)\" \
+ -DSTANDARD_BINDIR_PREFIX=\"$(bindir)/\" \
+diff -r -u gcc-4.4.0.orig/gcc/config/alpha/gnu.h gcc-4.4.0/gcc/config/alpha/gnu.h
+--- gcc-4.4.0.orig/gcc/config/alpha/gnu.h 2009-06-06 09:16:15 -0500
++++ gcc-4.4.0/gcc/config/alpha/gnu.h 2009-06-06 09:40:29 -0500
+@@ -11,7 +11,7 @@
+ } while (0)
+
+ #undef ELF_DYNAMIC_LINKER
+-#define ELF_DYNAMIC_LINKER "/lib/ld.so"
++#define ELF_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef STARTFILE_SPEC
+ #define STARTFILE_SPEC \
+diff -r -u gcc-4.4.0.orig/gcc/config/alpha/linux-elf.h gcc-4.4.0/gcc/config/alpha/linux-elf.h
+--- gcc-4.4.0.orig/gcc/config/alpha/linux-elf.h 2009-06-06 09:16:15 -0500
++++ gcc-4.4.0/gcc/config/alpha/linux-elf.h 2009-06-06 09:40:07 -0500
+@@ -27,8 +27,8 @@
+ #define EXTRA_SPECS \
+ { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #if UCLIBC_DEFAULT
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
+ #else
+diff -r -u gcc-4.4.0.orig/gcc/config/arm/linux-eabi.h gcc-4.4.0/gcc/config/arm/linux-eabi.h
+--- gcc-4.4.0.orig/gcc/config/arm/linux-eabi.h 2009-06-06 09:16:10 -0500
++++ gcc-4.4.0/gcc/config/arm/linux-eabi.h 2009-06-06 09:40:07 -0500
+@@ -61,7 +61,7 @@
+ /* Use ld-linux.so.3 so that it will be possible to run "classic"
+ GNU/Linux binaries on an EABI system. */
+ #undef GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.3"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ /* At this point, bpabi.h will have clobbered LINK_SPEC. We want to
+ use the GNU/Linux version, not the generic BPABI version. */
+diff -r -u gcc-4.4.0.orig/gcc/config/arm/linux-elf.h gcc-4.4.0/gcc/config/arm/linux-elf.h
+--- gcc-4.4.0.orig/gcc/config/arm/linux-elf.h 2009-06-06 09:16:10 -0500
++++ gcc-4.4.0/gcc/config/arm/linux-elf.h 2009-06-06 09:40:07 -0500
+@@ -62,7 +62,7 @@
+
+ #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #define LINUX_TARGET_LINK_SPEC "%{h*} %{version:-v} \
+ %{b} \
+diff -r -u gcc-4.4.0.orig/gcc/config/bfin/linux.h gcc-4.4.0/gcc/config/bfin/linux.h
+--- gcc-4.4.0.orig/gcc/config/bfin/linux.h 2009-06-06 09:16:15 -0500
++++ gcc-4.4.0/gcc/config/bfin/linux.h 2009-06-06 09:40:07 -0500
+@@ -22,7 +22,7 @@
+ %{shared:-G -Bdynamic} \
+ %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+- %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
++ %{!dynamic-linker:-dynamic-linker DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER}} \
+ %{static}} -init __init -fini __fini"
+
+ #define MD_UNWIND_SUPPORT "config/bfin/linux-unwind.h"
+diff -r -u gcc-4.4.0.orig/gcc/config/cris/linux.h gcc-4.4.0/gcc/config/cris/linux.h
+--- gcc-4.4.0.orig/gcc/config/cris/linux.h 2009-06-06 09:16:15 -0500
++++ gcc-4.4.0/gcc/config/cris/linux.h 2009-06-06 09:40:07 -0500
+@@ -103,7 +103,7 @@
+ #undef CRIS_DEFAULT_CPU_VERSION
+ #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ /* We need an -rpath-link to ld.so.1, and presumably to each directory
+ specified with -B. */
+diff -r -u gcc-4.4.0.orig/gcc/config/freebsd-spec.h gcc-4.4.0/gcc/config/freebsd-spec.h
+--- gcc-4.4.0.orig/gcc/config/freebsd-spec.h 2009-06-06 09:16:15 -0500
++++ gcc-4.4.0/gcc/config/freebsd-spec.h 2009-06-06 09:41:42 -0500
+@@ -144,7 +144,7 @@
+ #endif
+
+ #if FBSD_MAJOR < 6
+-#define FBSD_DYNAMIC_LINKER "/usr/libexec/ld-elf.so.1"
++#define FBSD_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #else
+-#define FBSD_DYNAMIC_LINKER "/libexec/ld-elf.so.1"
++#define FBSD_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #endif
+diff -r -u gcc-4.4.0.orig/gcc/config/frv/linux.h gcc-4.4.0/gcc/config/frv/linux.h
+--- gcc-4.4.0.orig/gcc/config/frv/linux.h 2009-06-06 09:16:11 -0500
++++ gcc-4.4.0/gcc/config/frv/linux.h 2009-06-06 09:40:07 -0500
+@@ -35,7 +35,7 @@
+ #define ENDFILE_SPEC \
+ "%{shared|pie:crtendS.o%s;:crtend.o%s} crtn.o%s"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+diff -r -u gcc-4.4.0.orig/gcc/config/i386/linux.h gcc-4.4.0/gcc/config/i386/linux.h
+--- gcc-4.4.0.orig/gcc/config/i386/linux.h 2009-06-06 09:16:11 -0500
++++ gcc-4.4.0/gcc/config/i386/linux.h 2009-06-06 09:40:07 -0500
+@@ -100,7 +100,7 @@
+
+ /* These macros may be overridden in k*bsd-gnu.h and i386/k*bsd-gnu.h. */
+ #define LINK_EMULATION "elf_i386"
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef ASM_SPEC
+ #define ASM_SPEC \
+diff -r -u gcc-4.4.0.orig/gcc/config/i386/linux64.h gcc-4.4.0/gcc/config/i386/linux64.h
+--- gcc-4.4.0.orig/gcc/config/i386/linux64.h 2009-06-06 09:16:11 -0500
++++ gcc-4.4.0/gcc/config/i386/linux64.h 2009-06-06 09:40:07 -0500
+@@ -58,8 +58,8 @@
+ When the -shared link option is used a final link is not being
+ done. */
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux-x86-64.so.2"
++#define GLIBC_DYNAMIC_LINKER32 "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef ASM_SPEC
+ #define ASM_SPEC "%{v:-V} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} \
+diff -r -u gcc-4.4.0.orig/gcc/config/ia64/linux.h gcc-4.4.0/gcc/config/ia64/linux.h
+--- gcc-4.4.0.orig/gcc/config/ia64/linux.h 2009-06-06 09:16:11 -0500
++++ gcc-4.4.0/gcc/config/ia64/linux.h 2009-06-06 09:40:07 -0500
+@@ -37,7 +37,7 @@
+ /* Define this for shared library support because it isn't in the main
+ linux.h file. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "\
+diff -r -u gcc-4.4.0.orig/gcc/config/knetbsd-gnu.h gcc-4.4.0/gcc/config/knetbsd-gnu.h
+--- gcc-4.4.0.orig/gcc/config/knetbsd-gnu.h 2009-06-06 09:16:15 -0500
++++ gcc-4.4.0/gcc/config/knetbsd-gnu.h 2009-06-06 09:40:59 -0500
+@@ -34,5 +34,5 @@
+
+ #ifdef GLIBC_DYNAMIC_LINKER
+ #undef GLIBC_DYNAMIC_LINKER
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #endif
+diff -r -u gcc-4.4.0.orig/gcc/config/linux.h gcc-4.4.0/gcc/config/linux.h
+--- gcc-4.4.0.orig/gcc/config/linux.h 2009-06-06 09:16:11 -0500
++++ gcc-4.4.0/gcc/config/linux.h 2009-06-06 09:40:07 -0500
+@@ -117,9 +117,9 @@
+ GLIBC_DYNAMIC_LINKER must be defined for each target using them, or
+ GLIBC_DYNAMIC_LINKER32 and GLIBC_DYNAMIC_LINKER64 for targets
+ supporting both 32-bit and 64-bit compilation. */
+-#define UCLIBC_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define UCLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #define LINUX_DYNAMIC_LINKER \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKER, UCLIBC_DYNAMIC_LINKER)
+ #define LINUX_DYNAMIC_LINKER32 \
+@@ -135,3 +135,8 @@
+ #define TARGET_HAS_SINCOS (OPTION_GLIBC)
+
+ #define TARGET_POSIX_IO
++
++#ifdef NOSTDINC
++#undef STANDARD_INCLUDE_DIR
++#define STANDARD_INCLUDE_DIR 0
++#endif
+diff -r -u gcc-4.4.0.orig/gcc/config/m32r/linux.h gcc-4.4.0/gcc/config/m32r/linux.h
+--- gcc-4.4.0.orig/gcc/config/m32r/linux.h 2009-06-06 09:16:11 -0500
++++ gcc-4.4.0/gcc/config/m32r/linux.h 2009-06-06 09:40:07 -0500
+@@ -58,7 +58,7 @@
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #if TARGET_LITTLE_ENDIAN
+diff -r -u gcc-4.4.0.orig/gcc/config/m68k/linux.h gcc-4.4.0/gcc/config/m68k/linux.h
+--- gcc-4.4.0.orig/gcc/config/m68k/linux.h 2009-06-06 09:16:11 -0500
++++ gcc-4.4.0/gcc/config/m68k/linux.h 2009-06-06 09:40:07 -0500
+@@ -84,7 +84,7 @@
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m m68kelf %{shared} \
+diff -r -u gcc-4.4.0.orig/gcc/config/mips/linux.h gcc-4.4.0/gcc/config/mips/linux.h
+--- gcc-4.4.0.orig/gcc/config/mips/linux.h 2009-06-06 09:16:11 -0500
++++ gcc-4.4.0/gcc/config/mips/linux.h 2009-06-06 09:40:07 -0500
+@@ -64,7 +64,7 @@
+ #undef MIPS_DEFAULT_GVALUE
+ #define MIPS_DEFAULT_GVALUE 0
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ /* Borrowed from sparc/linux.h */
+ #undef LINK_SPEC
+diff -r -u gcc-4.4.0.orig/gcc/config/mips/linux64.h gcc-4.4.0/gcc/config/mips/linux64.h
+--- gcc-4.4.0.orig/gcc/config/mips/linux64.h 2009-06-06 09:16:11 -0500
++++ gcc-4.4.0/gcc/config/mips/linux64.h 2009-06-06 09:40:07 -0500
+@@ -35,10 +35,10 @@
+ %{!shared: \
+ %{profile:-lc_p} %{!profile:-lc}}"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKERN32 "/lib32/ld.so.1"
+-#define UCLIBC_DYNAMIC_LINKERN32 "/lib32/ld-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKERN32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKERN32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #define LINUX_DYNAMIC_LINKERN32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32)
+
+diff -r -u gcc-4.4.0.orig/gcc/config/mn10300/linux.h gcc-4.4.0/gcc/config/mn10300/linux.h
+--- gcc-4.4.0.orig/gcc/config/mn10300/linux.h 2009-06-06 09:16:11 -0500
++++ gcc-4.4.0/gcc/config/mn10300/linux.h 2009-06-06 09:40:07 -0500
+@@ -32,7 +32,7 @@
+ #undef ASM_SPEC
+ #define ASM_SPEC "%{Wa,*:%*}"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "%{mrelax:--relax} %{shared:-shared} \
+diff -r -u gcc-4.4.0.orig/gcc/config/rs6000/linux64.h gcc-4.4.0/gcc/config/rs6000/linux64.h
+--- gcc-4.4.0.orig/gcc/config/rs6000/linux64.h 2009-06-06 09:16:15 -0500
++++ gcc-4.4.0/gcc/config/rs6000/linux64.h 2009-06-06 09:40:07 -0500
+@@ -342,10 +342,10 @@
+ #undef LINK_OS_DEFAULT_SPEC
+ #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld64.so.1"
+-#define UCLIBC_DYNAMIC_LINKER32 "/lib/ld-uClibc.so.0"
+-#define UCLIBC_DYNAMIC_LINKER64 "/lib/ld64-uClibc.so.0"
++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define UCLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #if UCLIBC_DEFAULT
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:%{muclibc:%e-mglibc and -muclibc used together}" G ";:" U "}"
+ #else
+diff -r -u gcc-4.4.0.orig/gcc/config/s390/linux.h gcc-4.4.0/gcc/config/s390/linux.h
+--- gcc-4.4.0.orig/gcc/config/s390/linux.h 2009-06-06 09:16:10 -0500
++++ gcc-4.4.0/gcc/config/s390/linux.h 2009-06-06 09:40:07 -0500
+@@ -72,8 +72,8 @@
+ #define MULTILIB_DEFAULTS { "m31" }
+ #endif
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld.so.1"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib/ld64.so.1"
++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+diff -r -u gcc-4.4.0.orig/gcc/config/sh/linux.h gcc-4.4.0/gcc/config/sh/linux.h
+--- gcc-4.4.0.orig/gcc/config/sh/linux.h 2009-06-06 09:16:15 -0500
++++ gcc-4.4.0/gcc/config/sh/linux.h 2009-06-06 09:40:07 -0500
+@@ -47,7 +47,7 @@
+
+ #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef SUBTARGET_LINK_EMUL_SUFFIX
+ #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
+diff -r -u gcc-4.4.0.orig/gcc/config/sparc/linux.h gcc-4.4.0/gcc/config/sparc/linux.h
+--- gcc-4.4.0.orig/gcc/config/sparc/linux.h 2009-06-06 09:16:15 -0500
++++ gcc-4.4.0/gcc/config/sparc/linux.h 2009-06-06 09:40:07 -0500
+@@ -83,7 +83,7 @@
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
+diff -r -u gcc-4.4.0.orig/gcc/config/sparc/linux64.h gcc-4.4.0/gcc/config/sparc/linux64.h
+--- gcc-4.4.0.orig/gcc/config/sparc/linux64.h 2009-06-06 09:16:15 -0500
++++ gcc-4.4.0/gcc/config/sparc/linux64.h 2009-06-06 09:40:07 -0500
+@@ -109,8 +109,8 @@
+
+ /* If ELF is the default format, we should not use /lib/elf. */
+
+-#define GLIBC_DYNAMIC_LINKER32 "/lib/ld-linux.so.2"
+-#define GLIBC_DYNAMIC_LINKER64 "/lib64/ld-linux.so.2"
++#define GLIBC_DYNAMIC_LINKER32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
++#define GLIBC_DYNAMIC_LINKER64 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #ifdef SPARC_BI_ARCH
+
+diff -r -u gcc-4.4.0.orig/gcc/config/xtensa/linux.h gcc-4.4.0/gcc/config/xtensa/linux.h
+--- gcc-4.4.0.orig/gcc/config/xtensa/linux.h 2009-06-06 09:16:10 -0500
++++ gcc-4.4.0/gcc/config/xtensa/linux.h 2009-06-06 09:40:07 -0500
+@@ -43,7 +43,7 @@
+ %{mlongcalls:--longcalls} \
+ %{mno-longcalls:--no-longcalls}"
+
+-#define GLIBC_DYNAMIC_LINKER "/lib/ld.so.1"
++#define GLIBC_DYNAMIC_LINKER DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+
+ #undef LINK_SPEC
+ #define LINK_SPEC \
+diff -r -u gcc-4.4.0.orig/gcc/configure gcc-4.4.0/gcc/configure
+--- gcc-4.4.0.orig/gcc/configure 2009-06-06 09:16:16 -0500
++++ gcc-4.4.0/gcc/configure 2009-06-06 09:40:07 -0500
+@@ -1118,6 +1118,14 @@
+ --with-gc={page,zone} choose the garbage collection mechanism to use
+ with the compiler
+ --with-system-zlib use installed libz
++ --with-dynamic-linker=PATH
++ specifies path to dynamic linker.
++ example: "/lib/ld-linux.so.2", where this defines "ld-linux.so.2"
++ --with-dynamic-linker-prefix=PATH
++ specifies path to dynamic linker.
++ example: "/lib/ld-linux.so.2", where this defines "/lib"
++ --with-nostdinc build gcc to ignore standard include directories.
++ You will have to use --with-local-prefix with this option.
+ --with-slibdir=DIR shared libraries in DIR [LIBDIR]
+ --with-datarootdir=DIR Use DIR as the data root [PREFIX/share]
+ --with-docdir=DIR Install documentation in DIR [DATAROOTDIR]
+@@ -5631,6 +5639,47 @@
+ #define SIZEOF_INT $ac_cv_sizeof_int
+ _ACEOF
+
++# Check whether --with-dynamic-linker was given.
++
++DYNAMICLINKER="ld-linux.so.2" ;
++if test "${with_dynamic_linker+set}" = set; then
++ withval="$with_dynamic_linker"
++ case "${withval}" in
++yes) { { echo "$as_me:$LINENO: error: bad value "${withval}". Use something like --with-dynamic-linker=$DYNAMICLINKER" >&5
++echo "$as_me: error: bad value "${withval}". Use something like --with-dynamic-linker=$DYNAMICLINKER" >&2;}
++ { (exit 1); exit 1; }; } ;;
++no) ;;
++*) DYNAMICLINKER=$withval ;;
++esac
++fi;
++
++# Check whether --with-dynamic-linker-prefix= was given.
++
++DYNAMICLINKERPREFIX="/lib" ;
++if test "${with_dynamic_linker_prefix+set}" = set; then
++ withval="$with_dynamic_linker_prefix"
++ case "${withval}" in
++yes) { { echo "$as_me:$LINENO: error: bad value "${withval}". Use --with-dynamic-linker-prefix=/path/to/lib/" >&5
++echo "$as_me: error: bad value "${withval}". Use --with-dynamic-linker-prefix=/path/to/lib/" >&2;}
++ { (exit 1); exit 1; }; } ;;
++no) ;;
++*) DYNAMICLINKERPREFIX=$withval ;;
++esac
++
++fi;
++
++# Check whether --with-nostdinc was given.
++
++if test "${with_nostdinc+set}" = set; then
++ withval="$with_nostdinc"
++ case "${withval}" in
++yes) NOSTDINC="-DNOSTDINC" ;;
++no) ;;
++*) NOSTDINC="-DNOSTDINC" ;;
++esac
++fi;
++
++
+
+ echo "$as_me:$LINENO: checking for long" >&5
+ echo $ECHO_N "checking for long... $ECHO_C" >&6
+@@ -25488,6 +25537,9 @@
+ s,@TARGET_SYSTEM_ROOT_DEFINE@,$TARGET_SYSTEM_ROOT_DEFINE,;t t
+ s,@CROSS_SYSTEM_HEADER_DIR@,$CROSS_SYSTEM_HEADER_DIR,;t t
+ s,@onestep@,$onestep,;t t
++s,@DYNAMICLINKER@,$DYNAMICLINKER,;t t
++s,@DYNAMICLINKERPREFIX@,$DYNAMICLINKERPREFIX,;t t
++s,@NOSTDINC@,$NOSTDINC,;t t
+ s,@PKGVERSION@,$PKGVERSION,;t t
+ s,@REPORT_BUGS_TO@,$REPORT_BUGS_TO,;t t
+ s,@REPORT_BUGS_TEXI@,$REPORT_BUGS_TEXI,;t t \ No newline at end of file