1 --- gcc-4.0.2/gcc/config/t-linux-uclibc
2 +++ gcc-4.0.2/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-4.0.2/gcc/config.gcc
10 +++ gcc-4.0.2/gcc/config.gcc
13 sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
14 sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
15 - sh-*-linux* | sh[346lbe]*-*-linux* | \
16 + sh*-*-linux* | sh[346lbe]*-*-linux* | \
17 sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
18 sh64-*-netbsd* | sh64l*-*-netbsd*)
19 tmake_file="${tmake_file} sh/t-sh sh/t-elf"
20 @@ -2234,10 +2234,16 @@
22 echo "*** Configuration ${target} not supported" 1>&2
27 +# Rather than hook into each target, just do it after all the linux
28 +# targets have been processed
30 +*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
34 i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1)
35 tmake_file="${tmake_file} i386/t-gmm_malloc"
37 --- gcc-4.0.2/gcc/config/alpha/linux-elf.h
38 +++ gcc-4.0.2/gcc/config/alpha/linux-elf.h
40 #define SUBTARGET_EXTRA_SPECS \
41 { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
44 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
46 #define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
49 #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax} \
50 %{O*:-O3} %{!O*:-O1} \
51 --- gcc-4.0.2/gcc/config/arm/linux-elf.h
52 +++ gcc-4.0.2/gcc/config/arm/linux-elf.h
54 #define ENDFILE_SPEC \
55 "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
58 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
60 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
63 #define LINK_SPEC "%{h*} %{version:-v} \
67 %{symbolic:-Bsymbolic} \
68 %{rdynamic:-export-dynamic} \
69 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2} \
70 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "} \
73 SUBTARGET_EXTRA_LINK_SPEC
74 --- gcc-4.0.2/gcc/config/cris/linux.h
75 +++ gcc-4.0.2/gcc/config/cris/linux.h
77 #undef CRIS_DEFAULT_CPU_VERSION
78 #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
82 +#undef CRIS_SUBTARGET_VERSION
83 +#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
85 +#undef CRIS_LINK_SUBTARGET_SPEC
86 +#define CRIS_LINK_SUBTARGET_SPEC \
88 + -rpath-link include/asm/../..%s\
89 + %{shared} %{static}\
90 + %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
93 + %{rdynamic:-export-dynamic} \
94 + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
95 + %{!r:%{O2|O3: --gc-sections}}"
97 +#else /* USE_UCLIBC */
99 #undef CRIS_SUBTARGET_VERSION
100 #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
103 %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
104 %{!r:%{O2|O3: --gc-sections}}"
106 +#endif /* USE_UCLIBC */
109 /* Node: Run-time Target */
111 --- gcc-4.0.2/gcc/config/i386/linux.h
112 +++ gcc-4.0.2/gcc/config/i386/linux.h
114 #define LINK_EMULATION "elf_i386"
115 #define DYNAMIC_LINKER "/lib/ld-linux.so.2"
118 +#undef DYNAMIC_LINKER
119 +#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
122 #undef SUBTARGET_EXTRA_SPECS
123 #define SUBTARGET_EXTRA_SPECS \
124 { "link_emulation", LINK_EMULATION },\
125 --- gcc-4.0.2/gcc/config/i386/linux64.h
126 +++ gcc-4.0.2/gcc/config/i386/linux64.h
128 When the -shared link option is used a final link is not being
132 +#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
133 +#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
135 +#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2"
136 +#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2"
139 #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
143 %{rdynamic:-export-dynamic} \
144 - %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
145 - %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
146 + %{m32:%{!dynamic-linker:-dynamic-linker " ELF32_DYNAMIC_LINKER "}} \
147 + %{!m32:%{!dynamic-linker:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}} \
150 #define MULTILIB_DEFAULTS { "m64" }
151 --- gcc-4.0.2/gcc/config/ia64/linux.h
152 +++ gcc-4.0.2/gcc/config/ia64/linux.h
154 /* Define this for shared library support because it isn't in the main
158 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
160 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
167 %{rdynamic:-export-dynamic} \
168 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
169 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
173 --- gcc-4.0.2/gcc/config/m68k/linux.h
174 +++ gcc-4.0.2/gcc/config/m68k/linux.h
175 @@ -127,12 +127,17 @@
177 /* If ELF is the default format, we should not use /lib/elf. */
180 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
182 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
185 #define LINK_SPEC "-m m68kelf %{shared} \
188 %{rdynamic:-export-dynamic} \
189 - %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
190 + %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
193 /* For compatibility with linux/a.out */
194 --- gcc-4.0.2/gcc/config/mips/linux.h
195 +++ gcc-4.0.2/gcc/config/mips/linux.h
196 @@ -108,14 +108,19 @@
198 /* Borrowed from sparc/linux.h */
201 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
203 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
211 %{rdynamic:-export-dynamic} \
212 - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
213 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
216 #undef SUBTARGET_ASM_SPEC
217 --- gcc-4.0.2/gcc/config/pa/pa-linux.h
218 +++ gcc-4.0.2/gcc/config/pa/pa-linux.h
220 /* Define this for shared library support because it isn't in the main
224 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
226 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
233 %{rdynamic:-export-dynamic} \
234 - %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
235 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
238 /* glibc's profiling functions don't need gcc to allocate counters. */
239 --- gcc-4.0.2/gcc/config/rs6000/linux.h
240 +++ gcc-4.0.2/gcc/config/rs6000/linux.h
242 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
244 #undef LINK_OS_DEFAULT_SPEC
246 +#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
248 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
251 #define LINK_GCC_C_SEQUENCE_SPEC \
252 "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
253 --- gcc-4.0.2/gcc/config/rs6000/sysv4.h
254 +++ gcc-4.0.2/gcc/config/rs6000/sysv4.h
256 mcall-linux : %(link_os_linux) ; \
257 mcall-gnu : %(link_os_gnu) ; \
258 mcall-netbsd : %(link_os_netbsd) ; \
259 + mcall-linux-uclibc : %(link_os_linux_uclibc); \
260 mcall-openbsd: %(link_os_openbsd) ; \
261 : %(link_os_default) }"
263 @@ -1127,6 +1128,10 @@
264 %{rdynamic:-export-dynamic} \
265 %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
267 +#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
268 + %{rdynamic:-export-dynamic} \
269 + %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
271 #if defined(HAVE_LD_EH_FRAME_HDR)
272 # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
274 @@ -1293,6 +1298,7 @@
275 { "link_os_sim", LINK_OS_SIM_SPEC }, \
276 { "link_os_freebsd", LINK_OS_FREEBSD_SPEC }, \
277 { "link_os_linux", LINK_OS_LINUX_SPEC }, \
278 + { "link_os_linux_uclibc", LINK_OS_LINUX_UCLIBC_SPEC }, \
279 { "link_os_gnu", LINK_OS_GNU_SPEC }, \
280 { "link_os_netbsd", LINK_OS_NETBSD_SPEC }, \
281 { "link_os_openbsd", LINK_OS_OPENBSD_SPEC }, \
282 --- gcc-4.0.2/gcc/config/s390/linux.h
283 +++ gcc-4.0.2/gcc/config/s390/linux.h
285 #define MULTILIB_DEFAULTS { "m31" }
289 +#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
290 +#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
292 +#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1"
293 +#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1"
297 "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
300 %{rdynamic:-export-dynamic} \
302 - %{m31:-dynamic-linker /lib/ld.so.1} \
303 - %{m64:-dynamic-linker /lib/ld64.so.1}}}}"
304 + %{m31:-dynamic-linker " ELF31_DYNAMIC_LINKER "} \
305 + %{m64:-dynamic-linker " ELF64_DYNAMIC_LINKER "}}}}"
308 #define TARGET_ASM_FILE_END file_end_indicate_exec_stack
309 --- gcc-4.0.2/gcc/config/sh/linux.h
310 +++ gcc-4.0.2/gcc/config/sh/linux.h
312 #undef SUBTARGET_LINK_EMUL_SUFFIX
313 #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
314 #undef SUBTARGET_LINK_SPEC
316 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
318 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
320 #define SUBTARGET_LINK_SPEC \
323 %{rdynamic:-export-dynamic} \
324 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
325 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
329 --- gcc-4.0.2/gcc/config/sparc/linux.h
330 +++ gcc-4.0.2/gcc/config/sparc/linux.h
331 @@ -130,14 +130,19 @@
333 /* If ELF is the default format, we should not use /lib/elf. */
336 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
338 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
341 #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
342 %{!mno-relax:%{!r:-relax}} \
346 %{rdynamic:-export-dynamic} \
347 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
348 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
351 /* The sun bundled assembler doesn't accept -Yd, (and neither does gas).
352 --- gcc-4.0.2/gcc/config/sparc/linux64.h
353 +++ gcc-4.0.2/gcc/config/sparc/linux64.h
354 @@ -167,12 +166,17 @@
355 { "link_arch_default", LINK_ARCH_DEFAULT_SPEC }, \
356 { "link_arch", LINK_ARCH_SPEC },
359 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
361 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
363 #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
367 %{rdynamic:-export-dynamic} \
368 - %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
369 + %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
370 %{static:-static}}} \
373 --- gcc-4.0.2/libtool.m4
374 +++ gcc-4.0.2/libtool.m4
376 lt_cv_deplibs_check_method=pass_all
380 + lt_cv_deplibs_check_method=pass_all
381 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
384 netbsd* | knetbsd*-gnu)
385 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
386 [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
387 --- gcc-4.0.2/ltconfig
388 +++ gcc-4.0.2/ltconfig
391 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
395 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
397 @@ -1274,6 +1275,23 @@
398 dynamic_linker='GNU/Linux ld.so'
405 + library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
406 + soname_spec='${libname}${release}.so$major'
407 + finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
408 + shlibpath_var=LD_LIBRARY_PATH
409 + shlibpath_overrides_runpath=no
410 + # This implies no fast_install, which is unacceptable.
411 + # Some rework will be needed to allow for fast_install
412 + # before this can be enabled.
413 + hardcode_into_libs=yes
414 + # Assume using the uClibc dynamic linker.
415 + dynamic_linker="uClibc ld.so"
421 --- gcc-4.0.2/libffi/configure
422 +++ gcc-4.0.2/libffi/configure
423 @@ -3457,6 +3457,11 @@
424 lt_cv_deplibs_check_method=pass_all
428 + lt_cv_deplibs_check_method=pass_all
429 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
432 netbsd* | knetbsd*-gnu)
433 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
434 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
435 --- gcc-4.0.2/libgfortran/configure
436 +++ gcc-4.0.2/libgfortran/configure
437 @@ -3681,6 +3681,11 @@
438 lt_cv_deplibs_check_method=pass_all
442 + lt_cv_deplibs_check_method=pass_all
443 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
446 netbsd* | knetbsd*-gnu)
447 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
448 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
449 --- gcc-4.0.2/libjava/configure
450 +++ gcc-4.0.2/libjava/configure
451 @@ -4351,6 +4351,11 @@
452 lt_cv_deplibs_check_method=pass_all
456 + lt_cv_deplibs_check_method=pass_all
457 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
460 netbsd* | knetbsd*-gnu)
461 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
462 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
463 --- gcc-4.0.2/libmudflap/configure
464 +++ gcc-4.0.2/libmudflap/configure
465 @@ -5380,6 +5380,11 @@
466 lt_cv_deplibs_check_method=pass_all
470 + lt_cv_deplibs_check_method=pass_all
471 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
474 netbsd* | knetbsd*-gnu)
475 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
476 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
477 --- gcc-4.0.2/libobjc/configure
478 +++ gcc-4.0.2/libobjc/configure
479 @@ -3283,6 +3283,11 @@
480 lt_cv_deplibs_check_method=pass_all
484 + lt_cv_deplibs_check_method=pass_all
485 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
488 netbsd* | knetbsd*-gnu)
489 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
490 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
491 --- gcc-4.0.2/boehm-gc/configure
492 +++ gcc-4.0.2/boehm-gc/configure
493 @@ -4320,6 +4320,11 @@
494 lt_cv_deplibs_check_method=pass_all
498 + lt_cv_deplibs_check_method=pass_all
499 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
502 netbsd* | knetbsd*-gnu)
503 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
504 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
505 --- gcc-4.0.2/configure
506 +++ gcc-4.0.2/configure
507 @@ -1141,7 +1141,7 @@
511 - *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
512 + *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
513 # Enable libmudflap by default in GNU and friends.
516 --- gcc-4.0.2/configure.in
517 +++ gcc-4.0.2/configure.in
522 - *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
523 + *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu | *-*-linux-uclibc*)
524 # Enable libmudflap by default in GNU and friends.
527 --- gcc-4.0.2/contrib/regression/objs-gcc.sh
528 +++ gcc-4.0.2/contrib/regression/objs-gcc.sh
531 make all-gdb all-dejagnu all-ld || exit 1
532 make install-gdb install-dejagnu install-ld || exit 1
533 +elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
535 + make all-gdb all-dejagnu all-ld || exit 1
536 + make install-gdb install-dejagnu install-ld || exit 1
537 elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
538 make bootstrap || exit 1
539 make install || exit 1
540 --- gcc-4.0.2/zlib/configure
541 +++ gcc-4.0.2/zlib/configure
542 @@ -3426,6 +3426,11 @@
543 lt_cv_deplibs_check_method=pass_all
547 + lt_cv_deplibs_check_method=pass_all
548 + lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
551 netbsd* | knetbsd*-gnu)
552 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
553 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'