1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/patches/gcc/3.4.6/100-uclibc-conf.patch Mon May 17 14:11:08 2010 +0200
1.3 @@ -0,0 +1,492 @@
1.4 +diff -durN gcc-3.4.6.orig/boehm-gc/configure gcc-3.4.6/boehm-gc/configure
1.5 +--- gcc-3.4.6.orig/boehm-gc/configure 2006-03-06 04:55:49.000000000 +0100
1.6 ++++ gcc-3.4.6/boehm-gc/configure 2007-08-15 22:49:47.000000000 +0200
1.7 +@@ -1947,6 +1947,11 @@
1.8 + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
1.9 + ;;
1.10 +
1.11 ++linux-uclibc*)
1.12 ++ lt_cv_deplibs_check_method=pass_all
1.13 ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
1.14 ++ ;;
1.15 ++
1.16 + netbsd*)
1.17 + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
1.18 + lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
1.19 +diff -durN gcc-3.4.6.orig/boehm-gc/ltconfig gcc-3.4.6/boehm-gc/ltconfig
1.20 +--- gcc-3.4.6.orig/boehm-gc/ltconfig 2002-11-20 16:59:07.000000000 +0100
1.21 ++++ gcc-3.4.6/boehm-gc/ltconfig 2007-08-15 22:49:47.000000000 +0200
1.22 +@@ -1981,6 +1981,23 @@
1.23 + fi
1.24 + ;;
1.25 +
1.26 ++linux-uclibc*)
1.27 ++ version_type=linux
1.28 ++ need_lib_prefix=no
1.29 ++ need_version=no
1.30 ++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1.31 ++ soname_spec='${libname}${release}.so$major'
1.32 ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1.33 ++ shlibpath_var=LD_LIBRARY_PATH
1.34 ++ shlibpath_overrides_runpath=no
1.35 ++ deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
1.36 ++ file_magic_cmd=/usr/bin/file
1.37 ++ file_magic_test_file=`echo /lib/libuClibc-*.so`
1.38 ++
1.39 ++ # Assume using the uClibc dynamic linker.
1.40 ++ dynamic_linker="uClibc ld.so"
1.41 ++ ;;
1.42 ++
1.43 + netbsd*)
1.44 + version_type=sunos
1.45 + if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then
1.46 +diff -durN gcc-3.4.6.orig/gcc/config/alpha/linux-elf.h gcc-3.4.6/gcc/config/alpha/linux-elf.h
1.47 +--- gcc-3.4.6.orig/gcc/config/alpha/linux-elf.h 2003-09-27 06:48:30.000000000 +0200
1.48 ++++ gcc-3.4.6/gcc/config/alpha/linux-elf.h 2007-08-15 22:49:47.000000000 +0200
1.49 +@@ -27,7 +27,11 @@
1.50 + #define SUBTARGET_EXTRA_SPECS \
1.51 + { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
1.52 +
1.53 ++#ifdef USE_UCLIBC
1.54 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.55 ++#else
1.56 + #define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
1.57 ++#endif
1.58 +
1.59 + #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
1.60 + %{O*:-O3} %{!O*:-O1} \
1.61 +diff -durN gcc-3.4.6.orig/gcc/config/arm/linux-elf.h gcc-3.4.6/gcc/config/arm/linux-elf.h
1.62 +--- gcc-3.4.6.orig/gcc/config/arm/linux-elf.h 2004-01-31 07:18:40.000000000 +0100
1.63 ++++ gcc-3.4.6/gcc/config/arm/linux-elf.h 2007-08-15 22:49:47.000000000 +0200
1.64 +@@ -80,6 +80,11 @@
1.65 + #define ENDFILE_SPEC \
1.66 + "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
1.67 +
1.68 ++#ifdef USE_UCLIBC
1.69 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.70 ++#else
1.71 ++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
1.72 ++#endif
1.73 + #undef LINK_SPEC
1.74 + #define LINK_SPEC "%{h*} %{version:-v} \
1.75 + %{b} %{Wl,*:%*} \
1.76 +@@ -87,7 +92,7 @@
1.77 + %{shared:-shared} \
1.78 + %{symbolic:-Bsymbolic} \
1.79 + %{rdynamic:-export-dynamic} \
1.80 +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
1.81 ++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
1.82 + -X \
1.83 + %{mbig-endian:-EB}" \
1.84 + SUBTARGET_EXTRA_LINK_SPEC
1.85 +diff -durN gcc-3.4.6.orig/gcc/config/cris/linux.h gcc-3.4.6/gcc/config/cris/linux.h
1.86 +--- gcc-3.4.6.orig/gcc/config/cris/linux.h 2003-11-29 04:08:13.000000000 +0100
1.87 ++++ gcc-3.4.6/gcc/config/cris/linux.h 2007-08-15 22:49:47.000000000 +0200
1.88 +@@ -79,6 +79,25 @@
1.89 + #undef CRIS_DEFAULT_CPU_VERSION
1.90 + #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
1.91 +
1.92 ++#ifdef USE_UCLIBC
1.93 ++
1.94 ++#undef CRIS_SUBTARGET_VERSION
1.95 ++#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
1.96 ++
1.97 ++#undef CRIS_LINK_SUBTARGET_SPEC
1.98 ++#define CRIS_LINK_SUBTARGET_SPEC \
1.99 ++ "-mcrislinux\
1.100 ++ -rpath-link include/asm/../..%s\
1.101 ++ %{shared} %{static}\
1.102 ++ %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
1.103 ++ %{!shared: \
1.104 ++ %{!static: \
1.105 ++ %{rdynamic:-export-dynamic} \
1.106 ++ %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
1.107 ++ %{!r:%{O2|O3: --gc-sections}}"
1.108 ++
1.109 ++#else /* USE_UCLIBC */
1.110 ++
1.111 + #undef CRIS_SUBTARGET_VERSION
1.112 + #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
1.113 +
1.114 +@@ -93,6 +112,8 @@
1.115 + %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
1.116 + %{!r:%{O2|O3: --gc-sections}}"
1.117 +
1.118 ++#endif /* USE_UCLIBC */
1.119 ++
1.120 +
1.121 + /* Node: Run-time Target */
1.122 +
1.123 +diff -durN gcc-3.4.6.orig/gcc/config/i386/linux64.h gcc-3.4.6/gcc/config/i386/linux64.h
1.124 +--- gcc-3.4.6.orig/gcc/config/i386/linux64.h 2003-11-29 04:08:13.000000000 +0100
1.125 ++++ gcc-3.4.6/gcc/config/i386/linux64.h 2007-08-15 22:49:47.000000000 +0200
1.126 +@@ -54,14 +54,21 @@
1.127 + When the -shared link option is used a final link is not being
1.128 + done. */
1.129 +
1.130 ++#ifdef USE_UCLIBC
1.131 ++#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.132 ++#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
1.133 ++#else
1.134 ++#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2"
1.135 ++#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2"
1.136 ++#endif
1.137 + #undef LINK_SPEC
1.138 + #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
1.139 + %{shared:-shared} \
1.140 + %{!shared: \
1.141 + %{!static: \
1.142 + %{rdynamic:-export-dynamic} \
1.143 +- %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
1.144 +- %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
1.145 ++ %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \
1.146 ++ %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \
1.147 + %{static:-static}}"
1.148 +
1.149 + #define MULTILIB_DEFAULTS { "m64" }
1.150 +diff -durN gcc-3.4.6.orig/gcc/config/i386/linux.h gcc-3.4.6/gcc/config/i386/linux.h
1.151 +--- gcc-3.4.6.orig/gcc/config/i386/linux.h 2003-11-29 04:08:13.000000000 +0100
1.152 ++++ gcc-3.4.6/gcc/config/i386/linux.h 2007-08-15 22:49:47.000000000 +0200
1.153 +@@ -110,22 +110,21 @@
1.154 +
1.155 + #undef LINK_SPEC
1.156 + #ifdef USE_GNULIBC_1
1.157 +-#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
1.158 +- %{!shared: \
1.159 +- %{!ibcs: \
1.160 +- %{!static: \
1.161 +- %{rdynamic:-export-dynamic} \
1.162 +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
1.163 +- %{static:-static}}}"
1.164 ++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.1"
1.165 + #else
1.166 ++#ifdef USE_UCLIBC
1.167 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.168 ++#else
1.169 ++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
1.170 ++#endif
1.171 ++#endif
1.172 + #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
1.173 + %{!shared: \
1.174 + %{!ibcs: \
1.175 + %{!static: \
1.176 + %{rdynamic:-export-dynamic} \
1.177 +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
1.178 ++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
1.179 + %{static:-static}}}"
1.180 +-#endif
1.181 +
1.182 + /* A C statement (sans semicolon) to output to the stdio stream
1.183 + FILE the assembler definition of uninitialized global DECL named
1.184 +diff -durN gcc-3.4.6.orig/gcc/config/ia64/linux.h gcc-3.4.6/gcc/config/ia64/linux.h
1.185 +--- gcc-3.4.6.orig/gcc/config/ia64/linux.h 2004-02-07 08:56:17.000000000 +0100
1.186 ++++ gcc-3.4.6/gcc/config/ia64/linux.h 2007-08-15 22:49:47.000000000 +0200
1.187 +@@ -37,13 +37,18 @@
1.188 + /* Define this for shared library support because it isn't in the main
1.189 + linux.h file. */
1.190 +
1.191 ++#ifdef USE_UCLIBC
1.192 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.193 ++#else
1.194 ++#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
1.195 ++#endif
1.196 + #undef LINK_SPEC
1.197 + #define LINK_SPEC "\
1.198 + %{shared:-shared} \
1.199 + %{!shared: \
1.200 + %{!static: \
1.201 + %{rdynamic:-export-dynamic} \
1.202 +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
1.203 ++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
1.204 + %{static:-static}}"
1.205 +
1.206 +
1.207 +diff -durN gcc-3.4.6.orig/gcc/config/m68k/linux.h gcc-3.4.6/gcc/config/m68k/linux.h
1.208 +--- gcc-3.4.6.orig/gcc/config/m68k/linux.h 2003-11-29 04:08:13.000000000 +0100
1.209 ++++ gcc-3.4.6/gcc/config/m68k/linux.h 2007-08-15 22:49:47.000000000 +0200
1.210 +@@ -131,12 +131,17 @@
1.211 +
1.212 + /* If ELF is the default format, we should not use /lib/elf. */
1.213 +
1.214 ++#ifdef USE_UCLIBC
1.215 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.216 ++#else
1.217 ++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
1.218 ++#endif
1.219 + #undef LINK_SPEC
1.220 + #define LINK_SPEC "-m m68kelf %{shared} \
1.221 + %{!shared: \
1.222 + %{!static: \
1.223 + %{rdynamic:-export-dynamic} \
1.224 +- %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
1.225 ++ %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
1.226 + %{static}}"
1.227 +
1.228 + /* For compatibility with linux/a.out */
1.229 +diff -durN gcc-3.4.6.orig/gcc/config/mips/linux.h gcc-3.4.6/gcc/config/mips/linux.h
1.230 +--- gcc-3.4.6.orig/gcc/config/mips/linux.h 2004-06-16 03:42:25.000000000 +0200
1.231 ++++ gcc-3.4.6/gcc/config/mips/linux.h 2007-08-15 22:49:47.000000000 +0200
1.232 +@@ -109,6 +109,11 @@
1.233 +
1.234 + /* Borrowed from sparc/linux.h */
1.235 + #undef LINK_SPEC
1.236 ++#ifdef USE_UCLIBC
1.237 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.238 ++#else
1.239 ++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
1.240 ++#endif
1.241 + #define LINK_SPEC \
1.242 + "%(endian_spec) \
1.243 + %{shared:-shared} \
1.244 +@@ -116,7 +121,7 @@
1.245 + %{!ibcs: \
1.246 + %{!static: \
1.247 + %{rdynamic:-export-dynamic} \
1.248 +- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
1.249 ++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
1.250 + %{static:-static}}}"
1.251 +
1.252 + #undef SUBTARGET_ASM_SPEC
1.253 +diff -durN gcc-3.4.6.orig/gcc/config/pa/pa-linux.h gcc-3.4.6/gcc/config/pa/pa-linux.h
1.254 +--- gcc-3.4.6.orig/gcc/config/pa/pa-linux.h 2003-11-29 04:08:13.000000000 +0100
1.255 ++++ gcc-3.4.6/gcc/config/pa/pa-linux.h 2007-08-15 22:49:47.000000000 +0200
1.256 +@@ -77,13 +77,18 @@
1.257 + /* Define this for shared library support because it isn't in the main
1.258 + linux.h file. */
1.259 +
1.260 ++#ifdef USE_UCLIBC
1.261 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.262 ++#else
1.263 ++#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
1.264 ++#endif
1.265 + #undef LINK_SPEC
1.266 + #define LINK_SPEC "\
1.267 + %{shared:-shared} \
1.268 + %{!shared: \
1.269 + %{!static: \
1.270 + %{rdynamic:-export-dynamic} \
1.271 +- %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
1.272 ++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
1.273 + %{static:-static}}"
1.274 +
1.275 + /* glibc's profiling functions don't need gcc to allocate counters. */
1.276 +diff -durN gcc-3.4.6.orig/gcc/config/rs6000/linux.h gcc-3.4.6/gcc/config/rs6000/linux.h
1.277 +--- gcc-3.4.6.orig/gcc/config/rs6000/linux.h 2005-03-17 11:41:18.000000000 +0100
1.278 ++++ gcc-3.4.6/gcc/config/rs6000/linux.h 2007-08-15 22:49:47.000000000 +0200
1.279 +@@ -69,7 +69,11 @@
1.280 + #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
1.281 +
1.282 + #undef LINK_OS_DEFAULT_SPEC
1.283 ++#ifdef USE_UCLIBC
1.284 ++#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
1.285 ++#else
1.286 + #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
1.287 ++#endif
1.288 +
1.289 + #define LINK_GCC_C_SEQUENCE_SPEC \
1.290 + "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
1.291 +diff -durN gcc-3.4.6.orig/gcc/config/rs6000/sysv4.h gcc-3.4.6/gcc/config/rs6000/sysv4.h
1.292 +--- gcc-3.4.6.orig/gcc/config/rs6000/sysv4.h 2005-10-30 00:35:37.000000000 +0200
1.293 ++++ gcc-3.4.6/gcc/config/rs6000/sysv4.h 2007-08-15 22:49:47.000000000 +0200
1.294 +@@ -949,6 +949,7 @@
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 +@@ -1127,6 +1128,10 @@
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 +@@ -1293,6 +1298,7 @@
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 +diff -durN gcc-3.4.6.orig/gcc/config/s390/linux.h gcc-3.4.6/gcc/config/s390/linux.h
1.322 +--- gcc-3.4.6.orig/gcc/config/s390/linux.h 2003-11-29 04:08:13.000000000 +0100
1.323 ++++ gcc-3.4.6/gcc/config/s390/linux.h 2007-08-15 22:49:47.000000000 +0200
1.324 +@@ -77,6 +77,13 @@
1.325 + #define MULTILIB_DEFAULTS { "m31" }
1.326 + #endif
1.327 +
1.328 ++#ifdef USE_UCLIBC
1.329 ++#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.330 ++#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
1.331 ++#else
1.332 ++#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1"
1.333 ++#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1"
1.334 ++#endif
1.335 + #undef LINK_SPEC
1.336 + #define LINK_SPEC \
1.337 + "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
1.338 +@@ -86,8 +93,8 @@
1.339 + %{!static: \
1.340 + %{rdynamic:-export-dynamic} \
1.341 + %{!dynamic-linker: \
1.342 +- %{m31:-dynamic-linker /lib/ld.so.1} \
1.343 +- %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
1.344 ++ %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \
1.345 ++ %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}"
1.346 +
1.347 +
1.348 + #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
1.349 +diff -durN gcc-3.4.6.orig/gcc/config/sh/linux.h gcc-3.4.6/gcc/config/sh/linux.h
1.350 +--- gcc-3.4.6.orig/gcc/config/sh/linux.h 2004-01-12 03:29:13.000000000 +0100
1.351 ++++ gcc-3.4.6/gcc/config/sh/linux.h 2007-08-15 22:49:47.000000000 +0200
1.352 +@@ -73,11 +73,16 @@
1.353 + #undef SUBTARGET_LINK_EMUL_SUFFIX
1.354 + #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
1.355 + #undef SUBTARGET_LINK_SPEC
1.356 ++#ifdef USE_UCLIBC
1.357 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.358 ++#else
1.359 ++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
1.360 ++#endif
1.361 + #define SUBTARGET_LINK_SPEC \
1.362 + "%{shared:-shared} \
1.363 + %{!static: \
1.364 + %{rdynamic:-export-dynamic} \
1.365 +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
1.366 ++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
1.367 + %{static:-static}"
1.368 +
1.369 + #undef LIB_SPEC
1.370 +diff -durN gcc-3.4.6.orig/gcc/config/sparc/linux64.h gcc-3.4.6/gcc/config/sparc/linux64.h
1.371 +--- gcc-3.4.6.orig/gcc/config/sparc/linux64.h 2004-06-06 05:55:17.000000000 +0200
1.372 ++++ gcc-3.4.6/gcc/config/sparc/linux64.h 2007-08-15 22:49:47.000000000 +0200
1.373 +@@ -167,12 +167,17 @@
1.374 + { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
1.375 + { "link_arch", LINK_ARCH_SPEC },
1.376 +
1.377 ++#ifdef USE_UCLIBC
1.378 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.379 ++#else
1.380 ++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
1.381 ++#endif
1.382 + #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
1.383 + %{!shared: \
1.384 + %{!ibcs: \
1.385 + %{!static: \
1.386 + %{rdynamic:-export-dynamic} \
1.387 +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
1.388 ++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
1.389 + %{static:-static}}} \
1.390 + "
1.391 +
1.392 +diff -durN gcc-3.4.6.orig/gcc/config/sparc/linux.h gcc-3.4.6/gcc/config/sparc/linux.h
1.393 +--- gcc-3.4.6.orig/gcc/config/sparc/linux.h 2004-06-06 05:55:17.000000000 +0200
1.394 ++++ gcc-3.4.6/gcc/config/sparc/linux.h 2007-08-15 22:49:47.000000000 +0200
1.395 +@@ -162,13 +162,18 @@
1.396 + %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
1.397 + %{static:-static}}}"
1.398 + #else
1.399 ++#ifdef USE_UCLIBC
1.400 ++#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
1.401 ++#else
1.402 ++#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
1.403 ++#endif
1.404 + #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
1.405 + %{!mno-relax:%{!r:-relax}} \
1.406 + %{!shared: \
1.407 + %{!ibcs: \
1.408 + %{!static: \
1.409 + %{rdynamic:-export-dynamic} \
1.410 +- %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
1.411 ++ %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
1.412 + %{static:-static}}}"
1.413 + #endif
1.414 +
1.415 +diff -durN gcc-3.4.6.orig/gcc/config/t-linux-uclibc gcc-3.4.6/gcc/config/t-linux-uclibc
1.416 +--- gcc-3.4.6.orig/gcc/config/t-linux-uclibc 1970-01-01 01:00:00.000000000 +0100
1.417 ++++ gcc-3.4.6/gcc/config/t-linux-uclibc 2007-08-15 22:49:47.000000000 +0200
1.418 +@@ -0,0 +1,5 @@
1.419 ++# Remove glibc specific files added in t-linux
1.420 ++SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
1.421 ++
1.422 ++# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
1.423 ++LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
1.424 +diff -durN gcc-3.4.6.orig/gcc/config.gcc gcc-3.4.6/gcc/config.gcc
1.425 +--- gcc-3.4.6.orig/gcc/config.gcc 2005-07-19 23:08:48.000000000 +0200
1.426 ++++ gcc-3.4.6/gcc/config.gcc 2007-08-15 22:49:47.000000000 +0200
1.427 +@@ -2322,6 +2322,12 @@
1.428 + ;;
1.429 + esac
1.430 +
1.431 ++# Rather than hook into each target, just do it after all the linux
1.432 ++# targets have been processed
1.433 ++case ${target} in
1.434 ++*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
1.435 ++esac
1.436 ++
1.437 + # Support for --with-cpu and related options (and a few unrelated options,
1.438 + # too).
1.439 + case ${with_cpu} in
1.440 +diff -durN gcc-3.4.6.orig/libtool.m4 gcc-3.4.6/libtool.m4
1.441 +--- gcc-3.4.6.orig/libtool.m4 2004-05-18 11:09:14.000000000 +0200
1.442 ++++ gcc-3.4.6/libtool.m4 2007-08-15 22:49:47.000000000 +0200
1.443 +@@ -689,6 +689,11 @@
1.444 + lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
1.445 + ;;
1.446 +
1.447 ++linux-uclibc*)
1.448 ++ lt_cv_deplibs_check_method=pass_all
1.449 ++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
1.450 ++ ;;
1.451 ++
1.452 + netbsd*)
1.453 + if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
1.454 + [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
1.455 +diff -durN gcc-3.4.6.orig/ltconfig gcc-3.4.6/ltconfig
1.456 +--- gcc-3.4.6.orig/ltconfig 2004-03-05 22:05:41.000000000 +0100
1.457 ++++ gcc-3.4.6/ltconfig 2007-08-15 22:49:47.000000000 +0200
1.458 +@@ -602,6 +602,7 @@
1.459 +
1.460 + # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
1.461 + case $host_os in
1.462 ++linux-uclibc*) ;;
1.463 + linux-gnu*) ;;
1.464 + linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
1.465 + esac
1.466 +@@ -1262,6 +1263,24 @@
1.467 + dynamic_linker='GNU/Linux ld.so'
1.468 + ;;
1.469 +
1.470 ++linux-uclibc*)
1.471 ++ version_type=linux
1.472 ++ need_lib_prefix=no
1.473 ++ need_version=no
1.474 ++ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
1.475 ++ soname_spec='${libname}${release}.so$major'
1.476 ++ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
1.477 ++ shlibpath_var=LD_LIBRARY_PATH
1.478 ++ shlibpath_overrides_runpath=no
1.479 ++ # This implies no fast_install, which is unacceptable.
1.480 ++ # Some rework will be needed to allow for fast_install
1.481 ++ # before this can be enabled.
1.482 ++ # Note: copied from linux-gnu, and may not be appropriate.
1.483 ++ hardcode_into_libs=yes
1.484 ++ # Assume using the uClibc dynamic linker.
1.485 ++ dynamic_linker="uClibc ld.so"
1.486 ++ ;;
1.487 ++
1.488 + netbsd*)
1.489 + need_lib_prefix=no
1.490 + need_version=no
1.491 +diff -durN gcc-3.4.6.orig/null gcc-3.4.6/null
1.492 +--- gcc-3.4.6.orig/null 1970-01-01 01:00:00.000000000 +0100
1.493 ++++ gcc-3.4.6/null 2007-08-15 22:49:47.000000000 +0200
1.494 +@@ -0,0 +1 @@
1.495 ++~/dev