1 --- gcc-3.4.1/gcc/config/t-linux-uclibc
2 +++ gcc-3.4.1/gcc/config/t-linux-uclibc
4 +# Remove glibc specific files added in t-linux
5 +SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
7 +# Use unwind-dw2-fde instead of unwind-dw2-fde-glibc
8 +LIB2ADDEH := $(subst unwind-dw2-fde-glibc.c,unwind-dw2-fde.c,$(LIB2ADDEH))
9 --- gcc-3.4.1/gcc/config.gcc
10 +++ gcc-3.4.1/gcc/config.gcc
11 @@ -2310,10 +2310,16 @@
13 echo "*** Configuration ${target} not supported" 1>&2
18 +# Rather than hook into each target, just do it after all the linux
19 +# targets have been processed
21 +*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
24 # Support for --with-cpu and related options (and a few unrelated options,
28 --- gcc-3.4.4/gcc/config/alpha/linux-elf.h
29 +++ gcc-3.4.4/gcc/config/alpha/linux-elf.h
31 #define SUBTARGET_EXTRA_SPECS \
32 { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
35 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
37 #define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
40 #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
41 %{O*:-O3} %{!O*:-O1} \
42 --- gcc-3.4.1-dist/gcc/config/arm/linux-elf.h 2004-01-31 00:18:11.000000000 -0600
43 +++ gcc-3.4.1/gcc/config/arm/linux-elf.h 2004-08-12 15:54:42.000000000 -0500
45 #define ENDFILE_SPEC \
46 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
49 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
51 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
54 #define LINK_SPEC "%{h*} %{version:-v} \
58 %{symbolic:-Bsymbolic} \
59 %{rdynamic:-export-dynamic} \
60 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
61 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
64 SUBTARGET_EXTRA_LINK_SPEC
65 --- gcc-3.4.1-dist/gcc/config/cris/linux.h 2003-11-28 21:08:09.000000000 -0600
66 +++ gcc-3.4.1/gcc/config/cris/linux.h 2004-08-12 15:54:43.000000000 -0500
68 #undef CRIS_DEFAULT_CPU_VERSION
69 #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
73 +#undef CRIS_SUBTARGET_VERSION
74 +#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
76 +#undef CRIS_LINK_SUBTARGET_SPEC
77 +#define CRIS_LINK_SUBTARGET_SPEC \
79 + -rpath-link include/asm/../..%s\
80 + %{shared} %{static}\
81 + %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
84 + %{rdynamic:-export-dynamic} \
85 + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
86 + %{!r:%{O2|O3: --gc-sections}}"
88 +#else /* USE_UCLIBC */
90 #undef CRIS_SUBTARGET_VERSION
91 #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
94 %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
95 %{!r:%{O2|O3: --gc-sections}}"
97 +#endif /* USE_UCLIBC */
100 /* Node: Run-time Target */
102 --- gcc-3.4.1-dist/gcc/config/i386/linux.h 2003-11-28 21:08:10.000000000 -0600
103 +++ gcc-3.4.1/gcc/config/i386/linux.h 2004-08-12 15:54:43.000000000 -0500
104 @@ -110,22 +110,21 @@
108 -#define LINK_SPEC "-m elf_i386 %{shared:-shared} \
112 - %{rdynamic:-export-dynamic} \
113 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
114 - %{static:-static}}}"
115 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.1"
118 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
120 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
123 #define LINK_SPEC "-m elf_i386 %{shared:-shared} \
127 %{rdynamic:-export-dynamic} \
128 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
129 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
133 /* A C statement (sans semicolon) to output to the stdio stream
134 FILE the assembler definition of uninitialized global DECL named
135 --- gcc-3.4.4/gcc/config/i386/linux64.h
136 +++ gcc-3.4.4/gcc/config/i386/linux64.h
138 When the -shared link option is used a final link is not being
142 +#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
143 +#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
145 +#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2"
146 +#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2"
149 #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
153 %{rdynamic:-export-dynamic} \
154 - %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
155 - %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
156 + %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \
157 + %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \
160 #define MULTILIB_DEFAULTS { "m64" }
161 --- gcc-3.4.4/gcc/config/ia64/linux.h
162 +++ gcc-3.4.4/gcc/config/ia64/linux.h
164 /* Define this for shared library support because it isn't in the main
168 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
170 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
177 %{rdynamic:-export-dynamic} \
178 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
179 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
183 --- gcc-3.4.4/gcc/config/m68k/linux.h
184 +++ gcc-3.4.4/gcc/config/m68k/linux.h
185 @@ -131,12 +131,17 @@
187 /* If ELF is the default format, we should not use /lib/elf. */
190 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
192 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
195 #define LINK_SPEC "-m m68kelf %{shared} \
198 %{rdynamic:-export-dynamic} \
199 - %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
200 + %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
203 /* For compatibility with linux/a.out */
204 --- gcc-3.4.1-dist/gcc/config/mips/linux.h 2004-06-15 20:42:24.000000000 -0500
205 +++ gcc-3.4.1/gcc/config/mips/linux.h 2004-08-12 15:54:43.000000000 -0500
206 @@ -109,14 +109,19 @@
208 /* Borrowed from sparc/linux.h */
211 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
213 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
221 %{rdynamic:-export-dynamic} \
222 - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
223 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
226 #undef SUBTARGET_ASM_SPEC
227 --- gcc-3.4.4/gcc/config/pa/pa-linux.h
228 +++ gcc-3.4.4/gcc/config/pa/pa-linux.h
230 /* Define this for shared library support because it isn't in the main
234 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
236 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
243 %{rdynamic:-export-dynamic} \
244 - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
245 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
248 /* glibc's profiling functions don't need gcc to allocate counters. */
249 --- gcc-3.4.1-dist/gcc/config/rs6000/linux.h 2004-02-25 09:11:19.000000000 -0600
250 +++ gcc-3.4.1/gcc/config/rs6000/linux.h 2004-08-12 15:54:43.000000000 -0500
252 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
254 #undef LINK_OS_DEFAULT_SPEC
256 +#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
258 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
261 #define LINK_GCC_C_SEQUENCE_SPEC \
262 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
263 --- gcc-3.4.1-dist/gcc/config/rs6000/sysv4.h 2004-06-10 01:39:50.000000000 -0500
264 +++ gcc-3.4.1/gcc/config/rs6000/sysv4.h 2004-08-12 15:54:43.000000000 -0500
266 mcall-linux : %(link_os_linux) ; \
267 mcall-gnu : %(link_os_gnu) ; \
268 mcall-netbsd : %(link_os_netbsd) ; \
269 + mcall-linux-uclibc : %(link_os_linux_uclibc); \
270 mcall-openbsd: %(link_os_openbsd) ; \
271 : %(link_os_default) }"
273 @@ -1125,6 +1126,10 @@
274 %{rdynamic:-export-dynamic} \
275 %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
277 +#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
278 + %{rdynamic:-export-dynamic} \
279 + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
281 #if defined(HAVE_LD_EH_FRAME_HDR)
282 # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
284 @@ -1291,6 +1296,7 @@
285 { "link_os_sim", LINK_OS_SIM_SPEC }, \
286 { "link_os_freebsd", LINK_OS_FREEBSD_SPEC }, \
287 { "link_os_linux", LINK_OS_LINUX_SPEC }, \
288 + { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \
289 { "link_os_gnu", LINK_OS_GNU_SPEC }, \
290 { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
291 { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
292 --- gcc-3.4.4/gcc/config/s390/linux.h
293 +++ gcc-3.4.4/gcc/config/s390/linux.h
295 #define MULTILIB_DEFAULTS { "m31" }
299 +#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
300 +#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
302 +#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1"
303 +#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1"
307 "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
310 %{rdynamic:-export-dynamic} \
312 - %{m31:-dynamic-linker /lib/ld.so.1} \
313 - %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
314 + %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \
315 + %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}"
318 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
319 --- gcc-3.4.1-dist/gcc/config/sh/linux.h 2004-01-11 20:29:13.000000000 -0600
320 +++ gcc-3.4.1/gcc/config/sh/linux.h 2004-08-12 15:54:43.000000000 -0500
322 #undef SUBTARGET_LINK_EMUL_SUFFIX
323 #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
324 #undef SUBTARGET_LINK_SPEC
326 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
328 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
330 #define SUBTARGET_LINK_SPEC \
333 %{rdynamic:-export-dynamic} \
334 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
335 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
339 --- gcc-3.4.4/gcc/config/sparc/linux.h
340 +++ gcc-3.4.4/gcc/config/sparc/linux.h
341 @@ -162,13 +162,18 @@
342 %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.1}} \
346 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
348 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
350 #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
351 %{!mno-relax:%{!r:-relax}} \
355 %{rdynamic:-export-dynamic} \
356 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
357 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
361 --- gcc-3.4.4/gcc/config/sparc/linux64.h
362 +++ gcc-3.4.4/gcc/config/sparc/linux64.h
363 @@ -167,12 +166,17 @@
364 { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
365 { "link_arch", LINK_ARCH_SPEC },
368 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
370 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
372 #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
376 %{rdynamic:-export-dynamic} \
377 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
378 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
379 %{static:-static}}} \
382 --- gcc-3.4.1-dist/libtool.m4 2004-05-18 04:08:37.000000000 -0500
383 +++ gcc-3.4.1/libtool.m4 2004-08-12 15:54:43.000000000 -0500
385 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
389 + lt_cv_deplibs_check_method=pass_all
390 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
394 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
395 [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
396 --- gcc-3.4.1-dist/ltconfig 2004-03-05 15:05:41.000000000 -0600
397 +++ gcc-3.4.1/ltconfig 2004-08-12 15:55:48.000000000 -0500
400 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
404 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
406 @@ -1262,6 +1263,24 @@
407 dynamic_linker='GNU/Linux ld.so'
414 + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
415 + soname_spec='${libname}${release}.so$major'
416 + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
417 + shlibpath_var=LD_LIBRARY_PATH
418 + shlibpath_overrides_runpath=no
419 + # This implies no fast_install, which is unacceptable.
420 + # Some rework will be needed to allow for fast_install
421 + # before this can be enabled.
422 + # Note: copied from linux-gnu, and may not be appropriate.
423 + hardcode_into_libs=yes
424 + # Assume using the uClibc dynamic linker.
425 + dynamic_linker="uClibc ld.so"
431 --- gcc-3.4.1-dist/boehm-gc/configure 2004-07-01 14:14:03.000000000 -0500
432 +++ gcc-3.4.1/boehm-gc/configure 2004-08-12 16:22:57.000000000 -0500
433 @@ -1947,6 +1947,11 @@
434 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
438 + lt_cv_deplibs_check_method=pass_all
439 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
443 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
444 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
445 --- gcc-3.4.1-dist/boehm-gc/ltconfig 2002-11-20 09:59:06.000000000 -0600
446 +++ gcc-3.4.1/boehm-gc/ltconfig 2004-08-12 15:54:42.000000000 -0500
447 @@ -1981,6 +1981,23 @@
455 + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
456 + soname_spec='${libname}${release}.so$major'
457 + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
458 + shlibpath_var=LD_LIBRARY_PATH
459 + shlibpath_overrides_runpath=no
460 + deplibs_check_method='file_magic ELF [0-9][0-9]*-bit [LM]SB (shared object|dynamic lib )'
461 + file_magic_cmd=/usr/bin/file
462 + file_magic_test_file=`echo /lib/libuClibc-*.so`
464 + # Assume using the uClibc dynamic linker.
465 + dynamic_linker="uClibc ld.so"
470 if echo __ELF__ | $CC -E - | grep __ELF__ >/dev/null; then