summaryrefslogtreecommitdiffstats
path: root/toolchain/gcc/4.2.0/100-uclibc-conf.patch
blob: a0487059d3d3059a02bf8201a0ce5ca1c692e1c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
diff -ruNp gcc-4.2.0.oorig/boehm-gc/configure gcc-4.2.0/boehm-gc/configure
--- gcc-4.2.0.oorig/boehm-gc/configure	2006-01-26 07:59:58.000000000 +0100
+++ gcc-4.2.0/boehm-gc/configure	2006-01-28 19:18:19.000000000 +0100
@@ -4320,6 +4320,11 @@ linux-gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+linux-uclibc*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+  ;;
+
 netbsd* | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff -ruNp gcc-4.2.0.oorig/contrib/regression/objs-gcc.sh gcc-4.2.0/contrib/regression/objs-gcc.sh
--- gcc-4.2.0.oorig/contrib/regression/objs-gcc.sh	2005-10-31 18:10:00.000000000 +0100
+++ gcc-4.2.0/contrib/regression/objs-gcc.sh	2006-01-28 19:18:19.000000000 +0100
@@ -105,6 +105,10 @@ if [ $H_REAL_TARGET = $H_REAL_HOST -a $H
  then
   make all-gdb all-dejagnu all-ld || exit 1
   make install-gdb install-dejagnu install-ld || exit 1
+elif [ $H_REAL_TARGET = $H_REAL_HOST -a $H_REAL_TARGET = i686-pc-linux-uclibc ]
+ then
+  make all-gdb all-dejagnu all-ld || exit 1
+  make install-gdb install-dejagnu install-ld || exit 1
 elif [ $H_REAL_TARGET = $H_REAL_HOST ] ; then
   make bootstrap || exit 1
   make install || exit 1
diff -ruNp gcc-4.2.0.oorig/gcc/config/alpha/linux-elf.h gcc-4.2.0/gcc/config/alpha/linux-elf.h
--- gcc-4.2.0.oorig/gcc/config/alpha/linux-elf.h	2005-10-31 18:00:45.000000000 +0100
+++ gcc-4.2.0/gcc/config/alpha/linux-elf.h	2006-01-28 19:18:19.000000000 +0100
@@ -27,7 +27,11 @@ Boston, MA 02110-1301, USA.  */
 #define SUBTARGET_EXTRA_SPECS \
 { "elf_dynamic_linker", ELF_DYNAMIC_LINKER },
 
+#if defined USE_UCLIBC
+#define ELF_DYNAMIC_LINKER	"/lib/ld-uClibc.so.0"
+#else
 #define ELF_DYNAMIC_LINKER	"/lib/ld-linux.so.2"
+#endif
 
 #define LINK_SPEC "-m elf64alpha %{G*} %{relax:-relax}		\
   %{O*:-O3} %{!O*:-O1}						\
diff -ruNp gcc-4.2.0.oorig/gcc/config/arm/linux-elf.h gcc-4.2.0/gcc/config/arm/linux-elf.h
--- gcc-4.2.0.oorig/gcc/config/arm/linux-elf.h	2005-11-22 14:45:02.000000000 +0100
+++ gcc-4.2.0/gcc/config/arm/linux-elf.h	2006-01-28 19:18:19.000000000 +0100
@@ -51,7 +51,11 @@
 
 #define LIBGCC_SPEC "%{msoft-float:-lfloat} %{mfloat-abi=soft*:-lfloat} -lgcc"
 
+#ifdef USE_UCLIBC
+#define LINUX_TARGET_INTERPRETER "/lib/ld-uClibc.so.0"
+#else
 #define LINUX_TARGET_INTERPRETER "/lib/ld-linux.so.2"
+#endif
 
 #define LINUX_TARGET_LINK_SPEC  "%{h*} %{version:-v} \
    %{b} \
diff -ruNp gcc-4.2.0.oorig/gcc/config/cris/linux.h gcc-4.2.0/gcc/config/cris/linux.h
--- gcc-4.2.0.oorig/gcc/config/cris/linux.h	2005-11-22 14:45:02.000000000 +0100
+++ gcc-4.2.0/gcc/config/cris/linux.h	2006-01-28 19:18:19.000000000 +0100
@@ -73,6 +73,25 @@ Boston, MA 02110-1301, USA.  */
 #undef CRIS_DEFAULT_CPU_VERSION
 #define CRIS_DEFAULT_CPU_VERSION CRIS_CPU_NG
 
+#ifdef USE_UCLIBC
+
+#undef CRIS_SUBTARGET_VERSION
+#define CRIS_SUBTARGET_VERSION " - cris-axis-linux-uclibc"
+
+#undef CRIS_LINK_SUBTARGET_SPEC
+#define CRIS_LINK_SUBTARGET_SPEC \
+ "-mcrislinux\
+  -rpath-link include/asm/../..%s\
+  %{shared} %{static}\
+  %{symbolic:-Bdynamic} %{shlib:-Bdynamic} %{static:-Bstatic}\
+  %{!shared: \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}} \
+  %{!r:%{O2|O3: --gc-sections}}"
+
+#else  /* USE_UCLIBC */
+
 #undef CRIS_SUBTARGET_VERSION
 #define CRIS_SUBTARGET_VERSION " - cris-axis-linux-gnu"
 
@@ -87,6 +106,8 @@ Boston, MA 02110-1301, USA.  */
   %{!shared:%{!static:%{rdynamic:-export-dynamic}}}\
   %{!r:%{O2|O3: --gc-sections}}"
 
+#endif  /* USE_UCLIBC */
+
 
 /* Node: Run-time Target */
 
diff -ruNp gcc-4.2.0.oorig/gcc/config/cris/t-linux-uclibc gcc-4.2.0/gcc/config/cris/t-linux-uclibc
--- gcc-4.2.0.oorig/gcc/config/cris/t-linux-uclibc	1970-01-01 01:00:00.000000000 +0100
+++ gcc-4.2.0/gcc/config/cris/t-linux-uclibc	2006-01-28 19:18:19.000000000 +0100
@@ -0,0 +1,3 @@
+T_CFLAGS = -DUSE_UCLIBC
+TARGET_LIBGCC2_CFLAGS += -fPIC
+CRTSTUFF_T_CFLAGS_S = $(TARGET_LIBGCC2_CFLAGS)
diff -ruNp gcc-4.2.0.oorig/gcc/config/i386/linux64.h gcc-4.2.0/gcc/config/i386/linux64.h
--- gcc-4.2.0.oorig/gcc/config/i386/linux64.h	2005-11-22 14:45:00.000000000 +0100
+++ gcc-4.2.0/gcc/config/i386/linux64.h	2006-01-28 19:18:19.000000000 +0100
@@ -50,6 +50,15 @@ Boston, MA 02110-1301, USA.  */
    done.  */
 
 #undef	LINK_SPEC
+#if defined USE_UCLIBC
+#define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
+  %{shared:-shared} \
+  %{!shared: \
+    %{!static: \
+      %{rdynamic:-export-dynamic} \
+      %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
+    %{static:-static}}"
+#else
 #define LINK_SPEC "%{!m32:-m elf_x86_64} %{m32:-m elf_i386} \
   %{shared:-shared} \
   %{!shared: \
@@ -58,6 +67,7 @@ Boston, MA 02110-1301, USA.  */
       %{m32:%{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
       %{!m32:%{!dynamic-linker:-dynamic-linker /lib64/ld-linux-x86-64.so.2}}} \
     %{static:-static}}"
+#endif
 
 /* Similar to standard Linux, but adding -ffast-math support.  */
 #undef  ENDFILE_SPEC
diff -ruNp gcc-4.2.0.oorig/gcc/config/i386/linux.h gcc-4.2.0/gcc/config/i386/linux.h
--- gcc-4.2.0.oorig/gcc/config/i386/linux.h	2005-11-22 14:45:00.000000000 +0100
+++ gcc-4.2.0/gcc/config/i386/linux.h	2006-01-28 19:18:19.000000000 +0100
@@ -102,6 +102,11 @@ Boston, MA 02110-1301, USA.  */
 #define LINK_EMULATION "elf_i386"
 #define DYNAMIC_LINKER "/lib/ld-linux.so.2"
 
+#if defined USE_UCLIBC
+#undef DYNAMIC_LINKER
+#define DYNAMIC_LINKER "/lib/ld-uClibc.so.0"
+#endif
+
 #undef  SUBTARGET_EXTRA_SPECS
 #define SUBTARGET_EXTRA_SPECS \
   { "link_emulation", LINK_EMULATION },\
diff -ruNp gcc-4.2.0.oorig/gcc/config/mips/linux.h gcc-4.2.0/gcc/config/mips/linux.h
--- gcc-4.2.0.oorig/gcc/config/mips/linux.h	2005-11-22 14:45:02.000000000 +0100
+++ gcc-4.2.0/gcc/config/mips/linux.h	2006-01-28 19:18:19.000000000 +0100
@@ -100,6 +100,17 @@ Boston, MA 02110-1301, USA.  */
 
 /* Borrowed from sparc/linux.h */
 #undef LINK_SPEC
+#ifdef USE_UCLIBC
+#define LINK_SPEC \
+ "%(endian_spec) \
+  %{shared:-shared} \
+  %{!shared: \
+    %{!ibcs: \
+      %{!static: \
+        %{rdynamic:-export-dynamic} \
+        %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
+        %{static:-static}}}"
+#else
 #define LINK_SPEC \
  "%(endian_spec) \
   %{shared:-shared} \
@@ -109,6 +120,7 @@ Boston, MA 02110-1301, USA.  */
         %{rdynamic:-export-dynamic} \
         %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}} \
         %{static:-static}}}"
+#endif
 
 #undef SUBTARGET_ASM_SPEC
 #define SUBTARGET_ASM_SPEC "%{mabi=64: -64} %{!mno-abicalls:-KPIC}"
diff -ruNp gcc-4.2.0.oorig/gcc/config/rs6000/linux.h gcc-4.2.0/gcc/config/rs6000/linux.h
--- gcc-4.2.0.oorig/gcc/config/rs6000/linux.h	2006-01-28 12:58:41.000000000 +0100
+++ gcc-4.2.0/gcc/config/rs6000/linux.h	2006-01-28 19:18:19.000000000 +0100
@@ -72,7 +72,11 @@
 #define LINK_START_DEFAULT_SPEC "%(link_start_linux)"
 
 #undef	LINK_OS_DEFAULT_SPEC
+#ifdef USE_UCLIBC
+#define LINK_OS_DEFAULT_SPEC "%(link_os_linux_uclibc)"
+#else
 #define LINK_OS_DEFAULT_SPEC "%(link_os_linux)"
+#endif
 
 #define LINK_GCC_C_SEQUENCE_SPEC \
   "%{static:--start-group} %G %L %{static:--end-group}%{!static:%G}"
diff -ruNp gcc-4.2.0.oorig/gcc/config/rs6000/sysv4.h gcc-4.2.0/gcc/config/rs6000/sysv4.h
--- gcc-4.2.0.oorig/gcc/config/rs6000/sysv4.h	2006-01-28 12:58:41.000000000 +0100
+++ gcc-4.2.0/gcc/config/rs6000/sysv4.h	2006-01-28 19:18:19.000000000 +0100
@@ -739,6 +739,7 @@ extern int fixuplabelno;
   mcall-linux  : %(link_os_linux)       ; \
   mcall-gnu    : %(link_os_gnu)         ; \
   mcall-netbsd : %(link_os_netbsd)      ; \
+  mcall-linux-uclibc : %(link_os_linux_uclibc); \
   mcall-openbsd: %(link_os_openbsd)     ; \
                : %(link_os_default)     }"
 
@@ -916,6 +917,10 @@ extern int fixuplabelno;
   %{rdynamic:-export-dynamic} \
   %{!dynamic-linker:-dynamic-linker /lib/ld.so.1}}}"
 
+#define LINK_OS_LINUX_UCLIBC_SPEC "-m elf32ppclinux %{!shared: %{!static: \
+  %{rdynamic:-export-dynamic} \
+  %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}}}"
+
 #if defined(HAVE_LD_EH_FRAME_HDR)
 # define LINK_EH_SPEC "%{!static:--eh-frame-hdr} "
 #endif
@@ -1082,6 +1087,7 @@ ncrtn.o%s"
   { "link_os_sim",		LINK_OS_SIM_SPEC },			\
   { "link_os_freebsd",		LINK_OS_FREEBSD_SPEC },			\
   { "link_os_linux",		LINK_OS_LINUX_SPEC },			\
+  { "link_os_linux_uclibc",	LINK_OS_LINUX_UCLIBC_SPEC },		\
   { "link_os_gnu",		LINK_OS_GNU_SPEC },			\
   { "link_os_netbsd",		LINK_OS_NETBSD_SPEC },			\
   { "link_os_openbsd",		LINK_OS_OPENBSD_SPEC },			\
diff -ruNp gcc-4.2.0.oorig/gcc/config/sh/linux.h gcc-4.2.0/gcc/config/sh/linux.h
--- gcc-4.2.0.oorig/gcc/config/sh/linux.h	2005-11-22 14:45:01.000000000 +0100
+++ gcc-4.2.0/gcc/config/sh/linux.h	2006-01-28 19:18:19.000000000 +0100
@@ -51,12 +51,21 @@ Boston, MA 02110-1301, USA.  */
 #undef SUBTARGET_LINK_EMUL_SUFFIX
 #define SUBTARGET_LINK_EMUL_SUFFIX "_linux"
 #undef SUBTARGET_LINK_SPEC
+#ifdef USE_UCLIBC
+#define SUBTARGET_LINK_SPEC \
+  "%{shared:-shared} \
+   %{!static: \
+     %{rdynamic:-export-dynamic} \
+     %{!dynamic-linker:-dynamic-linker /lib/ld-uClibc.so.0}} \
+   %{static:-static}"
+#else
 #define SUBTARGET_LINK_SPEC \
   "%{shared:-shared} \
    %{!static: \
      %{rdynamic:-export-dynamic} \
      %{!dynamic-linker:-dynamic-linker /lib/ld-linux.so.2}} \
    %{static:-static}"
+#endif
 
 /* Output assembler code to STREAM to call the profiler.  */
 
diff -ruNp gcc-4.2.0.oorig/gcc/config/t-linux-uclibc gcc-4.2.0/gcc/config/t-linux-uclibc
--- gcc-4.2.0.oorig/gcc/config/t-linux-uclibc	1970-01-01 01:00:00.000000000 +0100
+++ gcc-4.2.0/gcc/config/t-linux-uclibc	2006-01-28 19:18:19.000000000 +0100
@@ -0,0 +1,15 @@
+T_CFLAGS = -DUSE_UCLIBC
+
+# Compile crtbeginS.o and crtendS.o with pic.
+CRTSTUFF_T_CFLAGS_S = $(CRTSTUFF_T_CFLAGS) -fPIC
+# Compile libgcc2.a with pic.
+TARGET_LIBGCC2_CFLAGS = -fPIC
+
+# Override t-slibgcc-elf-ver to export some libgcc symbols with
+# the symbol versions that glibc used.
+#SHLIB_MAPFILES += $(srcdir)/config/libgcc-glibc.ver
+
+# Use unwind-dw2-fde
+LIB2ADDEH = $(srcdir)/unwind-dw2.c $(srcdir)/unwind-dw2-fde.c \
+  $(srcdir)/unwind-sjlj.c $(srcdir)/gthr-gnat.c $(srcdir)/unwind-c.c
+LIB2ADDEHDEP = unwind.inc unwind-dw2-fde.h
diff -ruNp gcc-4.2.0.oorig/gcc/config.gcc gcc-4.2.0/gcc/config.gcc
--- gcc-4.2.0.oorig/gcc/config.gcc	2006-01-20 19:14:30.000000000 +0100
+++ gcc-4.2.0/gcc/config.gcc	2006-01-28 19:18:19.000000000 +0100
@@ -451,7 +451,12 @@ case ${target} in
   case ${enable_threads} in
     "" | yes | posix) thread_file='posix' ;;
   esac
-  tmake_file="t-slibgcc-elf-ver t-linux"
+  case ${target} in
+    *-*-linux-uclibc*)
+      tmake_file="t-slibgcc-elf-ver t-linux-uclibc" ;;
+    *)
+      tmake_file="t-slibgcc-elf-ver t-linux" ;;
+  esac
   ;;
 *-*-gnu*)
   # On the Hurd, the setup is just about the same on
@@ -789,6 +794,10 @@ cris-*-elf | cris-*-none)
 	gas=yes
 	extra_options="${extra_options} cris/elf.opt"
 	;;
+cris-*-linux-uclibc*)
+	tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
+	tmake_file="cris/t-cris t-slibgcc-elf-ver cris/t-linux-uclibc"
+	;;
 cris-*-linux*)
 	tm_file="dbxelf.h elfos.h svr4.h ${tm_file} linux.h cris/linux.h"
 	# We need to avoid using t-linux, so override default tmake_file
@@ -1883,7 +1892,7 @@ s390x-ibm-tpf*)
 	;;
 sh-*-elf* | sh[12346l]*-*-elf* | sh*-*-kaos* | \
 sh-*-symbianelf* | sh[12346l]*-*-symbianelf* | \
-  sh-*-linux* | sh[346lbe]*-*-linux* | \
+  sh*-*-linux* | sh[346lbe]*-*-linux* | \
   sh-*-netbsdelf* | shl*-*-netbsdelf* | sh5-*-netbsd* | sh5l*-*-netbsd* | \
    sh64-*-netbsd* | sh64l*-*-netbsd*)
 	tmake_file="${tmake_file} sh/t-sh sh/t-elf"
diff -ruNp gcc-4.2.0.oorig/libffi/configure gcc-4.2.0/libffi/configure
--- gcc-4.2.0.oorig/libffi/configure	2006-01-22 12:38:53.000000000 +0100
+++ gcc-4.2.0/libffi/configure	2006-01-28 19:18:19.000000000 +0100
@@ -3457,6 +3457,11 @@ linux-gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+linux-uclibc*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+  ;;
+
 netbsd* | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff -ruNp gcc-4.2.0.oorig/libgfortran/configure gcc-4.2.0/libgfortran/configure
--- gcc-4.2.0.oorig/libgfortran/configure	2006-01-17 12:33:05.000000000 +0100
+++ gcc-4.2.0/libgfortran/configure	2006-01-28 19:18:19.000000000 +0100
@@ -3699,6 +3699,11 @@ linux-gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+linux-uclibc*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+  ;;
+
 netbsd* | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff -ruNp gcc-4.2.0.oorig/libjava/configure gcc-4.2.0/libjava/configure
--- gcc-4.2.0.oorig/libjava/configure	2006-01-24 21:41:59.000000000 +0100
+++ gcc-4.2.0/libjava/configure	2006-01-28 19:18:19.000000000 +0100
@@ -5137,6 +5137,11 @@ linux-gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+linux-uclibc*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+  ;;
+
 netbsd* | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff -ruNp gcc-4.2.0.oorig/libmudflap/configure gcc-4.2.0/libmudflap/configure
--- gcc-4.2.0.oorig/libmudflap/configure	2005-10-31 18:08:44.000000000 +0100
+++ gcc-4.2.0/libmudflap/configure	2006-01-28 19:18:19.000000000 +0100
@@ -5382,6 +5382,11 @@ linux-gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+linux-uclibc*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+  ;;
+
 netbsd* | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff -ruNp gcc-4.2.0.oorig/libobjc/configure gcc-4.2.0/libobjc/configure
--- gcc-4.2.0.oorig/libobjc/configure	2006-01-24 23:36:09.000000000 +0100
+++ gcc-4.2.0/libobjc/configure	2006-01-28 19:18:19.000000000 +0100
@@ -3313,6 +3313,11 @@ linux-gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+linux-uclibc*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+  ;;
+
 netbsd* | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
diff -ruNp gcc-4.2.0.oorig/libtool.m4 gcc-4.2.0/libtool.m4
--- gcc-4.2.0.oorig/libtool.m4	2005-10-31 18:19:54.000000000 +0100
+++ gcc-4.2.0/libtool.m4	2006-01-28 19:18:19.000000000 +0100
@@ -743,6 +743,11 @@ linux-gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+linux-uclibc*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+  ;;
+
 netbsd* | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
diff -ruNp gcc-4.2.0.oorig/ltconfig gcc-4.2.0/ltconfig
--- gcc-4.2.0.oorig/ltconfig	2005-10-31 18:19:54.000000000 +0100
+++ gcc-4.2.0/ltconfig	2006-01-28 19:18:19.000000000 +0100
@@ -603,6 +603,7 @@ host_os=`echo $host | sed 's/^\([^-]*\)-
 
 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
 case $host_os in
+linux-uclibc*) ;;
 linux-gnu*) ;;
 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
 esac
@@ -1274,6 +1275,23 @@ linux-gnu*)
   dynamic_linker='GNU/Linux ld.so'
   ;;
 
+linux-uclibc*)
+  version_type=linux
+  need_lib_prefix=no
+  need_version=no
+  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
+  soname_spec='${libname}${release}.so$major'
+  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
+  shlibpath_var=LD_LIBRARY_PATH
+  shlibpath_overrides_runpath=no
+  # This implies no fast_install, which is unacceptable.
+  # Some rework will be needed to allow for fast_install
+  # before this can be enabled.
+  hardcode_into_libs=yes
+  # Assume using the uClibc dynamic linker.
+  dynamic_linker="uClibc ld.so"
+  ;;
+
 netbsd*)
   need_lib_prefix=no
   need_version=no
diff -ruNp gcc-4.2.0.oorig/zlib/configure gcc-4.2.0/zlib/configure
--- gcc-4.2.0.oorig/zlib/configure	2005-10-31 18:07:37.000000000 +0100
+++ gcc-4.2.0/zlib/configure	2006-01-28 19:18:19.000000000 +0100
@@ -3426,6 +3426,11 @@ linux-gnu*)
   lt_cv_deplibs_check_method=pass_all
   ;;
 
+linux-uclibc*)
+  lt_cv_deplibs_check_method=pass_all
+  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
+  ;;
+
 netbsd* | knetbsd*-gnu)
   if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
     lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'