Fix warnings
[openwrt.git] / toolchain / gcc / patches / 4.0.3 / 100-uclibc-conf.patch
1 --- gcc-4.0.2/gcc/config/t-linux-uclibc
2 +++ gcc-4.0.2/gcc/config/t-linux-uclibc
3 @@ -0,0 +1,5 @@
4 +# Remove glibc specific files added in t-linux
5 +SHLIB_MAPFILES := $(filter-out $(srcdir)/config/libgcc-glibc.ver, $(SHLIB_MAPFILES))
6 +
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
11 @@ -1778,7 +1778,7 @@
12         ;;
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 @@
21  *)
22         echo "*** Configuration ${target} not supported" 1>&2
23         exit 1
24         ;;
25  esac
26 +
27 +# Rather than hook into each target, just do it after all the linux
28 +# targets have been processed
29 +case ${target} in
30 +*-linux-uclibc*) tm_defines="${tm_defines} USE_UCLIBC" ; tmake_file="${tmake_file} t-linux-uclibc"
31 +esac
32  
33  case ${target} in
34  i[34567]86-*-linux*aout* | i[34567]86-*-linux*libc1)
35         tmake_file="${tmake_file} i386/t-gmm_malloc"
36         ;;
37 --- gcc-4.0.2/gcc/config/alpha/linux-elf.h
38 +++ gcc-4.0.2/gcc/config/alpha/linux-elf.h
39 @@ -27,7 +27,11 @@
40  #define SUBTARGET_EXTRA_SPECS \
41  { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
42  
43 +#ifdef USE_UCLIBC
44 +#define ELF_DYNAMIC_LINKER     "/lib/ld-uClibc.so.0"
45 +#else
46  #define ELF_DYNAMIC_LINKER     "/lib/ld-linux.so.2"
47 +#endif
48  
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
53 @@ -81,14 +81,19 @@
54  #define ENDFILE_SPEC \
55    "%{!shared:crtend.o%s} %{shared:crtendS.o%s} crtn.o%s"
56  
57 +#ifdef USE_UCLIBC
58 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
59 +#else
60 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
61 +#endif
62  #undef  LINK_SPEC
63  #define LINK_SPEC "%{h*} %{version:-v} \
64     %{b} %{Wl,*:%*} \
65     %{static:-Bstatic} \
66     %{shared:-shared} \
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 "} \
71     -X \
72     %{mbig-endian:-EB}" \
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
76 @@ -79,6 +79,25 @@
77  #undef CRIS_DEFAULT_CPU_VERSION
78  #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
79  
80 +#ifdef USE_UCLIBC
81 +
82 +#undef CRIS_SUBTARGET_VERSION
83 +#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
84 +
85 +#undef CRIS_LINK_SUBTARGET_SPEC
86 +#define CRIS_LINK_SUBTARGET_SPEC \
87 + "-mcrislinux\
88 +  -rpath-link include/asm/../..%s\
89 +  %{shared} %{static}\
90 +  %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
91 +  %{!shared: \
92 +    %{!static: \
93 +      %{rdynamic:-export-dynamic} \
94 +      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
95 +  %{!r:%{O2|O3: --gc-sections}}"
96 +
97 +#else  /* USE_UCLIBC */
98 +
99  #undef CRIS_SUBTARGET_VERSION
100  #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
101  
102 @@ -93,6 +112,8 @@
103    %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
104    %{!r:%{O2|O3: --gc-sections}}"
105  
106 +#endif  /* USE_UCLIBC */
107 +
108  
109  /* Node: Run-time Target */
110  
111 --- gcc-4.0.2/gcc/config/i386/linux.h
112 +++ gcc-4.0.2/gcc/config/i386/linux.h
113 @@ -107,6 +107,11 @@
114  #define LINK_EMULATION "elf_i386"
115  #define DYNAMIC_LINKER "/lib/ld-linux.so.2"
116  
117 +#ifdef USE_UCLIBC
118 +#undef DYNAMIC_LINKER
119 +#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
120 +#endif
121 +
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
127 @@ -54,14 +54,21 @@
128     When the -shared link option is used a final link is not being
129     done.  */
130  
131 +#ifdef USE_UCLIBC
132 +#define ELF32_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
133 +#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
134 +#else
135 +#define ELF32_DYNAMIC_LINKER "/lib/ld-linux.so.2"
136 +#define ELF64_DYNAMIC_LINKER "/lib64/ld-linux-x86-64.so.2"
137 +#endif
138  #undef LINK_SPEC
139  #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
140    %{shared:-shared} \
141    %{!shared: \
142      %{!static: \
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 "}}} \
148      %{static:-static}}"
149  
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
153 @@ -37,13 +37,18 @@
154  /* Define this for shared library support because it isn't in the main
155     linux.h file.  */
156  
157 +#ifdef USE_UCLIBC
158 +#define ELF_DYNAMIC_LINKER     "/lib/ld-uClibc.so.0"
159 +#else
160 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux-ia64.so.2"
161 +#endif
162  #undef LINK_SPEC
163  #define LINK_SPEC "\
164    %{shared:-shared} \
165    %{!shared: \
166      %{!static: \
167        %{rdynamic:-export-dynamic} \
168 -      %{!dynamic-linker:-dynamic-linker /lib/ld-linux-ia64.so.2}} \
169 +      %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
170        %{static:-static}}"
171  
172  
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 @@
176  
177  /* If ELF is the default format, we should not use /lib/elf.  */
178  
179 +#ifdef USE_UCLIBC
180 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
181 +#else
182 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
183 +#endif
184  #undef LINK_SPEC
185  #define LINK_SPEC "-m m68kelf %{shared} \
186    %{!shared: \
187      %{!static: \
188        %{rdynamic:-export-dynamic} \
189 -      %{!dynamic-linker*:-dynamic-linker /lib/ld.so.1}} \
190 +      %{!dynamic-linker*:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
191      %{static}}"
192  
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 @@
197  
198  /* Borrowed from sparc/linux.h */
199  #undef LINK_SPEC
200 +#ifdef USE_UCLIBC
201 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
202 +#else
203 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
204 +#endif
205  #define LINK_SPEC \
206   "%(endian_spec) \
207    %{shared:-shared} \
208    %{!shared: \
209      %{!ibcs: \
210        %{!static: \
211          %{rdynamic:-export-dynamic} \
212 -        %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
213 +        %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
214          %{static:-static}}}"
215  
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
219 @@ -82,13 +82,18 @@
220  /* Define this for shared library support because it isn't in the main
221     linux.h file.  */
222  
223 +#ifdef USE_UCLIBC
224 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
225 +#else
226 +#define ELF_DYNAMIC_LINKER "/lib/ld.so.1"
227 +#endif
228  #undef LINK_SPEC
229  #define LINK_SPEC "\
230    %{shared:-shared} \
231    %{!shared: \
232      %{!static: \
233        %{rdynamic:-export-dynamic} \
234 -      %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
235 +      %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
236        %{static:-static}}"
237  
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
241 @@ -69,7 +69,11 @@
242  #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
243  
244  #undef LINK_OS_DEFAULT_SPEC
245 +#ifdef USE_UCLIBC
246 +#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
247 +#else
248  #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
249 +#endif
250  
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
255 @@ -949,6 +949,7 @@
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)     }"
262  
263 @@ -1127,6 +1128,10 @@
264    %{rdynamic:-export-dynamic} \
265    %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
266  
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}}}"
270 +
271  #if defined(HAVE_LD_EH_FRAME_HDR)
272  # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
273  #endif
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
284 @@ -77,6 +77,13 @@
285  #define MULTILIB_DEFAULTS { "m31" }
286  #endif
287  
288 +#ifdef USE_UCLIBC
289 +#define ELF31_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
290 +#define ELF64_DYNAMIC_LINKER "/lib/ld64-uClibc.so.0"
291 +#else
292 +#define ELF31_DYNAMIC_LINKER "/lib/ld.so.1"
293 +#define ELF64_DYNAMIC_LINKER "/lib/ld64.so.1"
294 +#endif
295  #undef  LINK_SPEC
296  #define LINK_SPEC \
297    "%{m31:-m elf_s390}%{m64:-m elf64_s390} \
298 @@ -86,8 +93,8 @@
299        %{!static: \
300         %{rdynamic:-export-dynamic} \
301         %{!dynamic-linker: \
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 "}}}}"
306  
307  
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
311 @@ -67,11 +67,16 @@
312  #undef SUBTARGET_LINK_EMUL_SUFFIX
313  #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
314  #undef SUBTARGET_LINK_SPEC
315 +#ifdef USE_UCLIBC
316 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
317 +#else
318 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
319 +#endif
320  #define SUBTARGET_LINK_SPEC \
321    "%{shared:-shared} \
322     %{!static: \
323       %{rdynamic:-export-dynamic} \
324 -     %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
325 +     %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
326     %{static:-static}"
327  
328  #undef LIB_SPEC
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 @@
332  
333  /* If ELF is the default format, we should not use /lib/elf.  */
334  
335 +#ifdef USE_UCLIBC
336 +#define ELF_DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
337 +#else
338 +#define ELF_DYNAMIC_LINKER "/lib/ld-linux.so.2"
339 +#endif
340  #undef  LINK_SPEC
341  #define LINK_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
342    %{!mno-relax:%{!r:-relax}} \
343    %{!shared: \
344      %{!ibcs: \
345        %{!static: \
346          %{rdynamic:-export-dynamic} \
347 -        %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
348 +        %{!dynamic-linker:-dynamic-linker " ELF_DYNAMIC_LINKER "}} \
349          %{static:-static}}}"
350  
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 },
357      
358 +#ifdef USE_UCLIBC
359 +#define ELF_DYNAMIC_LINKER     "/lib/ld-uClibc.so.0"
360 +#else
361 +#define ELF_DYNAMIC_LINKER  "/lib/ld-linux.so.2"
362 +#endif
363  #define LINK_ARCH32_SPEC "-m elf32_sparc -Y P,/usr/lib %{shared:-shared} \
364    %{!shared: \
365      %{!ibcs: \
366        %{!static: \
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}}} \
371  "
372  
373 --- gcc-4.0.2/libtool.m4
374 +++ gcc-4.0.2/libtool.m4
375 @@ -682,6 +682,11 @@
376    lt_cv_deplibs_check_method=pass_all
377    ;;
378  
379 +linux-uclibc*)
380 +  lt_cv_deplibs_check_method=pass_all
381 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
382 +  ;;
383 +
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
389 @@ -603,6 +603,7 @@
390  
391  # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
392  case $host_os in
393 +linux-uclibc*) ;;
394  linux-gnu*) ;;
395  linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
396  esac
397 @@ -1274,6 +1275,23 @@
398    dynamic_linker='GNU/Linux ld.so'
399    ;;
400  
401 +linux-uclibc*)
402 +  version_type=linux
403 +  need_lib_prefix=no
404 +  need_version=no
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"
416 +  ;;
417 +
418  netbsd*)
419    need_lib_prefix=no
420    need_version=no
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
425    ;;
426  
427 +linux-uclibc*)
428 +  lt_cv_deplibs_check_method=pass_all
429 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
430 +  ;;
431 +
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
439    ;;
440  
441 +linux-uclibc*)
442 +  lt_cv_deplibs_check_method=pass_all
443 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
444 +  ;;
445 +
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
453    ;;
454  
455 +linux-uclibc*)
456 +  lt_cv_deplibs_check_method=pass_all
457 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
458 +  ;;
459 +
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
467    ;;
468  
469 +linux-uclibc*)
470 +  lt_cv_deplibs_check_method=pass_all
471 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
472 +  ;;
473 +
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
481    ;;
482  
483 +linux-uclibc*)
484 +  lt_cv_deplibs_check_method=pass_all
485 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
486 +  ;;
487 +
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
495    ;;
496  
497 +linux-uclibc*)
498 +  lt_cv_deplibs_check_method=pass_all
499 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
500 +  ;;
501 +
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 @@
508      ;;
509  "")
510      case "${target}" in
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.
514         ;;
515      *-*-freebsd*)
516 --- gcc-4.0.2/configure.in
517 +++ gcc-4.0.2/configure.in
518 @@ -350,7 +350,7 @@
519      ;;
520  "")
521      case "${target}" 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.
525         ;;
526      *-*-freebsd*)
527 --- gcc-4.0.2/contrib/regression/objs-gcc.sh
528 +++ gcc-4.0.2/contrib/regression/objs-gcc.sh
529 @@ -105,6 +105,10 @@
530   then
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 ]
534 + then
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
544    ;;
545  
546 +linux-uclibc*)
547 +  lt_cv_deplibs_check_method=pass_all
548 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
549 +  ;;
550 +
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]+$'