aboutsummaryrefslogtreecommitdiffstats
path: root/main/gcc/gcc-4.6-dynamic-linker.patch
diff options
context:
space:
mode:
Diffstat (limited to 'main/gcc/gcc-4.6-dynamic-linker.patch')
-rw-r--r--main/gcc/gcc-4.6-dynamic-linker.patch459
1 files changed, 459 insertions, 0 deletions
diff --git a/main/gcc/gcc-4.6-dynamic-linker.patch b/main/gcc/gcc-4.6-dynamic-linker.patch
new file mode 100644
index 0000000000..a6b235cd19
--- /dev/null
+++ b/main/gcc/gcc-4.6-dynamic-linker.patch
@@ -0,0 +1,459 @@
+commit d929f627aba264e63cf779cd4ca51af97b076445
+Author: Natanael Copa <ncopa@alpinelinux.org>
+Date: Tue Sep 28 09:45:17 2010 +0000
+
+ 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 --git a/gcc/Makefile.in b/gcc/Makefile.in
+index ae2416b..b0b9b2c 100644
+--- a/gcc/Makefile.in
++++ b/gcc/Makefile.in
+@@ -971,7 +971,7 @@ INTERNAL_CFLAGS = -DIN_GCC @CROSS@
+ # 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 = $(ESP_NOPIE_CFLAGS) $(T_CFLAGS) $(CFLAGS-$@) \
+- $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@
++ $(CFLAGS) $(INTERNAL_CFLAGS) $(COVERAGE_FLAGS) $(WARN_CFLAGS) @DEFS@ @NOSTDINC@
+
+ # The C++ version.
+ ALL_CXXFLAGS = $(T_CFLAGS) $(CXXFLAGS) $(INTERNAL_CFLAGS) \
+@@ -2105,6 +2105,8 @@ DRIVER_DEFINES = \
+ -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 --git a/gcc/config/alpha/gnu.h b/gcc/config/alpha/gnu.h
+index f98c3e7..bd16dcf 100644
+--- a/gcc/config/alpha/gnu.h
++++ b/gcc/config/alpha/gnu.h
+@@ -34,7 +34,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ } 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 --git a/gcc/config/alpha/linux-elf.h b/gcc/config/alpha/linux-elf.h
+index c48fc93..3068717 100644
+--- a/gcc/config/alpha/linux-elf.h
++++ b/gcc/config/alpha/linux-elf.h
+@@ -27,8 +27,8 @@ along with GCC; see the file COPYING3. If not see
+ #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 DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #else
+diff --git a/gcc/config/arm/linux-eabi.h b/gcc/config/arm/linux-eabi.h
+index fce1ed1..c3bcd50 100644
+--- a/gcc/config/arm/linux-eabi.h
++++ b/gcc/config/arm/linux-eabi.h
+@@ -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 --git a/gcc/config/arm/linux-elf.h b/gcc/config/arm/linux-elf.h
+index 9fdca41..65b0a5a 100644
+--- a/gcc/config/arm/linux-elf.h
++++ b/gcc/config/arm/linux-elf.h
+@@ -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 --git a/gcc/config/bfin/linux.h b/gcc/config/bfin/linux.h
+index 5c716cd..b5e464e 100644
+--- a/gcc/config/bfin/linux.h
++++ b/gcc/config/bfin/linux.h
+@@ -45,7 +45,7 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ %{shared:-G -Bdynamic} \
+ %{!shared: %{!static: \
+ %{rdynamic:-export-dynamic} \
+- -dynamic-linker /lib/ld-uClibc.so.0} \
++ -dynamic-linker DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER} \
+ %{static}} -init __init -fini __fini"
+
+ #define MD_UNWIND_SUPPORT "config/bfin/linux-unwind.h"
+diff --git a/gcc/config/cris/linux.h b/gcc/config/cris/linux.h
+index 38f0a7e..6893407 100644
+--- a/gcc/config/cris/linux.h
++++ b/gcc/config/cris/linux.h
+@@ -103,7 +103,7 @@ along with GCC; see the file COPYING3. If not see
+ #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 --git a/gcc/config/freebsd-spec.h b/gcc/config/freebsd-spec.h
+index 84d8127..fb3e79a 100644
+--- a/gcc/config/freebsd-spec.h
++++ b/gcc/config/freebsd-spec.h
+@@ -144,9 +144,9 @@ is built with the --enable-threads configure-time option.} \
+ #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
+
+ #if defined(HAVE_LD_EH_FRAME_HDR)
+diff --git a/gcc/config/frv/linux.h b/gcc/config/frv/linux.h
+index 71cd094..221d01d 100644
+--- a/gcc/config/frv/linux.h
++++ b/gcc/config/frv/linux.h
+@@ -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 --git a/gcc/config/i386/linux.h b/gcc/config/i386/linux.h
+index 2a31880..9c08adb 100644
+--- a/gcc/config/i386/linux.h
++++ b/gcc/config/i386/linux.h
+@@ -100,7 +100,7 @@ along with GCC; see the file COPYING3. If not see
+
+ /* 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 --git a/gcc/config/i386/linux64.h b/gcc/config/i386/linux64.h
+index 867de59..274acca 100644
+--- a/gcc/config/i386/linux64.h
++++ b/gcc/config/i386/linux64.h
+@@ -58,8 +58,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ 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
+
+ #if TARGET_64BIT_DEFAULT
+ #define SPEC_32 "m32"
+diff --git a/gcc/config/ia64/linux.h b/gcc/config/ia64/linux.h
+index 587a4f4..450fcb5 100644
+--- a/gcc/config/ia64/linux.h
++++ b/gcc/config/ia64/linux.h
+@@ -61,7 +61,7 @@ do { \
+ /* 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 --git a/gcc/config/knetbsd-gnu.h b/gcc/config/knetbsd-gnu.h
+index 4cc8eb7..bb7a063 100644
+--- a/gcc/config/knetbsd-gnu.h
++++ b/gcc/config/knetbsd-gnu.h
+@@ -34,5 +34,5 @@ along with GCC; see the file COPYING3. If not see
+
+ #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 --git a/gcc/config/linux.h b/gcc/config/linux.h
+index e567e9a..c052fd0 100644
+--- a/gcc/config/linux.h
++++ b/gcc/config/linux.h
+@@ -117,9 +117,9 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+ 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 BIONIC_DYNAMIC_LINKER "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER32 "/system/bin/linker"
+ #define BIONIC_DYNAMIC_LINKER64 "/system/bin/linker64"
+@@ -135,3 +135,8 @@ see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
+
+ /* Whether we have sincos that follows the GNU extension. */
+ #define TARGET_HAS_SINCOS (OPTION_GLIBC || OPTION_BIONIC)
++
++#ifdef NOSTDINC
++#undef STANDARD_INCLUDE_DIR
++#define STANDARD_INCLUDE_DIR 0
++#endif
+diff --git a/gcc/config/m32r/linux.h b/gcc/config/m32r/linux.h
+index 0515e5b..019e850 100644
+--- a/gcc/config/m32r/linux.h
++++ b/gcc/config/m32r/linux.h
+@@ -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 --git a/gcc/config/m68k/linux.h b/gcc/config/m68k/linux.h
+index 1d73ee0..e57cf50 100644
+--- a/gcc/config/m68k/linux.h
++++ b/gcc/config/m68k/linux.h
+@@ -84,7 +84,7 @@ along with GCC; see the file COPYING3. If not see
+
+ /* 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 --git a/gcc/config/mips/linux.h b/gcc/config/mips/linux.h
+index 0512ef7..7efe2fd 100644
+--- a/gcc/config/mips/linux.h
++++ b/gcc/config/mips/linux.h
+@@ -64,7 +64,7 @@ along with GCC; see the file COPYING3. If not see
+ #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 --git a/gcc/config/mips/linux64.h b/gcc/config/mips/linux64.h
+index 2f24dfa..850cb22 100644
+--- a/gcc/config/mips/linux64.h
++++ b/gcc/config/mips/linux64.h
+@@ -35,10 +35,10 @@ along with GCC; see the file COPYING3. If not see
+ %{!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 BIONIC_DYNAMIC_LINKERN32 "/system/bin/linker32"
++#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 BIONIC_DYNAMIC_LINKERN32 DYNAMIC_LINKER_PREFIX "/" DYNAMIC_LINKER
+ #define LINUX_DYNAMIC_LINKERN32 \
+ CHOOSE_DYNAMIC_LINKER (GLIBC_DYNAMIC_LINKERN32, UCLIBC_DYNAMIC_LINKERN32, \
+ BIONIC_DYNAMIC_LINKERN32)
+diff --git a/gcc/config/mn10300/linux.h b/gcc/config/mn10300/linux.h
+index ac9f8c5..8ab78b1 100644
+--- a/gcc/config/mn10300/linux.h
++++ b/gcc/config/mn10300/linux.h
+@@ -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 --git a/gcc/config/rs6000/linux64.h b/gcc/config/rs6000/linux64.h
+index da7bca3..c36e7d6 100644
+--- a/gcc/config/rs6000/linux64.h
++++ b/gcc/config/rs6000/linux64.h
+@@ -348,10 +348,10 @@ extern int dot_symbols;
+ #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 DEFAULT_LIBC == LIBC_UCLIBC
+ #define CHOOSE_DYNAMIC_LINKER(G, U) "%{mglibc:" G ";:" U "}"
+ #elif DEFAULT_LIBC == LIBC_GLIBC
+diff --git a/gcc/config/s390/linux.h b/gcc/config/s390/linux.h
+index ddbcfa9..59bfd28 100644
+--- a/gcc/config/s390/linux.h
++++ b/gcc/config/s390/linux.h
+@@ -72,8 +72,8 @@ along with GCC; see the file COPYING3. If not see
+ #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 --git a/gcc/config/sh/linux.h b/gcc/config/sh/linux.h
+index d513af8..2ad27a7 100644
+--- a/gcc/config/sh/linux.h
++++ b/gcc/config/sh/linux.h
+@@ -47,7 +47,7 @@ along with GCC; see the file COPYING3. If not see
+
+ #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 --git a/gcc/config/sparc/linux.h b/gcc/config/sparc/linux.h
+index b12c881..83bdd8e 100644
+--- a/gcc/config/sparc/linux.h
++++ b/gcc/config/sparc/linux.h
+@@ -83,7 +83,7 @@ along with GCC; see the file COPYING3. If not see
+
+ /* 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 --git a/gcc/config/sparc/linux64.h b/gcc/config/sparc/linux64.h
+index c2e78d7..8481a34 100644
+--- a/gcc/config/sparc/linux64.h
++++ b/gcc/config/sparc/linux64.h
+@@ -109,8 +109,8 @@ along with GCC; see the file COPYING3. If not see
+
+ /* 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 --git a/gcc/config/xtensa/linux.h b/gcc/config/xtensa/linux.h
+index 69ab626..ebc8e0b 100644
+--- a/gcc/config/xtensa/linux.h
++++ b/gcc/config/xtensa/linux.h
+@@ -43,7 +43,7 @@ along with GCC; see the file COPYING3. If not see
+ %{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 --git a/gcc/configure b/gcc/configure
+index b623a4a..230719b 100755
+--- a/gcc/configure
++++ b/gcc/configure
+@@ -757,6 +757,9 @@ AWK
+ SET_MAKE
+ REPORT_BUGS_TEXI
+ REPORT_BUGS_TO
++DYNAMICLINKER
++DYNAMICLINKERPREFIX
++NOSTDINC
+ PKGVERSION
+ onestep
+ CONFIGURE_SPECS
+@@ -1657,6 +1660,14 @@ Optional Packages:
+ --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]
+
+ Some influential environment variables:
+@@ -6065,6 +6076,47 @@ fi
+
+
+
++# 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;
++
++
+
+ # ---------------------
+ # Warnings and checking