Initial revision
[openwrt.git] / toolchain / binutils / 2.15.91.0.2 / 100-uclibc-conf.patch
1 diff -urN binutils-2.15.91.0.2-dist/bfd/config.bfd binutils-2.15.91.0.2/bfd/config.bfd
2 --- binutils-2.15.91.0.2-dist/bfd/config.bfd    2004-07-27 23:36:07.000000000 -0500
3 +++ binutils-2.15.91.0.2/bfd/config.bfd 2004-09-28 14:33:13.000000000 -0500
4 @@ -129,7 +129,7 @@
5      targ_defvec=ecoffalpha_little_vec
6      targ_selvecs=bfd_elf64_alpha_vec
7      ;;
8 -  alpha*-*-linux-gnu* | alpha*-*-elf*)
9 +  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
10      targ_defvec=bfd_elf64_alpha_vec
11      targ_selvecs=ecoffalpha_little_vec
12      ;;
13 @@ -139,7 +139,7 @@
14    alpha*-*-*)
15      targ_defvec=ecoffalpha_little_vec
16      ;;
17 -  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
18 +  ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
19      targ_defvec=bfd_elf64_ia64_little_vec
20      targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
21      ;;
22 @@ -216,7 +216,7 @@
23      targ_defvec=bfd_elf32_littlearm_vec
24      targ_selvecs=bfd_elf32_bigarm_vec
25      ;;
26 -  armeb-*-elf | arm*b-*-linux-gnu*)
27 +  armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
28      targ_defvec=bfd_elf32_bigarm_vec
29      targ_selvecs=bfd_elf32_littlearm_vec
30      ;;
31 @@ -224,7 +224,7 @@
32      targ_defvec=bfd_elf32_littlearm_vec
33      targ_selvecs=bfd_elf32_bigarm_vec
34      ;;
35 -  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
36 +  arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
37    arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks)
38      targ_defvec=bfd_elf32_littlearm_vec
39      targ_selvecs=bfd_elf32_bigarm_vec
40 @@ -373,7 +373,7 @@
41      ;;
42  
43  #ifdef BFD64
44 -  hppa*64*-*-linux-gnu*)
45 +  hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
46      targ_defvec=bfd_elf64_hppa_linux_vec
47      targ_selvecs=bfd_elf64_hppa_vec
48      ;;
49 @@ -384,7 +384,7 @@
50      ;;
51  #endif
52  
53 -  hppa*-*-linux-gnu* | hppa*-*-netbsd*)
54 +  hppa*-*-linux-gnu* | hppa*-*-linux-uclibc* | hppa*-*-netbsd*)
55      targ_defvec=bfd_elf32_hppa_linux_vec
56      targ_selvecs=bfd_elf32_hppa_vec
57      ;;
58 @@ -507,7 +507,7 @@
59      targ_selvecs=bfd_elf32_i386_vec
60      targ_underscore=yes
61      ;;
62 -  i[3-7]86-*-linux-gnu*)
63 +  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
64      targ_defvec=bfd_elf32_i386_vec
65      targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
66      targ64_selvecs=bfd_elf64_x86_64_vec
67 @@ -521,7 +521,7 @@
68      targ_defvec=bfd_elf64_x86_64_vec
69      targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
70      ;;
71 -  x86_64-*-linux-gnu*)
72 +  x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
73      targ_defvec=bfd_elf64_x86_64_vec
74      targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
75      ;;
76 @@ -696,7 +696,7 @@
77      targ_selvecs=bfd_elf32_m68k_vec
78      targ_underscore=yes
79      ;;
80 -  m68*-*-linux-gnu*)
81 +  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
82      targ_defvec=bfd_elf32_m68k_vec
83      targ_selvecs=m68klinux_vec
84      ;;
85 @@ -972,7 +972,8 @@
86      ;;
87  #endif
88    powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
89 -  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
90 +  powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
91 +  powerpc-*-rtems* | \
92    powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
93      targ_defvec=bfd_elf32_powerpc_vec
94      targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
95 @@ -1009,8 +1010,8 @@
96      targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
97      ;;
98    powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
99 -  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
100 -  powerpcle-*-rtems*)
101 +  powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
102 +  powerpcle-*-vxworks* | powerpcle-*-rtems*)
103      targ_defvec=bfd_elf32_powerpcle_vec
104      targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
105      targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
106 @@ -1177,7 +1178,7 @@
107      targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
108      targ_underscore=yes
109      ;;
110 -  sparc-*-linux-gnu*)
111 +  sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
112      targ_defvec=bfd_elf32_sparc_vec
113      targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
114      ;;
115 @@ -1224,7 +1225,7 @@
116      targ_defvec=sunos_big_vec
117      targ_underscore=yes
118      ;;
119 -  sparc64-*-linux-gnu*)
120 +  sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
121      targ_defvec=bfd_elf64_sparc_vec
122      targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
123      ;;
124 @@ -1293,7 +1294,7 @@
125      targ_underscore=yes
126      ;;
127  
128 -  vax-*-linux-gnu*)
129 +  vax-*-linux-gnu* | vax-*-linux-uclibc*)
130      targ_defvec=bfd_elf32_vax_vec
131      ;;
132  
133 diff -urN binutils-2.15.91.0.2-dist/bfd/configure binutils-2.15.91.0.2/bfd/configure
134 --- binutils-2.15.91.0.2-dist/bfd/configure     2004-07-27 23:36:07.000000000 -0500
135 +++ binutils-2.15.91.0.2/bfd/configure  2004-09-28 14:33:13.000000000 -0500
136 @@ -1687,6 +1687,11 @@
137    lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
138    ;;
139  
140 +linux-uclibc*)
141 +  lt_cv_deplibs_check_method=pass_all
142 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
143 +  ;;
144 +
145  netbsd*)
146    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
147      lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
148 @@ -5266,7 +5271,7 @@
149    alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
150         COREFILE=''
151         ;;
152 -  alpha*-*-linux-gnu*)
153 +  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
154         COREFILE=trad-core.lo
155         TRAD_HEADER='"hosts/alphalinux.h"'
156         ;;
157 @@ -5330,7 +5335,7 @@
158         COREFILE=trad-core.lo
159         TRAD_HEADER='"hosts/i386mach3.h"'
160         ;;
161 -  i[3-7]86-*-linux-gnu*)
162 +  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
163         COREFILE=trad-core.lo
164         TRAD_HEADER='"hosts/i386linux.h"'
165         ;;
166 @@ -5368,7 +5373,7 @@
167         COREFILE=trad-core.lo
168         TRAD_HEADER='"hosts/hp300bsd.h"'
169         ;;
170 -  m68*-*-linux-gnu*)
171 +  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
172         COREFILE=trad-core.lo
173         TRAD_HEADER='"hosts/m68klinux.h"'
174         ;;
175 @@ -5472,7 +5477,7 @@
176         COREFILE=trad-core.lo
177         TRAD_HEADER='"hosts/vaxult2.h"'
178         ;;
179 -  vax-*-linux-gnu*)
180 +  vax-*-linux-gnu* | vax-*-linux-uclibc*)
181         COREFILE=trad-core.lo
182         TRAD_HEADER='"hosts/vaxlinux.h"'
183         ;;
184 diff -urN binutils-2.15.91.0.2-dist/bfd/configure.in binutils-2.15.91.0.2/bfd/configure.in
185 --- binutils-2.15.91.0.2-dist/bfd/configure.in  2004-07-27 23:36:07.000000000 -0500
186 +++ binutils-2.15.91.0.2/bfd/configure.in       2004-09-28 14:33:13.000000000 -0500
187 @@ -164,7 +164,7 @@
188    alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
189         COREFILE=''
190         ;;
191 -  alpha*-*-linux-gnu*)
192 +  alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
193         COREFILE=trad-core.lo
194         TRAD_HEADER='"hosts/alphalinux.h"'
195         ;;
196 @@ -249,7 +249,7 @@
197         TRAD_HEADER='"hosts/i386mach3.h"'
198         ;;
199  changequote(,)dnl
200 -  i[3-7]86-*-linux-gnu*)
201 +  i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
202  changequote([,])dnl
203         COREFILE=trad-core.lo
204         TRAD_HEADER='"hosts/i386linux.h"'
205 @@ -290,7 +290,7 @@
206         COREFILE=trad-core.lo
207         TRAD_HEADER='"hosts/hp300bsd.h"'
208         ;;
209 -  m68*-*-linux-gnu*)
210 +  m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
211         COREFILE=trad-core.lo
212         TRAD_HEADER='"hosts/m68klinux.h"'
213         ;;
214 @@ -378,7 +378,7 @@
215         COREFILE=trad-core.lo
216         TRAD_HEADER='"hosts/vaxult2.h"'
217         ;;
218 -  vax-*-linux-gnu*)
219 +  vax-*-linux-gnu* | vax-*-linux-uclibc*)
220         COREFILE=trad-core.lo
221         TRAD_HEADER='"hosts/vaxlinux.h"'
222         ;;
223 diff -urN binutils-2.15.91.0.2-dist/binutils/configure binutils-2.15.91.0.2/binutils/configure
224 --- binutils-2.15.91.0.2-dist/binutils/configure        2004-04-12 14:56:34.000000000 -0500
225 +++ binutils-2.15.91.0.2/binutils/configure     2004-09-28 14:33:13.000000000 -0500
226 @@ -1575,6 +1575,11 @@
227    lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
228    ;;
229  
230 +linux-uclibc*)
231 +  lt_cv_deplibs_check_method=pass_all
232 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
233 +  ;;
234 +
235  netbsd*)
236    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
237      lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
238 diff -urN binutils-2.15.91.0.2-dist/configure binutils-2.15.91.0.2/configure
239 --- binutils-2.15.91.0.2-dist/configure 2004-07-27 23:36:06.000000000 -0500
240 +++ binutils-2.15.91.0.2/configure      2004-09-28 14:33:13.000000000 -0500
241 @@ -1349,6 +1349,18 @@
242    i[3456789]86-*-coff | i[3456789]86-*-elf)
243      noconfigdirs="$noconfigdirs ${libgcj}"
244      ;;
245 +  i[3456789]86-*-linux-uclibc*)
246 +    # This section makes it possible to build newlib natively on linux.
247 +    # If we are using a cross compiler then don't configure newlib.
248 +    if test x${is_cross_compiler} != xno ; then
249 +      noconfigdirs="$noconfigdirs target-newlib"
250 +    fi
251 +    noconfigdirs="$noconfigdirs target-libgloss"
252 +    # If we are not using a cross compiler, do configure newlib.
253 +    # Note however, that newlib will only be configured in this situation
254 +    # if the --with-newlib option has been given, because otherwise
255 +    # 'target-newlib' will appear in skipdirs.
256 +    ;;
257    i[3456789]86-*-linux*)
258      # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
259      # not build java stuff by default.
260 diff -urN binutils-2.15.91.0.2-dist/configure.in binutils-2.15.91.0.2/configure.in
261 --- binutils-2.15.91.0.2-dist/configure.in      2004-07-27 23:36:06.000000000 -0500
262 +++ binutils-2.15.91.0.2/configure.in   2004-09-28 14:33:13.000000000 -0500
263 @@ -569,6 +569,18 @@
264    i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
265      noconfigdirs="$noconfigdirs ${libgcj}"
266      ;;
267 +  i[[3456789]]86-*-linux-uclibc*)
268 +    # This section makes it possible to build newlib natively on linux.
269 +    # If we are using a cross compiler then don't configure newlib.
270 +    if test x${is_cross_compiler} != xno ; then
271 +      noconfigdirs="$noconfigdirs target-newlib"
272 +    fi
273 +    noconfigdirs="$noconfigdirs target-libgloss"
274 +    # If we are not using a cross compiler, do configure newlib.
275 +    # Note however, that newlib will only be configured in this situation
276 +    # if the --with-newlib option has been given, because otherwise
277 +    # 'target-newlib' will appear in skipdirs.
278 +    ;;
279    i[[3456789]]86-*-linux*)
280      # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
281      # not build java stuff by default.
282 diff -urN binutils-2.15.91.0.2-dist/gas/configure binutils-2.15.91.0.2/gas/configure
283 --- binutils-2.15.91.0.2-dist/gas/configure     2004-07-27 23:36:09.000000000 -0500
284 +++ binutils-2.15.91.0.2/gas/configure  2004-09-28 14:33:13.000000000 -0500
285 @@ -3408,6 +3408,11 @@
286    lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
287    ;;
288  
289 +linux-uclibc*)
290 +  lt_cv_deplibs_check_method=pass_all
291 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
292 +  ;;
293 +
294  netbsd*)
295    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
296      lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
297 @@ -4234,6 +4239,7 @@
298        alpha*-*-osf*)                   fmt=ecoff ;;
299        alpha*-*-linuxecoff*)            fmt=ecoff ;;
300        alpha*-*-linux-gnu*)             fmt=elf em=linux ;;
301 +      alpha*-*-linux-uclibc*)          fmt=elf em=linux ;;
302        alpha*-*-netbsd*)                        fmt=elf em=nbsd ;;
303        alpha*-*-openbsd*)               fmt=elf em=obsd ;;
304  
305 @@ -4250,6 +4256,7 @@
306        arm*-*-conix*)                   fmt=elf ;;
307        arm-*-linux*aout*)               fmt=aout em=linux ;;
308        arm*-*-linux-gnu*)               fmt=elf  em=linux ;;
309 +      arm*-*-linux-uclibc*)            fmt=elf  em=linux ;;
310        arm*-*-uclinux*)                 fmt=elf  em=linux ;;
311        arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
312        arm-*-*n*bsd*)                   fmt=aout em=nbsd ;;
313 @@ -4263,6 +4270,7 @@
314        avr-*-*)                         fmt=elf ;;
315  
316        cris-*-linux-gnu*)               fmt=multi bfd_gas=yes em=linux ;;
317 +      cris-*-linux-uclibc*)            fmt=multi bfd_gas=yes em=linux ;;
318        cris-*-*)                                fmt=multi bfd_gas=yes ;;
319  
320        crx-*-elf*)                      fmt=elf ;;
321 @@ -4322,7 +4330,9 @@
322        i386-*-linux*oldld)              fmt=aout em=linux ;;
323        i386-*-linux*coff*)              fmt=coff em=linux ;;
324        i386-*-linux-gnu*)               fmt=elf em=linux ;;
325 +      i386-*-linux-uclibc*)            fmt=elf em=linux ;;
326        x86_64-*-linux-gnu*)             fmt=elf em=linux ;;
327 +      x86_64-*-linux-uclibc*)          fmt=elf em=linux ;;
328        i386-*-lynxos*)                  fmt=elf em=lynx bfd_gas=yes ;;
329        i386-*-sysv[45]*)                        fmt=elf ;;
330        i386-*-solaris*)                 fmt=elf ;;
331 @@ -4382,6 +4392,7 @@
332        ia64-*-elf*)                     fmt=elf ;;
333        ia64-*-aix*)                     fmt=elf em=ia64aix ;;
334        ia64-*-linux-gnu*)               fmt=elf em=linux ;;
335 +      ia64-*-linux-uclibc*)            fmt=elf em=linux ;;
336        ia64-*-hpux*)                    fmt=elf em=hpux ;;
337        ia64-*-netbsd*)                  fmt=elf em=nbsd ;;
338  
339 @@ -4409,6 +4420,7 @@
340        m68k-*-hpux*)                    fmt=hp300 em=hp300 ;;
341        m68k-*-linux*aout*)              fmt=aout em=linux ;;
342        m68k-*-linux-gnu*)               fmt=elf em=linux ;;
343 +      m68k-*-linux-uclibc*)            fmt=elf em=linux ;;
344        m68k-*-uclinux*)                 fmt=elf ;;
345        m68k-*-gnu*)                     fmt=elf ;;
346        m68k-*-lynxos*)                  fmt=coff em=lynx ;;
347 @@ -4471,6 +4483,7 @@
348        ppc-*-beos*)                     fmt=coff ;;
349        ppc-*-*n*bsd* | ppc-*-elf*)      fmt=elf ;;
350        ppc-*-eabi* | ppc-*-sysv4*)      fmt=elf ;;
351 +      ppc-*-linux-uclibc* | \
352        ppc-*-linux-gnu*)                        fmt=elf em=linux
353             case "$endian" in
354                 big)  ;;
355 @@ -4498,7 +4511,9 @@
356        ppc-*-lynxos*)                   fmt=elf em=lynx bfd_gas=yes ;;
357  
358        s390x-*-linux-gnu*)              fmt=elf em=linux ;;
359 +      s390x-*-linux-uclibc*)           fmt=elf em=linux ;;
360        s390-*-linux-gnu*)               fmt=elf em=linux ;;
361 +      s390-*-linux-uclibc*)            fmt=elf em=linux ;;
362  
363        sh*-*-linux*)                    fmt=elf em=linux
364             case ${cpu} in
365 @@ -4538,6 +4553,7 @@
366        sparc-*-coff)                    fmt=coff ;;
367        sparc-*-linux*aout*)             fmt=aout em=linux ;;
368        sparc-*-linux-gnu*)              fmt=elf em=linux ;;
369 +      sparc-*-linux-uclibc*)           fmt=elf em=linux ;;
370        sparc-*-lynxos*)                 fmt=coff em=lynx ;;
371        sparc-fujitsu-none)              fmt=aout ;;
372        sparc-*-elf)                     fmt=elf ;;
373 diff -urN binutils-2.15.91.0.2-dist/gas/configure.in binutils-2.15.91.0.2/gas/configure.in
374 --- binutils-2.15.91.0.2-dist/gas/configure.in  2004-07-27 23:36:09.000000000 -0500
375 +++ binutils-2.15.91.0.2/gas/configure.in       2004-09-28 14:33:13.000000000 -0500
376 @@ -195,6 +195,7 @@
377        alpha*-*-osf*)                   fmt=ecoff ;;
378        alpha*-*-linuxecoff*)            fmt=ecoff ;;
379        alpha*-*-linux-gnu*)             fmt=elf em=linux ;;
380 +      alpha*-*-linux-uclibc*)          fmt=elf em=linux ;;
381        alpha*-*-netbsd*)                        fmt=elf em=nbsd ;;
382        alpha*-*-openbsd*)               fmt=elf em=obsd ;;
383  
384 @@ -211,6 +212,7 @@
385        arm*-*-conix*)                   fmt=elf ;;
386        arm-*-linux*aout*)               fmt=aout em=linux ;;
387        arm*-*-linux-gnu*)               fmt=elf  em=linux ;;
388 +      arm*-*-linux-uclibc*)            fmt=elf  em=linux ;;
389        arm*-*-uclinux*)                 fmt=elf  em=linux ;;
390        arm-*-netbsdelf*)                 fmt=elf  em=nbsd ;;
391        arm-*-*n*bsd*)                   fmt=aout em=nbsd ;;
392 @@ -224,6 +226,7 @@
393        avr-*-*)                         fmt=elf ;;
394  
395        cris-*-linux-gnu*)               fmt=multi bfd_gas=yes em=linux ;;
396 +      cris-*-linux-uclibc*)            fmt=multi bfd_gas=yes em=linux ;;
397        cris-*-*)                                fmt=multi bfd_gas=yes ;;
398  
399        crx-*-elf*)                      fmt=elf ;;
400 @@ -283,7 +286,9 @@
401        i386-*-linux*oldld)              fmt=aout em=linux ;;
402        i386-*-linux*coff*)              fmt=coff em=linux ;;
403        i386-*-linux-gnu*)               fmt=elf em=linux ;;
404 +      i386-*-linux-uclibc*)            fmt=elf em=linux ;;
405        x86_64-*-linux-gnu*)             fmt=elf em=linux ;;
406 +      x86_64-*-linux-uclibc*)          fmt=elf em=linux ;;
407        i386-*-lynxos*)                  fmt=elf em=lynx bfd_gas=yes ;;
408  changequote(,)dnl
409        i386-*-sysv[45]*)                        fmt=elf ;;
410 @@ -336,6 +341,7 @@
411        ia64-*-elf*)                     fmt=elf ;;
412        ia64-*-aix*)                     fmt=elf em=ia64aix ;;
413        ia64-*-linux-gnu*)               fmt=elf em=linux ;;
414 +      ia64-*-linux-uclibc*)            fmt=elf em=linux ;;
415        ia64-*-hpux*)                    fmt=elf em=hpux ;;
416        ia64-*-netbsd*)                  fmt=elf em=nbsd ;;
417  
418 @@ -363,6 +369,7 @@
419        m68k-*-hpux*)                    fmt=hp300 em=hp300 ;;
420        m68k-*-linux*aout*)              fmt=aout em=linux ;;
421        m68k-*-linux-gnu*)               fmt=elf em=linux ;;
422 +      m68k-*-linux-uclibc*)            fmt=elf em=linux ;;
423        m68k-*-uclinux*)                 fmt=elf ;;
424        m68k-*-gnu*)                     fmt=elf ;;
425        m68k-*-lynxos*)                  fmt=coff em=lynx ;;
426 @@ -422,6 +429,7 @@
427        ppc-*-beos*)                     fmt=coff ;;
428        ppc-*-*n*bsd* | ppc-*-elf*)      fmt=elf ;;
429        ppc-*-eabi* | ppc-*-sysv4*)      fmt=elf ;;
430 +      ppc-*-linux-uclibc* | \
431        ppc-*-linux-gnu*)                        fmt=elf em=linux
432             case "$endian" in
433                 big)  ;;
434 @@ -442,7 +450,9 @@
435        ppc-*-lynxos*)                   fmt=elf em=lynx bfd_gas=yes ;;
436  
437        s390x-*-linux-gnu*)              fmt=elf em=linux ;;
438 +      s390x-*-linux-uclibc*)           fmt=elf em=linux ;;
439        s390-*-linux-gnu*)               fmt=elf em=linux ;;
440 +      s390-*-linux-uclibc*)            fmt=elf em=linux ;;
441  
442        sh*-*-linux*)                    fmt=elf em=linux
443             case ${cpu} in
444 @@ -478,6 +488,7 @@
445        sparc-*-coff)                    fmt=coff ;;
446        sparc-*-linux*aout*)             fmt=aout em=linux ;;
447        sparc-*-linux-gnu*)              fmt=elf em=linux ;;
448 +      sparc-*-linux-uclibc*)           fmt=elf em=linux ;;
449        sparc-*-lynxos*)                 fmt=coff em=lynx ;;
450        sparc-fujitsu-none)              fmt=aout ;;
451        sparc-*-elf)                     fmt=elf ;;
452 diff -urN binutils-2.15.91.0.2-dist/gprof/configure binutils-2.15.91.0.2/gprof/configure
453 --- binutils-2.15.91.0.2-dist/gprof/configure   2004-07-27 23:36:10.000000000 -0500
454 +++ binutils-2.15.91.0.2/gprof/configure        2004-09-28 14:33:13.000000000 -0500
455 @@ -3401,6 +3401,11 @@
456    lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
457    ;;
458  
459 +linux-uclibc*)
460 +  lt_cv_deplibs_check_method=pass_all
461 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
462 +  ;;
463 +
464  netbsd*)
465    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
466      lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
467 diff -urN binutils-2.15.91.0.2-dist/ld/configure binutils-2.15.91.0.2/ld/configure
468 --- binutils-2.15.91.0.2-dist/ld/configure      2004-07-27 23:36:11.000000000 -0500
469 +++ binutils-2.15.91.0.2/ld/configure   2004-09-28 14:33:13.000000000 -0500
470 @@ -1578,6 +1578,11 @@
471    lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
472    ;;
473  
474 +linux-uclibc*)
475 +  lt_cv_deplibs_check_method=pass_all
476 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
477 +  ;;
478 +
479  netbsd*)
480    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
481      lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
482 diff -urN binutils-2.15.91.0.2-dist/ld/configure.tgt binutils-2.15.91.0.2/ld/configure.tgt
483 --- binutils-2.15.91.0.2-dist/ld/configure.tgt  2004-07-27 23:36:11.000000000 -0500
484 +++ binutils-2.15.91.0.2/ld/configure.tgt       2004-09-28 14:33:13.000000000 -0500
485 @@ -31,6 +31,7 @@
486                         targ_extra_emuls="criself crislinux"
487                         targ_extra_libpath=$targ_extra_emuls ;;
488  cris-*-linux-gnu*)     targ_emul=crislinux ;;
489 +cris-*-linux-uclibc*)  targ_emul=crislinux ;;
490  cris-*-*)              targ_emul=criself
491                         targ_extra_emuls="crisaout crislinux"
492                         targ_extra_libpath=$targ_extra_emuls ;;
493 @@ -61,14 +62,16 @@
494                         tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
495                         tdir_sun4=sparc-sun-sunos4
496                         ;;
497 -sparc64-*-linux-gnu*)  targ_emul=elf64_sparc
498 +sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)         \
499 +                       targ_emul=elf64_sparc
500                         targ_extra_emuls="elf32_sparc sparclinux sun4"
501                         targ_extra_libpath=elf32_sparc
502                         tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
503                         tdir_sparclinux=${tdir_elf32_sparc}aout
504                         tdir_sun4=sparc-sun-sunos4
505                         ;;
506 -sparc*-*-linux-gnu*)   targ_emul=elf32_sparc
507 +sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
508 +                       targ_emul=elf32_sparc
509                         targ_extra_emuls="sparclinux elf64_sparc sun4"
510                         targ_extra_libpath=elf64_sparc
511                         tdir_sparclinux=${targ_alias}aout
512 @@ -120,7 +123,9 @@
513  m32r*le-*-elf*)         targ_emul=m32rlelf ;;
514  m32r*-*-elf*)           targ_emul=m32relf ;;
515  m32r*le-*-linux-gnu*)   targ_emul=m32rlelf_linux ;;
516 +m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
517  m32r*-*-linux-gnu*)     targ_emul=m32relf_linux ;;
518 +m32r*-*-linux-uclibc*)  targ_emul=m32relf_linux ;;
519  m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf 
520                         targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
521  m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf 
522 @@ -130,7 +135,7 @@
523  m68*-ericsson-ose)     targ_emul=sun3 ;;
524  m68*-apple-aux*)       targ_emul=m68kaux ;;
525  *-tandem-none)         targ_emul=st2000 ;;
526 -i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
527 +i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
528  i[3-7]86-*-nto-qnx*)   targ_emul=i386nto ;;
529  i[3-7]86-*-vsta)       targ_emul=vsta ;;
530  i[3-7]86-go32-rtems*)  targ_emul=i386go32 ;;
531 @@ -154,14 +159,16 @@
532                         tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
533                         ;;
534  i[3-7]86-*-linux*oldld)        targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
535 -i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
536 +i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
537 +                       targ_emul=elf_i386
538                         targ_extra_emuls=i386linux
539                         if test x${want64} = xtrue; then
540                           targ_extra_emuls="$targ_extra_emuls elf_x86_64"
541                         fi
542                         tdir_i386linux=${targ_alias}aout
543                         ;;
544 -x86_64-*-linux-gnu*)   targ_emul=elf_x86_64
545 +x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
546 +                       targ_emul=elf_x86_64
547                         targ_extra_emuls="elf_i386 i386linux"
548                         targ_extra_libpath=elf_i386
549                         tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
550 @@ -261,10 +268,13 @@
551  arm9e-*-elf)           targ_emul=armelf ;;
552  arm-*-oabi)            targ_emul=armelf_oabi ;;
553  arm*b-*-linux-gnu*)    targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
554 +arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
555  arm*-*-linux-gnu*)     targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
556 +arm*-*-linux-uclibc*)  targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
557  arm*-*-uclinux*)       targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
558  arm*-*-conix*)         targ_emul=armelf ;;
559 -thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
560 +thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) \
561 +                       targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
562  strongarm-*-coff)      targ_emul=armcoff ;;
563  strongarm-*-elf)       targ_emul=armelf ;;
564  strongarm-*-kaos*)     targ_emul=armelf ;;
565 @@ -369,7 +379,8 @@
566                         targ_extra_emuls=m68kelf
567                         tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
568                         ;;
569 -m68k-*-linux-gnu*)     targ_emul=m68kelf
570 +m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
571 +                       targ_emul=m68kelf
572                         targ_extra_emuls=m68klinux
573                         tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
574                         ;;
575 @@ -386,9 +397,9 @@
576  m68*-*-psos*)          targ_emul=m68kpsos ;;
577  m68*-*-rtemscoff*)     targ_emul=m68kcoff ;;
578  m68*-*-rtems*)         targ_emul=m68kelf ;;
579 -hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
580 +hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)  targ_emul=hppa64linux ;;
581  hppa*64*-*)            targ_emul=elf64hppa ;;
582 -hppa*-*-linux-gnu*)    targ_emul=hppalinux ;;
583 +hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)    targ_emul=hppalinux ;;
584  hppa*-*-*elf*)         targ_emul=hppaelf ;;
585  hppa*-*-lites*)                targ_emul=hppaelf ;;
586  hppa*-*-netbsd*)       targ_emul=hppanbsd ;;
587 @@ -401,6 +412,7 @@
588                         targ_emul=vaxnbsd
589                         targ_extra_emuls=elf32vax ;;
590  vax-*-linux-gnu*)      targ_emul=elf32vax ;;
591 +vax-*-linux-uclibc*)   targ_emul=elf32vax ;;
592  mips*-*-pe)            targ_emul=mipspe ;
593                         targ_extra_ofiles="deffilep.o pe-dll.o" ;;
594  mips*-dec-ultrix*)     targ_emul=mipslit ;;
595 @@ -434,16 +446,16 @@
596  mips*-*-vxworks*)      targ_emul=elf32ebmip
597                         targ_extra_emuls="elf32elmip" ;;
598  mips*-*-windiss)       targ_emul=elf32mipswindiss ;;
599 -mips64*el-*-linux-gnu*)        targ_emul=elf32ltsmipn32
600 +mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)    targ_emul=elf32ltsmipn32
601                         targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
602                         ;;
603 -mips64*-*-linux-gnu*)  targ_emul=elf32btsmipn32
604 +mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)        targ_emul=elf32btsmipn32
605                         targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
606                         ;;
607 -mips*el-*-linux-gnu*)  targ_emul=elf32ltsmip
608 +mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)        targ_emul=elf32ltsmip
609                         targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
610                         ;;
611 -mips*-*-linux-gnu*)    targ_emul=elf32btsmip
612 +mips*-*-linux-gnu* | mips*-*-linux-uclibc*)    targ_emul=elf32btsmip
613                         targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
614                         ;;
615  mips*-*-lnews*)                targ_emul=mipslnews ;;
616 @@ -466,6 +478,10 @@
617  alpha*-*-linux-gnu*)   targ_emul=elf64alpha targ_extra_emuls=alpha
618                         tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
619                         ;;
620 +alpha*-*-linux-uclibc*)        targ_emul=elf64alpha targ_extra_emuls=alpha
621 +                       # The following needs to be checked...
622 +                       tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
623 +                       ;;
624  alpha*-*-osf*)         targ_emul=alpha ;;
625  alpha*-*-gnu*)         targ_emul=elf64alpha ;;
626  alpha*-*-netware*)     targ_emul=alpha ;;
627 diff -urN binutils-2.15.91.0.2-dist/ld/emultempl/elf32.em binutils-2.15.91.0.2/ld/emultempl/elf32.em
628 --- binutils-2.15.91.0.2-dist/ld/emultempl/elf32.em     2004-07-27 23:36:11.000000000 -0500
629 +++ binutils-2.15.91.0.2/ld/emultempl/elf32.em  2004-09-28 14:33:54.000000000 -0500
630 @@ -327,7 +327,7 @@
631  
632  EOF
633  case ${target} in
634 -  *-*-linux-gnu*)
635 +  *-*-linux-gnu* | *-*-linux-uclibc*)
636      cat >>e${EMULATION_NAME}.c <<EOF
637           {
638             struct bfd_link_needed_list *l;
639 @@ -500,7 +500,7 @@
640  
641  EOF
642    case ${target} in
643 -    *-*-linux-gnu*)
644 +    *-*-linux-gnu* | *-*-linux-uclibc*)
645        cat >>e${EMULATION_NAME}.c <<EOF
646  /* For a native linker, check the file /etc/ld.so.conf for directories
647     in which we may find shared libraries.  /etc/ld.so.conf is really
648 @@ -784,7 +784,7 @@
649  EOF
650  if [ "x${USE_LIBPATH}" = xyes ] ; then
651    case ${target} in
652 -    *-*-linux-gnu*)
653 +    *-*-linux-gnu* | *-*-linux-uclibc*)
654        cat >>e${EMULATION_NAME}.c <<EOF
655           if (gld${EMULATION_NAME}_check_ld_so_conf (l->name, force))
656             break;
657 diff -urN binutils-2.15.91.0.2-dist/libtool.m4 binutils-2.15.91.0.2/libtool.m4
658 --- binutils-2.15.91.0.2-dist/libtool.m4        2004-07-27 23:36:06.000000000 -0500
659 +++ binutils-2.15.91.0.2/libtool.m4     2004-09-28 14:33:13.000000000 -0500
660 @@ -645,6 +645,11 @@
661    lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
662    ;;
663  
664 +linux-uclibc*)
665 +  lt_cv_deplibs_check_method=pass_all
666 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
667 +  ;;
668 +
669  netbsd* | knetbsd*-gnu)
670    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
671      [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
672 diff -urN binutils-2.15.91.0.2-dist/ltconfig binutils-2.15.91.0.2/ltconfig
673 --- binutils-2.15.91.0.2-dist/ltconfig  2004-07-27 23:36:06.000000000 -0500
674 +++ binutils-2.15.91.0.2/ltconfig       2004-09-28 14:33:13.000000000 -0500
675 @@ -603,6 +603,7 @@
676  # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
677  case $host_os in
678  linux-gnu*) ;;
679 +linux-uclibc*) ;;
680  linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
681  esac
682  
683 @@ -1270,6 +1271,24 @@
684    dynamic_linker='GNU/Linux ld.so'
685    ;;
686  
687 +linux-uclibc*)
688 +  version_type=linux
689 +  need_lib_prefix=no
690 +  need_version=no
691 +  library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
692 +  soname_spec='${libname}${release}.so$major'
693 +  finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
694 +  shlibpath_var=LD_LIBRARY_PATH
695 +  shlibpath_overrides_runpath=no
696 +  # This implies no fast_install, which is unacceptable.
697 +  # Some rework will be needed to allow for fast_install
698 +  # before this can be enabled.
699 +  # Note: copied from linux-gnu, and may not be appropriate.
700 +  hardcode_into_libs=yes
701 +  # Assume using the uClibc dynamic linker.
702 +  dynamic_linker="uClibc ld.so"
703 +  ;;
704 +
705  netbsd*)
706    need_lib_prefix=no
707    need_version=no
708 diff -urN binutils-2.15.91.0.2-dist/opcodes/configure binutils-2.15.91.0.2/opcodes/configure
709 --- binutils-2.15.91.0.2-dist/opcodes/configure 2004-07-27 23:36:11.000000000 -0500
710 +++ binutils-2.15.91.0.2/opcodes/configure      2004-09-28 14:33:13.000000000 -0500
711 @@ -1690,6 +1690,11 @@
712    lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
713    ;;
714  
715 +linux-uclibc*)
716 +  lt_cv_deplibs_check_method=pass_all
717 +  lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
718 +  ;;
719 +
720  netbsd*)
721    if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
722      lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'