patches/gcc/4.1.1/100-uclibc-conf.patch
changeset 1 eeea35fbf182
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/patches/gcc/4.1.1/100-uclibc-conf.patch	Sat Feb 24 11:00:05 2007 +0000
     1.3 @@ -0,0 +1,544 @@
     1.4 +--- gcc-4.1.0/gcc/config/t-linux-uclibc
     1.5 ++++ gcc-4.1.0/gcc/config/t-linux-uclibc
     1.6 +@@ -0,0 +1,5 @@
     1.7 ++# Remove glibc specific files added in t-linux
     1.8 ++SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
     1.9 ++
    1.10 ++# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
    1.11 ++LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
    1.12 +--- gcc-4.1.0/gcc/config.gcc
    1.13 ++++ gcc-4.1.0/gcc/config.gcc
    1.14 +@@ -1887,7 +1887,7 @@ s390x-ibm-tpf*)
    1.15 + 	;;
    1.16 + sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
    1.17 + sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
    1.18 +-  sh-*-linux* | sh[346lbe]*-*-linux* | \
    1.19 ++  sh*-*-linux* | sh[346lbe]*-*-linux* | \
    1.20 +   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
    1.21 +    sh64-*-netbsd* | sh64l*-*-netbsd*)
    1.22 + 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
    1.23 +@@ -2341,6 +2341,12 @@ m32c-*-elf*)
    1.24 + 	;;
    1.25 + esac
    1.26 + 
    1.27 ++# Rather than hook into each target, just do it after all the linux
    1.28 ++# targets have been processed
    1.29 ++case ${target} in
    1.30 ++*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
    1.31 ++esac
    1.32 ++
    1.33 + case ${target} in
    1.34 + i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1)
    1.35 + 	tmake_file="${tmake_file} i386/t-gmm_malloc"
    1.36 +--- gcc-4.1.0/boehm-gc/configure
    1.37 ++++ gcc-4.1.0/boehm-gc/configure
    1.38 +@@ -4320,6 +4320,11 @@ linux-gnu*)
    1.39 +   lt_cv_deplibs_check_method=pass_all
    1.40 +   ;;
    1.41 + 
    1.42 ++linux-uclibc*)
    1.43 ++  lt_cv_deplibs_check_method=pass_all
    1.44 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
    1.45 ++  ;;
    1.46 ++
    1.47 + netbsd* | knetbsd*-gnu)
    1.48 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
    1.49 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
    1.50 +--- gcc-4.1.0/configure
    1.51 ++++ gcc-4.1.0/configure
    1.52 +@@ -1133,7 +1133,7 @@ no)
    1.53 +     ;;
    1.54 + "")
    1.55 +     case "${target}" in
    1.56 +-    *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
    1.57 ++    *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
    1.58 +         # Enable libmudflap by default in GNU and friends.
    1.59 + 	;;
    1.60 +     *-*-freebsd*)
    1.61 +--- gcc-4.1.0/configure.in
    1.62 ++++ gcc-4.1.0/configure.in
    1.63 +@@ -341,7 +341,7 @@ no)
    1.64 +     ;;
    1.65 + "")
    1.66 +     case "${target}" in
    1.67 +-    *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
    1.68 ++    *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
    1.69 +         # Enable libmudflap by default in GNU and friends.
    1.70 + 	;;
    1.71 +     *-*-freebsd*)
    1.72 +--- gcc-4.1.0/contrib/regression/objs-gcc.sh
    1.73 ++++ gcc-4.1.0/contrib/regression/objs-gcc.sh
    1.74 +@@ -105,6 +105,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
    1.75 +  then
    1.76 +   make all-gdb all-dejagnu all-ld || exit 1
    1.77 +   make install-gdb install-dejagnu install-ld || exit 1
    1.78 ++elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
    1.79 ++ then
    1.80 ++  make all-gdb all-dejagnu all-ld || exit 1
    1.81 ++  make install-gdb install-dejagnu install-ld || exit 1
    1.82 + elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
    1.83 +   make bootstrap || exit 1
    1.84 +   make install || exit 1
    1.85 +--- gcc-4.1.0/gcc/config/alpha/linux-elf.h
    1.86 ++++ gcc-4.1.0/gcc/config/alpha/linux-elf.h
    1.87 +@@ -27,7 +27,11 @@ Boston, MA 02110-1301, USA.  */
    1.88 + #define SUBTARGET_EXTRA_SPECS \
    1.89 + { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
    1.90 + 
    1.91 ++#if defined USE_UCLIBC
    1.92 ++#define ELF_DYNAMIC_LINKER	"/lib/ld-uClibc.so.0"
    1.93 ++#else
    1.94 + #define ELF_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
    1.95 ++#endif
    1.96 + 
    1.97 + #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax}		\
    1.98 +   %{O*:-O3} %{!O*:-O1}						\
    1.99 +--- gcc-4.1.0/gcc/config/arm/linux-elf.h
   1.100 ++++ gcc-4.1.0/gcc/config/arm/linux-elf.h
   1.101 +@@ -51,7 +51,11 @@
   1.102 + 
   1.103 + #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
   1.104 + 
   1.105 ++#ifdef USE_UCLIBC
   1.106 ++#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
   1.107 ++#else
   1.108 + #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
   1.109 ++#endif
   1.110 + 
   1.111 + #define LINUX_TARGET_LINK_SPEC  "%{h*} %{version:-v} \
   1.112 +    %{b} \
   1.113 +--- gcc-4.1.0/gcc/config/cris/linux.h
   1.114 ++++ gcc-4.1.0/gcc/config/cris/linux.h
   1.115 +@@ -73,6 +73,25 @@ Boston, MA 02110-1301, USA.  */
   1.116 + #undef CRIS_DEFAULT_CPU_VERSION
   1.117 + #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
   1.118 + 
   1.119 ++#ifdef USE_UCLIBC
   1.120 ++
   1.121 ++#undef CRIS_SUBTARGET_VERSION
   1.122 ++#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
   1.123 ++
   1.124 ++#undef CRIS_LINK_SUBTARGET_SPEC
   1.125 ++#define CRIS_LINK_SUBTARGET_SPEC \
   1.126 ++ "-mcrislinux\
   1.127 ++  -rpath-link include/asm/../..%s\
   1.128 ++  %{shared} %{static}\
   1.129 ++  %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
   1.130 ++  %{!shared: \
   1.131 ++    %{!static: \
   1.132 ++      %{rdynamic:-export-dynamic} \
   1.133 ++      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
   1.134 ++  %{!r:%{O2|O3: --gc-sections}}"
   1.135 ++
   1.136 ++#else  /* USE_UCLIBC */
   1.137 ++
   1.138 + #undef CRIS_SUBTARGET_VERSION
   1.139 + #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
   1.140 + 
   1.141 +@@ -87,6 +106,8 @@ Boston, MA 02110-1301, USA.  */
   1.142 +   %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
   1.143 +   %{!r:%{O2|O3: --gc-sections}}"
   1.144 + 
   1.145 ++#endif  /* USE_UCLIBC */
   1.146 ++
   1.147 + 
   1.148 + /* Node: Run-time Target */
   1.149 + 
   1.150 +--- gcc-4.1.0/gcc/config/i386/linux.h
   1.151 ++++ gcc-4.1.0/gcc/config/i386/linux.h
   1.152 +@@ -107,6 +107,11 @@ Boston, MA 02110-1301, USA.  */
   1.153 + #define LINK_EMULATION "elf_i386"
   1.154 + #define DYNAMIC_LINKER "/lib/ld-linux.so.2"
   1.155 + 
   1.156 ++#if defined USE_UCLIBC
   1.157 ++#undef DYNAMIC_LINKER
   1.158 ++#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   1.159 ++#endif
   1.160 ++
   1.161 + #undef  SUBTARGET_EXTRA_SPECS
   1.162 + #define SUBTARGET_EXTRA_SPECS \
   1.163 +   { "link_emulation", LINK_EMULATION },\
   1.164 +--- gcc-4.1.0/gcc/config/i386/linux64.h
   1.165 ++++ gcc-4.1.0/gcc/config/i386/linux64.h
   1.166 +@@ -54,14 +54,21 @@ Boston, MA 02110-1301, USA.  */
   1.167 +    When the -shared link option is used a final link is not being
   1.168 +    done.  */
   1.169 + 
   1.170 ++#ifdef USE_UCLIBC
   1.171 ++#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   1.172 ++#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
   1.173 ++#else
   1.174 ++#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2"
   1.175 ++#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2"
   1.176 ++#endif
   1.177 + #undef	LINK_SPEC
   1.178 + #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
   1.179 +   %{shared:-shared} \
   1.180 +   %{!shared: \
   1.181 +     %{!static: \
   1.182 +       %{rdynamic:-export-dynamic} \
   1.183 +-      %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
   1.184 +-      %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
   1.185 ++      %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \
   1.186 ++      %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \
   1.187 +     %{static:-static}}"
   1.188 + 
   1.189 + /* Similar to standard Linux, but adding -ffast-math support.  */
   1.190 +--- gcc-4.1.0/gcc/config/ia64/linux.h
   1.191 ++++ gcc-4.1.0/gcc/config/ia64/linux.h
   1.192 +@@ -37,13 +37,18 @@ do {						\
   1.193 + /* Define this for shared library support because it isn't in the main
   1.194 +    linux.h file.  */
   1.195 + 
   1.196 ++#ifdef USE_UCLIBC
   1.197 ++#define ELF_DYNAMIC_LINKER	"/lib/ld-uClibc.so.0"
   1.198 ++#else
   1.199 ++#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
   1.200 ++#endif
   1.201 + #undef LINK_SPEC
   1.202 + #define LINK_SPEC "\
   1.203 +   %{shared:-shared} \
   1.204 +   %{!shared: \
   1.205 +     %{!static: \
   1.206 +       %{rdynamic:-export-dynamic} \
   1.207 +-      %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
   1.208 ++      %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   1.209 +       %{static:-static}}"
   1.210 + 
   1.211 + 
   1.212 +--- gcc-4.1.0/gcc/config/m68k/linux.h
   1.213 ++++ gcc-4.1.0/gcc/config/m68k/linux.h
   1.214 +@@ -123,12 +123,17 @@ Boston, MA 02110-1301, USA.  */
   1.215 + 
   1.216 + /* If ELF is the default format, we should not use /lib/elf.  */
   1.217 + 
   1.218 ++#ifdef USE_UCLIBC
   1.219 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   1.220 ++#else
   1.221 ++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
   1.222 ++#endif
   1.223 + #undef	LINK_SPEC
   1.224 + #define LINK_SPEC "-m m68kelf %{shared} \
   1.225 +   %{!shared: \
   1.226 +     %{!static: \
   1.227 +       %{rdynamic:-export-dynamic} \
   1.228 +-      %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
   1.229 ++      %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   1.230 +     %{static}}"
   1.231 + 
   1.232 + /* For compatibility with linux/a.out */
   1.233 +--- gcc-4.1.0/gcc/config/mips/linux.h
   1.234 ++++ gcc-4.1.0/gcc/config/mips/linux.h
   1.235 +@@ -105,6 +105,11 @@ Boston, MA 02110-1301, USA.  */
   1.236 + 
   1.237 + /* Borrowed from sparc/linux.h */
   1.238 + #undef LINK_SPEC
   1.239 ++#ifdef USE_UCLIBC
   1.240 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   1.241 ++#else
   1.242 ++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
   1.243 ++#endif
   1.244 + #define LINK_SPEC \
   1.245 +  "%(endian_spec) \
   1.246 +   %{shared:-shared} \
   1.247 +@@ -112,7 +117,7 @@ Boston, MA 02110-1301, USA.  */
   1.248 +     %{!ibcs: \
   1.249 +       %{!static: \
   1.250 +         %{rdynamic:-export-dynamic} \
   1.251 +-        %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
   1.252 ++        %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   1.253 +         %{static:-static}}}"
   1.254 + 
   1.255 + #undef SUBTARGET_ASM_SPEC
   1.256 +--- gcc-4.1.0/gcc/config/pa/pa-linux.h
   1.257 ++++ gcc-4.1.0/gcc/config/pa/pa-linux.h
   1.258 +@@ -49,13 +49,18 @@ Boston, MA 02110-1301, USA.  */
   1.259 + /* Define this for shared library support because it isn't in the main
   1.260 +    linux.h file.  */
   1.261 + 
   1.262 ++#ifdef USE_UCLIBC
   1.263 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   1.264 ++#else
   1.265 ++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
   1.266 ++#endif
   1.267 + #undef LINK_SPEC
   1.268 + #define LINK_SPEC "\
   1.269 +   %{shared:-shared} \
   1.270 +   %{!shared: \
   1.271 +     %{!static: \
   1.272 +       %{rdynamic:-export-dynamic} \
   1.273 +-      %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
   1.274 ++      %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   1.275 +       %{static:-static}}"
   1.276 + 
   1.277 + /* glibc's profiling functions don't need gcc to allocate counters.  */
   1.278 +--- gcc-4.1.0/gcc/config/rs6000/linux.h
   1.279 ++++ gcc-4.1.0/gcc/config/rs6000/linux.h
   1.280 +@@ -72,7 +72,11 @@
   1.281 + #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
   1.282 + 
   1.283 + #undef	LINK_OS_DEFAULT_SPEC
   1.284 ++#ifdef USE_UCLIBC
   1.285 ++#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
   1.286 ++#else
   1.287 + #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
   1.288 ++#endif
   1.289 + 
   1.290 + #define LINK_GCC_C_SEQUENCE_SPEC \
   1.291 +   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
   1.292 +--- gcc-4.1.0/gcc/config/rs6000/sysv4.h
   1.293 ++++ gcc-4.1.0/gcc/config/rs6000/sysv4.h
   1.294 +@@ -866,6 +866,7 @@ extern int fixuplabelno;
   1.295 +   mcall-linux  : %(link_os_linux)       ; \
   1.296 +   mcall-gnu    : %(link_os_gnu)         ; \
   1.297 +   mcall-netbsd : %(link_os_netbsd)      ; \
   1.298 ++  mcall-linux-uclibc : %(link_os_linux_uclibc); \
   1.299 +   mcall-openbsd: %(link_os_openbsd)     ; \
   1.300 +                : %(link_os_default)     }"
   1.301 + 
   1.302 +@@ -1043,6 +1044,10 @@ extern int fixuplabelno;
   1.303 +   %{rdynamic:-export-dynamic} \
   1.304 +   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
   1.305 + 
   1.306 ++#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
   1.307 ++  %{rdynamic:-export-dynamic} \
   1.308 ++  %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
   1.309 ++
   1.310 + #if defined(HAVE_LD_EH_FRAME_HDR)
   1.311 + # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
   1.312 + #endif
   1.313 +@@ -1209,6 +1214,7 @@ ncrtn.o%s"
   1.314 +   { "link_os_sim",		LINK_OS_SIM_SPEC },			\
   1.315 +   { "link_os_freebsd",		LINK_OS_FREEBSD_SPEC },			\
   1.316 +   { "link_os_linux",		LINK_OS_LINUX_SPEC },			\
   1.317 ++  { "link_os_linux_uclibc",	LINK_OS_LINUX_UCLIBC_SPEC },		\
   1.318 +   { "link_os_gnu",		LINK_OS_GNU_SPEC },			\
   1.319 +   { "link_os_netbsd",		LINK_OS_NETBSD_SPEC },			\
   1.320 +   { "link_os_openbsd",		LINK_OS_OPENBSD_SPEC },			\
   1.321 +--- gcc-4.1.0/gcc/config/s390/linux.h
   1.322 ++++ gcc-4.1.0/gcc/config/s390/linux.h
   1.323 +@@ -77,6 +77,13 @@ Software Foundation, 51 Franklin Street,
   1.324 + #define MULTILIB_DEFAULTS { "m31" }
   1.325 + #endif
   1.326 + 
   1.327 ++#ifdef USE_UCLIBC
   1.328 ++#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   1.329 ++#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
   1.330 ++#else
   1.331 ++#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1"
   1.332 ++#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1"
   1.333 ++#endif
   1.334 + #undef  LINK_SPEC
   1.335 + #define LINK_SPEC \
   1.336 +   "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
   1.337 +@@ -86,8 +93,8 @@ Software Foundation, 51 Franklin Street,
   1.338 +       %{!static: \
   1.339 + 	%{rdynamic:-export-dynamic} \
   1.340 + 	%{!dynamic-linker: \
   1.341 +-          %{m31:-dynamic-linker /lib/ld.so.1} \
   1.342 +-          %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
   1.343 ++          %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \
   1.344 ++          %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}"
   1.345 + 
   1.346 + 
   1.347 + #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
   1.348 +--- gcc-4.1.0/gcc/config/sh/linux.h
   1.349 ++++ gcc-4.1.0/gcc/config/sh/linux.h
   1.350 +@@ -56,12 +56,21 @@ Boston, MA 02110-1301, USA.  */
   1.351 + #undef SUBTARGET_LINK_EMUL_SUFFIX
   1.352 + #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
   1.353 + #undef SUBTARGET_LINK_SPEC
   1.354 ++#ifdef USE_UCLIBC
   1.355 ++#define SUBTARGET_LINK_SPEC \
   1.356 ++  "%{shared:-shared} \
   1.357 ++   %{!static: \
   1.358 ++     %{rdynamic:-export-dynamic} \
   1.359 ++     %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
   1.360 ++   %{static:-static}"
   1.361 ++#else
   1.362 + #define SUBTARGET_LINK_SPEC \
   1.363 +   "%{shared:-shared} \
   1.364 +    %{!static: \
   1.365 +      %{rdynamic:-export-dynamic} \
   1.366 +      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
   1.367 +    %{static:-static}"
   1.368 ++#endif
   1.369 + 
   1.370 + /* Output assembler code to STREAM to call the profiler.  */
   1.371 + 
   1.372 +--- gcc-4.1.0/gcc/config/sparc/linux.h
   1.373 ++++ gcc-4.1.0/gcc/config/sparc/linux.h
   1.374 +@@ -125,6 +125,11 @@ Boston, MA 02110-1301, USA.  */
   1.375 + 
   1.376 + /* If ELF is the default format, we should not use /lib/elf.  */
   1.377 + 
   1.378 ++#ifdef USE_UCLIBC
   1.379 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
   1.380 ++#else
   1.381 ++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
   1.382 ++#endif
   1.383 + #undef  LINK_SPEC
   1.384 + #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
   1.385 +   %{!mno-relax:%{!r:-relax}} \
   1.386 +@@ -132,7 +137,7 @@ Boston, MA 02110-1301, USA.  */
   1.387 +     %{!ibcs: \
   1.388 +       %{!static: \
   1.389 +         %{rdynamic:-export-dynamic} \
   1.390 +-        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
   1.391 ++        %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   1.392 +         %{static:-static}}}"
   1.393 + 
   1.394 + /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
   1.395 +--- gcc-4.1.0/gcc/config/sparc/linux64.h
   1.396 ++++ gcc-4.1.0/gcc/config/sparc/linux64.h
   1.397 +@@ -162,12 +162,17 @@ Boston, MA 02110-1301, USA.  */
   1.398 +   { "link_arch_default", LINK_ARCH_DEFAULT_SPEC },	  \
   1.399 +   { "link_arch",	 LINK_ARCH_SPEC },
   1.400 +     
   1.401 ++#ifdef USE_UCLIBC
   1.402 ++#define ELF_DYNAMIC_LINKER	"/lib/ld-uClibc.so.0"
   1.403 ++#else
   1.404 ++#define ELF_DYNAMIC_LINKER  "/lib/ld-linux.so.2"
   1.405 ++#endif
   1.406 + #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
   1.407 +   %{!shared: \
   1.408 +     %{!ibcs: \
   1.409 +       %{!static: \
   1.410 +         %{rdynamic:-export-dynamic} \
   1.411 +-        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
   1.412 ++        %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
   1.413 +         %{static:-static}}} \
   1.414 + "
   1.415 + 
   1.416 +--- gcc-4.1.0/libffi/configure
   1.417 ++++ gcc-4.1.0/libffi/configure
   1.418 +@@ -3457,6 +3457,11 @@ linux-gnu*)
   1.419 +   lt_cv_deplibs_check_method=pass_all
   1.420 +   ;;
   1.421 + 
   1.422 ++linux-uclibc*)
   1.423 ++  lt_cv_deplibs_check_method=pass_all
   1.424 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   1.425 ++  ;;
   1.426 ++
   1.427 + netbsd* | knetbsd*-gnu)
   1.428 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   1.429 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   1.430 +--- gcc-4.1.0/libgfortran/configure
   1.431 ++++ gcc-4.1.0/libgfortran/configure
   1.432 +@@ -3699,6 +3699,11 @@ linux-gnu*)
   1.433 +   lt_cv_deplibs_check_method=pass_all
   1.434 +   ;;
   1.435 + 
   1.436 ++linux-uclibc*)
   1.437 ++  lt_cv_deplibs_check_method=pass_all
   1.438 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   1.439 ++  ;;
   1.440 ++
   1.441 + netbsd* | knetbsd*-gnu)
   1.442 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   1.443 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   1.444 +--- gcc-4.1.0/libjava/configure
   1.445 ++++ gcc-4.1.0/libjava/configure
   1.446 +@@ -5137,6 +5137,11 @@ linux-gnu*)
   1.447 +   lt_cv_deplibs_check_method=pass_all
   1.448 +   ;;
   1.449 + 
   1.450 ++linux-uclibc*)
   1.451 ++  lt_cv_deplibs_check_method=pass_all
   1.452 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   1.453 ++  ;;
   1.454 ++
   1.455 + netbsd* | knetbsd*-gnu)
   1.456 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   1.457 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   1.458 +--- gcc-4.1.0/libmudflap/configure
   1.459 ++++ gcc-4.1.0/libmudflap/configure
   1.460 +@@ -5382,6 +5382,11 @@ linux-gnu*)
   1.461 +   lt_cv_deplibs_check_method=pass_all
   1.462 +   ;;
   1.463 + 
   1.464 ++linux-uclibc*)
   1.465 ++  lt_cv_deplibs_check_method=pass_all
   1.466 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   1.467 ++  ;;
   1.468 ++
   1.469 + netbsd* | knetbsd*-gnu)
   1.470 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   1.471 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   1.472 +--- gcc-4.1.0/libobjc/configure
   1.473 ++++ gcc-4.1.0/libobjc/configure
   1.474 +@@ -3312,6 +3312,11 @@ linux-gnu*)
   1.475 +   lt_cv_deplibs_check_method=pass_all
   1.476 +   ;;
   1.477 + 
   1.478 ++linux-uclibc*)
   1.479 ++  lt_cv_deplibs_check_method=pass_all
   1.480 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   1.481 ++  ;;
   1.482 ++
   1.483 + netbsd* | knetbsd*-gnu)
   1.484 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   1.485 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
   1.486 +--- gcc-4.1.0/libtool.m4
   1.487 ++++ gcc-4.1.0/libtool.m4
   1.488 +@@ -743,6 +743,11 @@ linux-gnu*)
   1.489 +   lt_cv_deplibs_check_method=pass_all
   1.490 +   ;;
   1.491 + 
   1.492 ++linux-uclibc*)
   1.493 ++  lt_cv_deplibs_check_method=pass_all
   1.494 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   1.495 ++  ;;
   1.496 ++
   1.497 + netbsd* | knetbsd*-gnu)
   1.498 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   1.499 +     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
   1.500 +--- gcc-4.1.0/ltconfig
   1.501 ++++ gcc-4.1.0/ltconfig
   1.502 +@@ -603,6 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
   1.503 + 
   1.504 + # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
   1.505 + case $host_os in
   1.506 ++linux-uclibc*) ;;
   1.507 + linux-gnu*) ;;
   1.508 + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
   1.509 + esac
   1.510 +@@ -1274,6 +1275,23 @@ linux-gnu*)
   1.511 +   dynamic_linker='GNU/Linux ld.so'
   1.512 +   ;;
   1.513 + 
   1.514 ++linux-uclibc*)
   1.515 ++  version_type=linux
   1.516 ++  need_lib_prefix=no
   1.517 ++  need_version=no
   1.518 ++  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
   1.519 ++  soname_spec='${libname}${release}.so$major'
   1.520 ++  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
   1.521 ++  shlibpath_var=LD_LIBRARY_PATH
   1.522 ++  shlibpath_overrides_runpath=no
   1.523 ++  # This implies no fast_install, which is unacceptable.
   1.524 ++  # Some rework will be needed to allow for fast_install
   1.525 ++  # before this can be enabled.
   1.526 ++  hardcode_into_libs=yes
   1.527 ++  # Assume using the uClibc dynamic linker.
   1.528 ++  dynamic_linker="uClibc ld.so"
   1.529 ++  ;;
   1.530 ++
   1.531 + netbsd*)
   1.532 +   need_lib_prefix=no
   1.533 +   need_version=no
   1.534 +--- gcc-4.1.0/zlib/configure
   1.535 ++++ gcc-4.1.0/zlib/configure
   1.536 +@@ -3426,6 +3426,11 @@ linux-gnu*)
   1.537 +   lt_cv_deplibs_check_method=pass_all
   1.538 +   ;;
   1.539 + 
   1.540 ++linux-uclibc*)
   1.541 ++  lt_cv_deplibs_check_method=pass_all
   1.542 ++  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
   1.543 ++  ;;
   1.544 ++
   1.545 + netbsd* | knetbsd*-gnu)
   1.546 +   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
   1.547 +     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'