summaryrefslogtreecommitdiffstats
path: root/meta/packages/binutils
diff options
context:
space:
mode:
authorRichard Purdie <richard@openedhand.com>2006-07-21 10:10:31 +0000
committerRichard Purdie <richard@openedhand.com>2006-07-21 10:10:31 +0000
commitb2f192faabe412adce79534e22efe9fb69ee40e2 (patch)
tree7076c49d4286f8a1733650bd8fbc7161af200d57 /meta/packages/binutils
parent2cf0eadf9f730027833af802d7e6c90b44248f80 (diff)
downloadpoky-b2f192faabe412adce79534e22efe9fb69ee40e2.tar.gz
Rename /openembedded/ -> /meta/
git-svn-id: https://svn.o-hand.com/repos/poky/trunk@530 311d38ba-8fff-0310-9ca6-ca027cbcb966
Diffstat (limited to 'meta/packages/binutils')
-rw-r--r--meta/packages/binutils/binutils-2.15.94.0.1/binutils-100_cflags_for_build.patch91
-rw-r--r--meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.90.0.3-uclibc-200-build_modules.patch33
-rw-r--r--meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.90.0.3-uclibc-210-cflags.patch30
-rw-r--r--meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.91.0.1-uclibc-100-conf.patch604
-rw-r--r--meta/packages/binutils/binutils-2.16.91.0.7/binutils-2.16.91.0.6-objcopy-rename-errorcode.patch31
-rw-r--r--meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-100-uclibc-conf.patch139
-rw-r--r--meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-001_ld_makefile_patch.patch50
-rw-r--r--meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-006_better_file_error.patch43
-rw-r--r--meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-012_check_ldrunpath_length.patch47
-rw-r--r--meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-400-mips-ELF_MAXPAGESIZE-4K.patch26
-rw-r--r--meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-702-binutils-skip-comments.patch93
-rw-r--r--meta/packages/binutils/binutils-2.16/binutils-100_cflags_for_build.patch28
-rw-r--r--meta/packages/binutils/binutils-2.16/binutils-2.16-linux-uclibc.patch700
-rw-r--r--meta/packages/binutils/binutils-2.16/binutils-2.16-objcopy-rename-errorcode.patch29
-rw-r--r--meta/packages/binutils/binutils-2.16/binutils-2.16-thumb-glue.patch76
-rw-r--r--meta/packages/binutils/binutils-2.16/binutils-2.16-thumb-trampoline.patch292
-rw-r--r--meta/packages/binutils/binutils-cross.inc30
-rw-r--r--meta/packages/binutils/binutils-cross_2.15.94.0.1.bb32
-rw-r--r--meta/packages/binutils/binutils-cross_2.16.91.0.7.bb32
-rw-r--r--meta/packages/binutils/binutils-cross_2.16.bb3
-rw-r--r--meta/packages/binutils/binutils.inc117
-rw-r--r--meta/packages/binutils/binutils_2.15.94.0.1.bb124
-rw-r--r--meta/packages/binutils/binutils_2.16.91.0.7.bb123
-rw-r--r--meta/packages/binutils/binutils_2.16.bb26
-rw-r--r--meta/packages/binutils/files/better_file_error.patch17
-rw-r--r--meta/packages/binutils/files/ld_makefile.patch22
-rw-r--r--meta/packages/binutils/files/objdump_fix.patch134
-rw-r--r--meta/packages/binutils/files/plt32trunc.patch24
-rw-r--r--meta/packages/binutils/files/signed_char_fix.patch12
29 files changed, 3008 insertions, 0 deletions
diff --git a/meta/packages/binutils/binutils-2.15.94.0.1/binutils-100_cflags_for_build.patch b/meta/packages/binutils/binutils-2.15.94.0.1/binutils-100_cflags_for_build.patch
new file mode 100644
index 0000000000..468808bf59
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.15.94.0.1/binutils-100_cflags_for_build.patch
@@ -0,0 +1,91 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- src/bfd/doc/Makefile.am~binutils-100_cflags_for_build.patch
7+++ src/bfd/doc/Makefile.am
8@@ -55,10 +55,10 @@
9 MKDOC = chew$(EXEEXT_FOR_BUILD)
10
11 $(MKDOC): chew.o
12- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
13+ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS_FOR_BUILD)
14
15 chew.o: chew.c
16- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
17+ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
18
19 protos: libbfd.h libcoff.h bfd.h
20
21--- src/binutils/Makefile.am~binutils-100_cflags_for_build.patch
22+++ src/binutils/Makefile.am
23@@ -219,20 +219,20 @@
24 ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
25
26 sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
27- $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
28+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
29
30 syslex.o: syslex.c sysinfo.h
31 if [ -r syslex.c ]; then \
32- $(CC_FOR_BUILD) -c -I. $(CFLAGS) syslex.c ; \
33+ $(CC_FOR_BUILD) -c -I. $(CFLAGS_FOR_BUILD) syslex.c ; \
34 else \
35- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(CFLAGS) $(srcdir)/syslex.c ;\
36+ $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c ;\
37 fi
38
39 sysinfo.o: sysinfo.c
40 if [ -r sysinfo.c ]; then \
41- $(CC_FOR_BUILD) -c -I. $(CFLAGS) sysinfo.c ; \
42+ $(CC_FOR_BUILD) -c -I. $(CFLAGS_FOR_BUILD) sysinfo.c ; \
43 else \
44- $(CC_FOR_BUILD) -c -I. $(CFLAGS) $(srcdir)/sysinfo.c ; \
45+ $(CC_FOR_BUILD) -c -I. $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c ; \
46 fi
47
48 # We need these for parallel make.
49--- src/bfd/doc/Makefile.in~binutils-100_cflags_for_build.patch
50+++ src/bfd/doc/Makefile.in
51@@ -470,10 +470,10 @@
52
53
54 $(MKDOC): chew.o
55- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
56+ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS_FOR_BUILD)
57
58 chew.o: chew.c
59- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
60+ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
61
62 protos: libbfd.h libcoff.h bfd.h
63
64--- src/binutils/Makefile.in~binutils-100_cflags_for_build.patch
65+++ src/binutils/Makefile.in
66@@ -978,20 +978,20 @@
67 ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
68
69 sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
70- $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
71+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
72
73 syslex.o: syslex.c sysinfo.h
74 if [ -r syslex.c ]; then \
75- $(CC_FOR_BUILD) -c -I. $(CFLAGS) syslex.c ; \
76+ $(CC_FOR_BUILD) -c -I. $(CFLAGS_FOR_BUILD) syslex.c ; \
77 else \
78- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(CFLAGS) $(srcdir)/syslex.c ;\
79+ $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c ;\
80 fi
81
82 sysinfo.o: sysinfo.c
83 if [ -r sysinfo.c ]; then \
84- $(CC_FOR_BUILD) -c -I. $(CFLAGS) sysinfo.c ; \
85+ $(CC_FOR_BUILD) -c -I. $(CFLAGS_FOR_BUILD) sysinfo.c ; \
86 else \
87- $(CC_FOR_BUILD) -c -I. $(CFLAGS) $(srcdir)/sysinfo.c ; \
88+ $(CC_FOR_BUILD) -c -I. $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c ; \
89 fi
90
91 # We need these for parallel make.
diff --git a/meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.90.0.3-uclibc-200-build_modules.patch b/meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.90.0.3-uclibc-200-build_modules.patch
new file mode 100644
index 0000000000..3560d2ca36
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.90.0.3-uclibc-200-build_modules.patch
@@ -0,0 +1,33 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- src/configure~binutils-2.15.90.0.3-uclibc-200-build_modules.patch
7+++ src/configure
8@@ -940,6 +940,11 @@
9 build_configdirs=`echo ${build_libs} ${build_tools}`
10 fi
11
12+case "$target" in
13+ *-*-*-uclibc*)
14+ build_modules=
15+ ;;
16+esac
17 ################################################################################
18
19 srcname="gnu development package"
20--- src/configure.in~binutils-2.15.90.0.3-uclibc-200-build_modules.patch
21+++ src/configure.in
22@@ -189,6 +189,11 @@
23 build_configdirs=`echo ${build_libs} ${build_tools}`
24 fi
25
26+case "$target" in
27+ *-*-*-uclibc*)
28+ build_modules=
29+ ;;
30+esac
31 ################################################################################
32
33 srcname="gnu development package"
diff --git a/meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.90.0.3-uclibc-210-cflags.patch b/meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.90.0.3-uclibc-210-cflags.patch
new file mode 100644
index 0000000000..40a71c602a
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.90.0.3-uclibc-210-cflags.patch
@@ -0,0 +1,30 @@
1--- binutils-2.15.90.0.3/bfd/doc/Makefile.am.cflags 2004-01-14 16:07:44.000000000 -0500
2+++ binutils-2.15.90.0.3/bfd/doc/Makefile.am 2004-04-22 22:06:35.000000000 -0400
3@@ -55,10 +55,10 @@
4 MKDOC = chew$(EXEEXT_FOR_BUILD)
5
6 $(MKDOC): chew.o
7- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
8+ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
9
10 chew.o: chew.c
11- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
12+ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
13
14 protos: libbfd.h libcoff.h bfd.h
15
16--- binutils-2.15.90.0.3/bfd/doc/Makefile.in.cflags 2004-04-12 15:56:34.000000000 -0400
17+++ binutils-2.15.90.0.3/bfd/doc/Makefile.in 2004-04-22 22:06:35.000000000 -0400
18@@ -472,10 +472,10 @@
19
20
21 $(MKDOC): chew.o
22- $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS) $(LOADLIBES) $(LDFLAGS)
23+ $(CC_FOR_BUILD) -o $(MKDOC) chew.o $(CFLAGS_FOR_BUILD) $(LOADLIBES) $(LDFLAGS)
24
25 chew.o: chew.c
26- $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS) $(srcdir)/chew.c
27+ $(CC_FOR_BUILD) -c -I.. -I$(srcdir)/.. -I$(srcdir)/../../include -I$(srcdir)/../../intl -I../../intl $(H_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/chew.c
28
29 protos: libbfd.h libcoff.h bfd.h
30
diff --git a/meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.91.0.1-uclibc-100-conf.patch b/meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.91.0.1-uclibc-100-conf.patch
new file mode 100644
index 0000000000..d650cdbc91
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.15.94.0.1/binutils-2.15.91.0.1-uclibc-100-conf.patch
@@ -0,0 +1,604 @@
1
2#
3# Patch managed by http://www.holgerschurig.de/patcher.html
4#
5
6--- binutils-2.15.94.0.1/bfd/config.bfd~binutils-2.15.91.0.1-uclibc-100-conf
7+++ binutils-2.15.94.0.1/bfd/config.bfd
8@@ -140,7 +140,7 @@
9 targ_defvec=ecoffalpha_little_vec
10 targ_selvecs=bfd_elf64_alpha_vec
11 ;;
12- alpha*-*-linux-gnu* | alpha*-*-elf*)
13+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
14 targ_defvec=bfd_elf64_alpha_vec
15 targ_selvecs=ecoffalpha_little_vec
16 ;;
17@@ -150,7 +150,7 @@
18 alpha*-*-*)
19 targ_defvec=ecoffalpha_little_vec
20 ;;
21- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
22+ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-linux-uclibc* | ia64*-*-kfreebsd*-gnu)
23 targ_defvec=bfd_elf64_ia64_little_vec
24 targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
25 ;;
26@@ -227,7 +227,7 @@
27 targ_defvec=bfd_elf32_littlearm_vec
28 targ_selvecs=bfd_elf32_bigarm_vec
29 ;;
30- armeb-*-elf | arm*b-*-linux-gnu*)
31+ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
32 targ_defvec=bfd_elf32_bigarm_vec
33 targ_selvecs=bfd_elf32_littlearm_vec
34 ;;
35@@ -237,7 +237,7 @@
36 ;;
37 arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
38 arm*-*-uclinux* | arm-*-kfreebsd*-gnu | arm-*-vxworks | \
39- arm*-*-eabi* )
40+ arm*-*-eabi* | arm*-*-linux-uclibc* )
41 targ_defvec=bfd_elf32_littlearm_vec
42 targ_selvecs=bfd_elf32_bigarm_vec
43 ;;
44@@ -381,7 +381,7 @@
45 ;;
46
47 #ifdef BFD64
48- hppa*64*-*-linux-gnu*)
49+ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
50 targ_defvec=bfd_elf64_hppa_linux_vec
51 targ_selvecs=bfd_elf64_hppa_vec
52 ;;
53@@ -392,7 +392,7 @@
54 ;;
55 #endif
56
57- hppa*-*-linux-gnu*)
58+ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)
59 targ_defvec=bfd_elf32_hppa_linux_vec
60 targ_selvecs=bfd_elf32_hppa_vec
61 ;;
62@@ -525,7 +525,7 @@
63 targ_selvecs=bfd_elf32_i386_vec
64 targ_underscore=yes
65 ;;
66- i[3-7]86-*-linux-gnu*)
67+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
68 targ_defvec=bfd_elf32_i386_vec
69 targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
70 targ64_selvecs=bfd_elf64_x86_64_vec
71@@ -539,7 +539,7 @@
72 targ_defvec=bfd_elf64_x86_64_vec
73 targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
74 ;;
75- x86_64-*-linux-gnu*)
76+ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
77 targ_defvec=bfd_elf64_x86_64_vec
78 targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
79 ;;
80@@ -715,7 +715,7 @@
81 targ_selvecs=bfd_elf32_m68k_vec
82 targ_underscore=yes
83 ;;
84- m68*-*-linux-gnu*)
85+ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
86 targ_defvec=bfd_elf32_m68k_vec
87 targ_selvecs=m68klinux_vec
88 ;;
89@@ -1001,7 +1001,8 @@
90 ;;
91 #endif
92 powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
93- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
94+ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | \
95+ powerpc-*-rtems* | \
96 powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
97 targ_defvec=bfd_elf32_powerpc_vec
98 targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
99@@ -1038,8 +1039,8 @@
100 targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
101 ;;
102 powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
103- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
104- powerpcle-*-rtems*)
105+ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* |\
106+ powerpcle-*-vxworks* | powerpcle-*-rtems*)
107 targ_defvec=bfd_elf32_powerpcle_vec
108 targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
109 targ64_selvecs="bfd_elf64_powerpc_vec bfd_elf64_powerpcle_vec"
110@@ -1206,7 +1207,7 @@
111 targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
112 targ_underscore=yes
113 ;;
114- sparc-*-linux-gnu*)
115+ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
116 targ_defvec=bfd_elf32_sparc_vec
117 targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
118 ;;
119@@ -1253,7 +1254,7 @@
120 targ_defvec=sunos_big_vec
121 targ_underscore=yes
122 ;;
123- sparc64-*-linux-gnu*)
124+ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
125 targ_defvec=bfd_elf64_sparc_vec
126 targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
127 ;;
128--- binutils-2.15.94.0.1/bfd/configure~binutils-2.15.91.0.1-uclibc-100-conf
129+++ binutils-2.15.94.0.1/bfd/configure
130@@ -3583,6 +3583,11 @@
131 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
132 ;;
133
134+linux-uclibc*)
135+ lt_cv_deplibs_check_method=pass_all
136+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
137+ ;;
138+
139 netbsd* | knetbsd*-gnu)
140 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
141 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
142@@ -9914,7 +9919,7 @@
143 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
144 COREFILE=''
145 ;;
146- alpha*-*-linux-gnu*)
147+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
148 COREFILE=trad-core.lo
149 TRAD_HEADER='"hosts/alphalinux.h"'
150 ;;
151@@ -9978,7 +9983,7 @@
152 COREFILE=trad-core.lo
153 TRAD_HEADER='"hosts/i386mach3.h"'
154 ;;
155- i[3-7]86-*-linux-gnu*)
156+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
157 COREFILE=trad-core.lo
158 TRAD_HEADER='"hosts/i386linux.h"'
159 ;;
160@@ -10016,7 +10021,7 @@
161 COREFILE=trad-core.lo
162 TRAD_HEADER='"hosts/hp300bsd.h"'
163 ;;
164- m68*-*-linux-gnu*)
165+ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
166 COREFILE=trad-core.lo
167 TRAD_HEADER='"hosts/m68klinux.h"'
168 ;;
169--- binutils-2.15.94.0.1/bfd/configure.in~binutils-2.15.91.0.1-uclibc-100-conf
170+++ binutils-2.15.94.0.1/bfd/configure.in
171@@ -163,7 +163,7 @@
172 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
173 COREFILE=''
174 ;;
175- alpha*-*-linux-gnu*)
176+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
177 COREFILE=trad-core.lo
178 TRAD_HEADER='"hosts/alphalinux.h"'
179 ;;
180@@ -248,7 +248,7 @@
181 TRAD_HEADER='"hosts/i386mach3.h"'
182 ;;
183 changequote(,)dnl
184- i[3-7]86-*-linux-gnu*)
185+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
186 changequote([,])dnl
187 COREFILE=trad-core.lo
188 TRAD_HEADER='"hosts/i386linux.h"'
189@@ -289,7 +289,7 @@
190 COREFILE=trad-core.lo
191 TRAD_HEADER='"hosts/hp300bsd.h"'
192 ;;
193- m68*-*-linux-gnu*)
194+ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
195 COREFILE=trad-core.lo
196 TRAD_HEADER='"hosts/m68klinux.h"'
197 ;;
198--- binutils-2.15.94.0.1/gas/configure~binutils-2.15.91.0.1-uclibc-100-conf
199+++ binutils-2.15.94.0.1/gas/configure
200@@ -3420,6 +3420,11 @@
201 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
202 ;;
203
204+linux-uclibc*)
205+ lt_cv_deplibs_check_method=pass_all
206+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
207+ ;;
208+
209 netbsd* | knetbsd*-gnu)
210 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
211 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
212@@ -4256,6 +4261,7 @@
213 alpha*-*-osf*) fmt=ecoff ;;
214 alpha*-*-linuxecoff*) fmt=ecoff ;;
215 alpha*-*-linux-gnu*) fmt=elf em=linux ;;
216+ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
217 alpha*-*-netbsd*) fmt=elf em=nbsd ;;
218 alpha*-*-openbsd*) fmt=elf em=obsd ;;
219
220@@ -4271,6 +4277,7 @@
221 arm*-*-conix*) fmt=elf ;;
222 arm-*-linux*aout*) fmt=aout em=linux ;;
223 arm*-*-linux-gnu*) fmt=elf em=linux ;;
224+ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
225 arm*-*-uclinux*) fmt=elf em=linux ;;
226 arm-*-netbsdelf*) fmt=elf em=nbsd ;;
227 arm-*-*n*bsd*) fmt=aout em=nbsd ;;
228@@ -4284,6 +4291,7 @@
229
230 cris-*-linux-gnu* | crisv32-*-linux-gnu*)
231 fmt=multi bfd_gas=yes em=linux ;;
232+ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
233 cris-*-* | crisv32-*-*) fmt=multi bfd_gas=yes ;;
234
235 crx-*-elf*) fmt=elf ;;
236@@ -4343,7 +4351,9 @@
237 i386-*-linux*oldld) fmt=aout em=linux ;;
238 i386-*-linux*coff*) fmt=coff em=linux ;;
239 i386-*-linux-gnu*) fmt=elf em=linux ;;
240+ i386-*-linux-uclibc*) fmt=elf em=linux ;;
241 x86_64-*-linux-gnu*) fmt=elf em=linux ;;
242+ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
243 i386-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
244 i386-*-sysv[45]*) fmt=elf ;;
245 i386-*-solaris*) fmt=elf ;;
246@@ -4403,6 +4413,7 @@
247 ia64-*-elf*) fmt=elf ;;
248 ia64-*-aix*) fmt=elf em=ia64aix ;;
249 ia64-*-linux-gnu*) fmt=elf em=linux ;;
250+ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
251 ia64-*-hpux*) fmt=elf em=hpux ;;
252 ia64-*-netbsd*) fmt=elf em=nbsd ;;
253
254@@ -4430,6 +4441,7 @@
255 m68k-*-hpux*) fmt=hp300 em=hp300 ;;
256 m68k-*-linux*aout*) fmt=aout em=linux ;;
257 m68k-*-linux-gnu*) fmt=elf em=linux ;;
258+ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
259 m68k-*-uclinux*) fmt=elf ;;
260 m68k-*-gnu*) fmt=elf ;;
261 m68k-*-lynxos*) fmt=coff em=lynx ;;
262@@ -4504,7 +4516,7 @@
263 ppc-*-beos*) fmt=coff ;;
264 ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
265 ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
266- ppc-*-linux-gnu*) fmt=elf em=linux
267+ ppc-*-linux-uclibc* | ppc-*-linux-gnu*) fmt=elf em=linux
268 case "$endian" in
269 big) ;;
270 *) { { echo "$as_me:$LINENO: error: GNU/Linux must be configured big endian" >&5
271@@ -4531,7 +4543,9 @@
272 ppc-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
273
274 s390x-*-linux-gnu*) fmt=elf em=linux ;;
275+ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
276 s390-*-linux-gnu*) fmt=elf em=linux ;;
277+ s390-*-linux-uclibc*) fmt=elf em=linux ;;
278
279 sh*-*-linux*) fmt=elf em=linux
280 case ${cpu} in
281@@ -4566,6 +4580,7 @@
282 sparc-*-coff) fmt=coff ;;
283 sparc-*-linux*aout*) fmt=aout em=linux ;;
284 sparc-*-linux-gnu*) fmt=elf em=linux ;;
285+ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
286 sparc-*-lynxos*) fmt=coff em=lynx ;;
287 sparc-fujitsu-none) fmt=aout ;;
288 sparc-*-elf) fmt=elf ;;
289--- binutils-2.15.94.0.1/gas/configure.in~binutils-2.15.91.0.1-uclibc-100-conf
290+++ binutils-2.15.94.0.1/gas/configure.in
291@@ -202,6 +202,7 @@
292 alpha*-*-osf*) fmt=ecoff ;;
293 alpha*-*-linuxecoff*) fmt=ecoff ;;
294 alpha*-*-linux-gnu*) fmt=elf em=linux ;;
295+ alpha*-*-linux-uclibc*) fmt=elf em=linux ;;
296 alpha*-*-netbsd*) fmt=elf em=nbsd ;;
297 alpha*-*-openbsd*) fmt=elf em=obsd ;;
298
299@@ -217,6 +218,7 @@
300 arm*-*-conix*) fmt=elf ;;
301 arm-*-linux*aout*) fmt=aout em=linux ;;
302 arm*-*-linux-gnu*) fmt=elf em=linux ;;
303+ arm*-*-linux-uclibc*) fmt=elf em=linux ;;
304 arm*-*-uclinux*) fmt=elf em=linux ;;
305 arm-*-netbsdelf*) fmt=elf em=nbsd ;;
306 arm-*-*n*bsd*) fmt=aout em=nbsd ;;
307@@ -230,6 +232,7 @@
308
309 cris-*-linux-gnu* | crisv32-*-linux-gnu*)
310 fmt=multi bfd_gas=yes em=linux ;;
311+ cris-*-linux-uclibc*) fmt=multi bfd_gas=yes em=linux ;;
312 cris-*-* | crisv32-*-*) fmt=multi bfd_gas=yes ;;
313
314 crx-*-elf*) fmt=elf ;;
315@@ -289,7 +292,9 @@
316 i386-*-linux*oldld) fmt=aout em=linux ;;
317 i386-*-linux*coff*) fmt=coff em=linux ;;
318 i386-*-linux-gnu*) fmt=elf em=linux ;;
319+ i386-*-linux-uclibc*) fmt=elf em=linux ;;
320 x86_64-*-linux-gnu*) fmt=elf em=linux ;;
321+ x86_64-*-linux-uclibc*) fmt=elf em=linux ;;
322 i386-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
323 changequote(,)dnl
324 i386-*-sysv[45]*) fmt=elf ;;
325@@ -342,6 +347,7 @@
326 ia64-*-elf*) fmt=elf ;;
327 ia64-*-aix*) fmt=elf em=ia64aix ;;
328 ia64-*-linux-gnu*) fmt=elf em=linux ;;
329+ ia64-*-linux-uclibc*) fmt=elf em=linux ;;
330 ia64-*-hpux*) fmt=elf em=hpux ;;
331 ia64-*-netbsd*) fmt=elf em=nbsd ;;
332
333@@ -369,6 +375,7 @@
334 m68k-*-hpux*) fmt=hp300 em=hp300 ;;
335 m68k-*-linux*aout*) fmt=aout em=linux ;;
336 m68k-*-linux-gnu*) fmt=elf em=linux ;;
337+ m68k-*-linux-uclibc*) fmt=elf em=linux ;;
338 m68k-*-uclinux*) fmt=elf ;;
339 m68k-*-gnu*) fmt=elf ;;
340 m68k-*-lynxos*) fmt=coff em=lynx ;;
341@@ -440,7 +447,7 @@
342 ppc-*-beos*) fmt=coff ;;
343 ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
344 ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
345- ppc-*-linux-gnu*) fmt=elf em=linux
346+ ppc-*-linux-uclibc* | ppc-*-linux-gnu*) fmt=elf em=linux
347 case "$endian" in
348 big) ;;
349 *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;;
350@@ -460,7 +467,9 @@
351 ppc-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
352
353 s390x-*-linux-gnu*) fmt=elf em=linux ;;
354+ s390x-*-linux-uclibc*) fmt=elf em=linux ;;
355 s390-*-linux-gnu*) fmt=elf em=linux ;;
356+ s390-*-linux-uclibc*) fmt=elf em=linux ;;
357
358 sh*-*-linux*) fmt=elf em=linux
359 case ${cpu} in
360@@ -491,6 +500,7 @@
361 sparc-*-coff) fmt=coff ;;
362 sparc-*-linux*aout*) fmt=aout em=linux ;;
363 sparc-*-linux-gnu*) fmt=elf em=linux ;;
364+ sparc-*-linux-uclibc*) fmt=elf em=linux ;;
365 sparc-*-lynxos*) fmt=coff em=lynx ;;
366 sparc-fujitsu-none) fmt=aout ;;
367 sparc-*-elf) fmt=elf ;;
368--- binutils-2.15.94.0.1/ld/configure~binutils-2.15.91.0.1-uclibc-100-conf
369+++ binutils-2.15.94.0.1/ld/configure
370@@ -1579,6 +1579,11 @@
371 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
372 ;;
373
374+linux-uclibc*)
375+ lt_cv_deplibs_check_method=pass_all
376+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
377+ ;;
378+
379 netbsd* | knetbsd*-gnu)
380 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
381 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
382--- binutils-2.15.94.0.1/ld/configure.tgt~binutils-2.15.91.0.1-uclibc-100-conf
383+++ binutils-2.15.94.0.1/ld/configure.tgt
384@@ -32,6 +32,7 @@
385 targ_extra_libpath=$targ_extra_emuls ;;
386 cris-*-linux-gnu* | cris-*-linux-gnu*)
387 targ_emul=crislinux ;;
388+cris-*-linux-uclibc*) targ_emul=crislinux ;;
389 cris-*-* | crisv32-*-*) targ_emul=criself
390 targ_extra_emuls="crisaout crislinux"
391 targ_extra_libpath=$targ_extra_emuls ;;
392@@ -62,14 +63,16 @@
393 tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
394 tdir_sun4=sparc-sun-sunos4
395 ;;
396-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
397+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) \
398+ targ_emul=elf64_sparc
399 targ_extra_emuls="elf32_sparc sparclinux sun4"
400 targ_extra_libpath=elf32_sparc
401 tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
402 tdir_sparclinux=${tdir_elf32_sparc}aout
403 tdir_sun4=sparc-sun-sunos4
404 ;;
405-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
406+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) \
407+ targ_emul=elf32_sparc
408 targ_extra_emuls="sparclinux elf64_sparc sun4"
409 targ_extra_libpath=elf64_sparc
410 tdir_sparclinux=${targ_alias}aout
411@@ -132,7 +135,7 @@
412 m68*-apple-aux*) targ_emul=m68kaux ;;
413 maxq-*-coff) targ_emul=maxqcoff;;
414 *-tandem-none) targ_emul=st2000 ;;
415-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
416+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
417 i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
418 i[3-7]86-*-vsta) targ_emul=vsta ;;
419 i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
420@@ -156,14 +159,16 @@
421 tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
422 ;;
423 i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
424-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
425+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) \
426+ targ_emul=elf_i386
427 targ_extra_emuls=i386linux
428 if test x${want64} = xtrue; then
429 targ_extra_emuls="$targ_extra_emuls elf_x86_64"
430 fi
431 tdir_i386linux=${targ_alias}aout
432 ;;
433-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
434+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) \
435+ targ_emul=elf_x86_64
436 targ_extra_emuls="elf_i386 i386linux"
437 targ_extra_libpath=elf_i386
438 tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
439@@ -263,11 +268,14 @@
440 arm-*-kaos*) targ_emul=armelf ;;
441 arm9e-*-elf) targ_emul=armelf ;;
442 arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
443+arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
444 arm*-*-linux-gnueabi) targ_emul=armelf_linux_eabi ;;
445 arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
446+arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
447 arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
448 arm*-*-conix*) targ_emul=armelf ;;
449-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
450+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*)
451+ targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
452 strongarm-*-coff) targ_emul=armcoff ;;
453 strongarm-*-elf) targ_emul=armelf ;;
454 strongarm-*-kaos*) targ_emul=armelf ;;
455@@ -371,7 +379,8 @@
456 targ_extra_emuls=m68kelf
457 tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
458 ;;
459-m68k-*-linux-gnu*) targ_emul=m68kelf
460+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) \
461+ targ_emul=m68kelf
462 targ_extra_emuls=m68klinux
463 tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
464 ;;
465@@ -388,9 +397,9 @@
466 m68*-*-psos*) targ_emul=m68kpsos ;;
467 m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
468 m68*-*-rtems*) targ_emul=m68kelf ;;
469-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
470+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
471 hppa*64*-*) targ_emul=elf64hppa ;;
472-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
473+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
474 hppa*-*-*elf*) targ_emul=hppaelf ;;
475 hppa*-*-lites*) targ_emul=hppaelf ;;
476 hppa*-*-netbsd*) targ_emul=hppanbsd ;;
477@@ -436,16 +445,20 @@
478 mips*-*-vxworks*) targ_emul=elf32ebmip
479 targ_extra_emuls="elf32elmip" ;;
480 mips*-*-windiss) targ_emul=elf32mipswindiss ;;
481-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
482+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*)
483+ targ_emul=elf32ltsmipn32
484 targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
485 ;;
486-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
487+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*)
488+ targ_emul=elf32btsmipn32
489 targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
490 ;;
491-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
492+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*)
493+ targ_emul=elf32ltsmip
494 targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
495 ;;
496-mips*-*-linux-gnu*) targ_emul=elf32btsmip
497+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)
498+ targ_emul=elf32btsmip
499 targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
500 ;;
501 mips*-*-lnews*) targ_emul=mipslnews ;;
502@@ -468,6 +481,10 @@
503 alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
504 tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
505 ;;
506+alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
507+ # The following needs to be checked...
508+ tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
509+ ;;
510 alpha*-*-osf*) targ_emul=alpha ;;
511 alpha*-*-gnu*) targ_emul=elf64alpha ;;
512 alpha*-*-netware*) targ_emul=alpha ;;
513--- binutils-2.15.94.0.1/configure~binutils-2.15.91.0.1-uclibc-100-conf
514+++ binutils-2.15.94.0.1/configure
515@@ -1341,6 +1341,18 @@
516 i[3456789]86-*-coff | i[3456789]86-*-elf)
517 noconfigdirs="$noconfigdirs ${libgcj}"
518 ;;
519+ i[3456789]86-*-linux-uclibc)
520+ # This section makes it possible to build newlib natively on linux.
521+ # If we are using a cross compiler then don't configure newlib.
522+ if test x${is_cross_compiler} != xno ; then
523+ noconfigdirs="$noconfigdirs target-newlib"
524+ fi
525+ noconfigdirs="$noconfigdirs target-libgloss"
526+ # If we are not using a cross compiler, do configure newlib.
527+ # Note however, that newlib will only be configured in this situation
528+ # if the --with-newlib option has been given, because otherwise
529+ # 'target-newlib' will appear in skipdirs.
530+ ;;
531 i[3456789]86-*-linux*)
532 # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
533 # not build java stuff by default.
534--- binutils-2.15.94.0.1/configure.in~binutils-2.15.91.0.1-uclibc-100-conf
535+++ binutils-2.15.94.0.1/configure.in
536@@ -563,6 +563,19 @@
537 i[[3456789]]86-*-coff | i[[3456789]]86-*-elf)
538 noconfigdirs="$noconfigdirs ${libgcj}"
539 ;;
540+ i[3456789]86-*-linux-uclibc)
541+ # This section makes it possible to build newlib natively on linux.
542+ # If we are using a cross compiler then don't configure newlib.
543+ if test x${is_cross_compiler} != xno ; then
544+ noconfigdirs="$noconfigdirs target-newlib"
545+ fi
546+ noconfigdirs="$noconfigdirs target-libgloss"
547+ build_modules=
548+ # If we are not using a cross compiler, do configure newlib.
549+ # Note however, that newlib will only be configured in this situation
550+ # if the --with-newlib option has been given, because otherwise
551+ # 'target-newlib' will appear in skipdirs.
552+ ;;
553 i[[3456789]]86-*-linux*)
554 # The GCC port for glibc1 has no MD_FALLBACK_FRAME_STATE_FOR, so let's
555 # not build java stuff by default.
556--- binutils-2.15.94.0.1/libtool.m4~binutils-2.15.91.0.1-uclibc-100-conf
557+++ binutils-2.15.94.0.1/libtool.m4
558@@ -645,6 +645,11 @@
559 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
560 ;;
561
562+linux-uclibc*)
563+ lt_cv_deplibs_check_method=pass_all
564+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
565+ ;;
566+
567 netbsd* | knetbsd*-gnu)
568 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
569 [lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$']
570--- binutils-2.15.94.0.1/ltconfig~binutils-2.15.91.0.1-uclibc-100-conf
571+++ binutils-2.15.94.0.1/ltconfig
572@@ -603,6 +603,7 @@
573 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
574 case $host_os in
575 linux-gnu*) ;;
576+linux-uclibc*) ;;
577 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
578 esac
579
580@@ -1270,6 +1271,24 @@
581 dynamic_linker='GNU/Linux ld.so'
582 ;;
583
584+linux-uclibc*)
585+ version_type=linux
586+ need_lib_prefix=no
587+ need_version=no
588+ library_names_spec='${libname}${release}.so$versuffix ${libname}${release}.so$major $libname.so'
589+ soname_spec='${libname}${release}.so$major'
590+ finish_cmds='PATH="\$PATH:/sbin" ldconfig -n $libdir'
591+ shlibpath_var=LD_LIBRARY_PATH
592+ shlibpath_overrides_runpath=no
593+ # This implies no fast_install, which is unacceptable.
594+ # Some rework will be needed to allow for fast_install
595+ # before this can be enabled.
596+ # Note: copied from linux-gnu, and may not be appropriate.
597+ hardcode_into_libs=yes
598+ # Assume using the uClibc dynamic linker.
599+ dynamic_linker="uClibc ld.so"
600+ ;;
601+
602 netbsd*)
603 need_lib_prefix=no
604 need_version=no
diff --git a/meta/packages/binutils/binutils-2.16.91.0.7/binutils-2.16.91.0.6-objcopy-rename-errorcode.patch b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-2.16.91.0.6-objcopy-rename-errorcode.patch
new file mode 100644
index 0000000000..4461bedd4e
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-2.16.91.0.6-objcopy-rename-errorcode.patch
@@ -0,0 +1,31 @@
1# strip (and objcopy) fail to set the error code if there is no
2# output file name and the rename of the stripped (or copied) file
3# fails, yet the command fails to do anything. This fixes both
4# objcopy and strip.
5#
6# modification by bero: Ported to 2.16.91.0.6
7#
8#Signed-off-by: John Bowler <jbowler@acm.org>
9#Signed-off-by: Bernhard Rosenkraenzer <bero@arklinux.org>
10--- binutils-2.16.91.0.6/binutils/objcopy.c.ark 2006-03-11 15:59:07.000000000 +0100
11+++ binutils-2.16.91.0.6/binutils/objcopy.c 2006-03-11 15:59:45.000000000 +0100
12@@ -2593,7 +2593,8 @@
13 if (preserve_dates)
14 set_times (tmpname, &statbuf);
15 if (output_file == NULL)
16- smart_rename (tmpname, argv[i], preserve_dates);
17+ if(smart_rename (tmpname, argv[i], preserve_dates))
18+ hold_status = 1;
19 status = hold_status;
20 }
21 else
22@@ -3184,7 +3185,8 @@
23 {
24 if (preserve_dates)
25 set_times (tmpname, &statbuf);
26- smart_rename (tmpname, input_filename, preserve_dates);
27+ if (smart_rename (tmpname, input_filename, preserve_dates))
28+ status = 1;
29 }
30 else
31 unlink (tmpname);
diff --git a/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-100-uclibc-conf.patch b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-100-uclibc-conf.patch
new file mode 100644
index 0000000000..25222e5df2
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-100-uclibc-conf.patch
@@ -0,0 +1,139 @@
1--- binutils-2.16.91.0.7/bfd/configure
2+++ binutils-2.16.91.0.7/bfd/configure
3@@ -3576,7 +3576,7 @@
4 ;;
5
6 # This must be Linux ELF.
7-linux-gnu*)
8+linux-gnu*|linux-uclibc*)
9 lt_cv_deplibs_check_method=pass_all
10 ;;
11
12--- binutils-2.16.91.0.7/binutils/configure
13+++ binutils-2.16.91.0.7/binutils/configure
14@@ -3411,7 +3411,7 @@
15 ;;
16
17 # This must be Linux ELF.
18-linux-gnu*)
19+linux-gnu*|linux-uclibc*)
20 lt_cv_deplibs_check_method=pass_all
21 ;;
22
23--- binutils-2.16.91.0.7/configure
24+++ binutils-2.16.91.0.7/configure
25@@ -1270,7 +1270,7 @@
26 am33_2.0-*-linux*)
27 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
28 ;;
29- sh-*-linux*)
30+ sh*-*-linux*)
31 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
32 ;;
33 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
34@@ -1578,7 +1578,7 @@
35 romp-*-*)
36 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
37 ;;
38- sh-*-* | sh64-*-*)
39+ sh*-*-* | sh64-*-*)
40 case "${host}" in
41 i[3456789]86-*-vsta) ;; # don't add gprof back in
42 i[3456789]86-*-go32*) ;; # don't add gprof back in
43--- binutils-2.16.91.0.7/configure.in
44+++ binutils-2.16.91.0.7/configure.in
45@@ -468,7 +468,7 @@
46 am33_2.0-*-linux*)
47 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
48 ;;
49- sh-*-linux*)
50+ sh*-*-linux*)
51 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
52 ;;
53 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
54@@ -776,7 +776,7 @@
55 romp-*-*)
56 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
57 ;;
58- sh-*-* | sh64-*-*)
59+ sh*-*-* | sh64-*-*)
60 case "${host}" in
61 i[[3456789]]86-*-vsta) ;; # don't add gprof back in
62 i[[3456789]]86-*-go32*) ;; # don't add gprof back in
63--- binutils-2.16.91.0.7/gas/configure
64+++ binutils-2.16.91.0.7/gas/configure
65@@ -3411,7 +3411,7 @@
66 ;;
67
68 # This must be Linux ELF.
69-linux-gnu*)
70+linux-gnu*|linux-uclibc*)
71 lt_cv_deplibs_check_method=pass_all
72 ;;
73
74--- binutils-2.16.91.0.7/gprof/configure
75+++ binutils-2.16.91.0.7/gprof/configure
76@@ -3419,6 +3419,11 @@
77 lt_cv_file_magic_test_file=`echo /lib/libc.so* /lib/libc-*.so`
78 ;;
79
80+linux-uclibc*)
81+ lt_cv_deplibs_check_method=pass_all
82+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
83+ ;;
84+
85 netbsd* | knetbsd*-gnu)
86 if echo __ELF__ | $CC -E - | grep __ELF__ > /dev/null; then
87 lt_cv_deplibs_check_method='match_pattern /lib[^/\.]+\.so\.[0-9]+\.[0-9]+$'
88--- binutils-2.16.91.0.7/ld/configure
89+++ binutils-2.16.91.0.7/ld/configure
90@@ -3413,7 +3413,7 @@
91 ;;
92
93 # This must be Linux ELF.
94-linux-gnu*)
95+linux-gnu*|linux-uclibc*)
96 lt_cv_deplibs_check_method=pass_all
97 ;;
98
99--- binutils-2.16.91.0.7/libtool.m4
100+++ binutils-2.16.91.0.7/libtool.m4
101@@ -739,7 +739,7 @@
102 ;;
103
104 # This must be Linux ELF.
105-linux-gnu*)
106+linux-gnu*|linux-uclibc*)
107 lt_cv_deplibs_check_method=pass_all
108 ;;
109
110--- binutils-2.16.91.0.7/ltconfig
111+++ binutils-2.16.91.0.7/ltconfig
112@@ -602,6 +602,7 @@
113
114 # Transform linux* to *-*-linux-gnu*, to support old configure scripts.
115 case $host_os in
116+linux-uclibc*) ;;
117 linux-gnu*) ;;
118 linux*) host=`echo $host | sed 's/^\(.*-.*-linux\)\(.*\)$/\1-gnu\2/'`
119 esac
120@@ -1247,7 +1248,7 @@
121 ;;
122
123 # This must be Linux ELF.
124-linux-gnu*)
125+linux-gnu*|linux-uclibc*)
126 version_type=linux
127 need_lib_prefix=no
128 need_version=no
129--- binutils-2.16.91.0.7/opcodes/configure
130+++ binutils-2.16.91.0.7/opcodes/configure
131@@ -3579,7 +3579,7 @@
132 ;;
133
134 # This must be Linux ELF.
135-linux-gnu*)
136+linux-gnu*|linux-uclibc*)
137 lt_cv_deplibs_check_method=pass_all
138 ;;
139
diff --git a/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-001_ld_makefile_patch.patch b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-001_ld_makefile_patch.patch
new file mode 100644
index 0000000000..04a7e61e25
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-001_ld_makefile_patch.patch
@@ -0,0 +1,50 @@
1#!/bin/sh -e
2## 001_ld_makefile_patch.dpatch
3##
4## All lines beginning with `## DP:' are a description of the patch.
5## DP: Description: correct where ld scripts are installed
6## DP: Author: Chris Chimelis <chris@debian.org>
7## DP: Upstream status: N/A
8## DP: Date: ??
9
10if [ $# -ne 1 ]; then
11 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
12 exit 1
13fi
14
15[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
16patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
17
18case "$1" in
19 -patch) patch $patch_opts -p1 < $0;;
20 -unpatch) patch $patch_opts -p1 -R < $0;;
21 *)
22 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
23 exit 1;;
24esac
25
26exit 0
27
28@DPATCH@
29--- binutils-2.16.91.0.1/ld/Makefile.am
30+++ binutils-2.16.91.0.1/ld/Makefile.am
31@@ -20,7 +20,7 @@
32 # We put the scripts in the directory $(scriptdir)/ldscripts.
33 # We can't put the scripts in $(datadir) because the SEARCH_DIR
34 # directives need to be different for native and cross linkers.
35-scriptdir = $(tooldir)/lib
36+scriptdir = $(libdir)
37
38 EMUL = @EMUL@
39 EMULATION_OFILES = @EMULATION_OFILES@
40--- binutils-2.16.91.0.1/ld/Makefile.in
41+++ binutils-2.16.91.0.1/ld/Makefile.in
42@@ -268,7 +268,7 @@
43 # We put the scripts in the directory $(scriptdir)/ldscripts.
44 # We can't put the scripts in $(datadir) because the SEARCH_DIR
45 # directives need to be different for native and cross linkers.
46-scriptdir = $(tooldir)/lib
47+scriptdir = $(libdir)
48 BASEDIR = $(srcdir)/..
49 BFDDIR = $(BASEDIR)/bfd
50 INCDIR = $(BASEDIR)/include
diff --git a/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-006_better_file_error.patch b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-006_better_file_error.patch
new file mode 100644
index 0000000000..f337611edf
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-006_better_file_error.patch
@@ -0,0 +1,43 @@
1#!/bin/sh -e
2## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
3##
4## All lines beginning with `## DP:' are a description of the patch.
5## DP: Specify which filename is causing an error if the filename is a
6## DP: directory. (#45832)
7
8if [ $# -ne 1 ]; then
9 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
10 exit 1
11fi
12
13[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
14patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
15
16case "$1" in
17 -patch) patch $patch_opts -p1 < $0;;
18 -unpatch) patch $patch_opts -p1 -R < $0;;
19 *)
20 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
21 exit 1;;
22esac
23
24exit 0
25
26@DPATCH@
27diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c
28--- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c 2003-07-23 16:08:09.000000000 +0100
29+++ binutils-2.14.90.0.6/bfd/opncls.c 2003-09-10 22:35:00.000000000 +0100
30@@ -150,6 +150,13 @@
31 {
32 bfd *nbfd;
33 const bfd_target *target_vec;
34+ struct stat s;
35+
36+ if (stat (filename, &s) == 0)
37+ if (S_ISDIR(s.st_mode)) {
38+ bfd_set_error (bfd_error_file_not_recognized);
39+ return NULL;
40+ }
41
42 nbfd = _bfd_new_bfd ();
43 if (nbfd == NULL)
diff --git a/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-012_check_ldrunpath_length.patch b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-012_check_ldrunpath_length.patch
new file mode 100644
index 0000000000..498651a90c
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-300-012_check_ldrunpath_length.patch
@@ -0,0 +1,47 @@
1#!/bin/sh -e
2## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
3##
4## All lines beginning with `## DP:' are a description of the patch.
5## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
6## DP: cases where -rpath isn't specified. (#151024)
7
8if [ $# -ne 1 ]; then
9 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
10 exit 1
11fi
12
13[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
14patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
15
16case "$1" in
17 -patch) patch $patch_opts -p1 < $0;;
18 -unpatch) patch $patch_opts -p1 -R < $0;;
19 *)
20 echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
21 exit 1;;
22esac
23
24exit 0
25
26@DPATCH@
27diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
28--- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100
29+++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100
30@@ -692,6 +692,8 @@
31 && command_line.rpath == NULL)
32 {
33 lib_path = (const char *) getenv ("LD_RUN_PATH");
34+ if ((lib_path) && (strlen (lib_path) == 0))
35+ lib_path = NULL;
36 if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
37 force))
38 break;
39@@ -871,6 +873,8 @@
40 rpath = command_line.rpath;
41 if (rpath == NULL)
42 rpath = (const char *) getenv ("LD_RUN_PATH");
43+ if ((rpath) && (strlen (rpath) == 0))
44+ rpath = NULL;
45 if (! (bfd_elf_size_dynamic_sections
46 (output_bfd, command_line.soname, rpath,
47 command_line.filter_shlib,
diff --git a/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-400-mips-ELF_MAXPAGESIZE-4K.patch b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-400-mips-ELF_MAXPAGESIZE-4K.patch
new file mode 100644
index 0000000000..5959c718d2
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-400-mips-ELF_MAXPAGESIZE-4K.patch
@@ -0,0 +1,26 @@
1--- binutils/bfd/elf32-mips.c~
2+++ binutils/bfd/elf32-mips.c
3@@ -1613,7 +1613,9 @@
4
5 /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
6 page sizes of up to that limit, so we need to respect it. */
7-#define ELF_MAXPAGESIZE 0x10000
8+/*#define ELF_MAXPAGESIZE 0x10000*/
9+/* Use 4K to shrink the elf header. NOT for general use! */
10+#define ELF_MAXPAGESIZE 0x1000
11 #define elf32_bed elf32_tradbed
12
13 /* Include the target file again for this target. */
14--- binutils/bfd/elfn32-mips.c~
15+++ binutils/bfd/elfn32-mips.c
16@@ -2399,7 +2399,9 @@
17
18 /* The SVR4 MIPS ABI says that this should be 0x10000, and Linux uses
19 page sizes of up to that limit, so we need to respect it. */
20-#define ELF_MAXPAGESIZE 0x10000
21+/*#define ELF_MAXPAGESIZE 0x10000*/
22+/* Use 4K to shrink the elf header. NOT for general use! */
23+#define ELF_MAXPAGESIZE 0x1000
24 #define elf32_bed elf32_tradbed
25
26 /* Include the target file again for this target. */
diff --git a/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-702-binutils-skip-comments.patch b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-702-binutils-skip-comments.patch
new file mode 100644
index 0000000000..9ef7a7c9ec
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16.91.0.7/binutils-uclibc-702-binutils-skip-comments.patch
@@ -0,0 +1,93 @@
1Retrieved from http://sources.redhat.com/ml/binutils/2004-04/msg00646.html
2Fixes
3localealias.s:544: Error: junk at end of line, first unrecognized character is `,'
4when building glibc-2.3.2 with gcc-3.4.0 and binutils-2.15.90.0.3
5
6Paths adjusted to match crosstool's patcher.
7
8Message-Id: m3n052qw2g.fsf@whitebox.m5r.de
9From: Andreas Schwab <schwab at suse dot de>
10To: Nathan Sidwell <nathan at codesourcery dot com>
11Cc: Ian Lance Taylor <ian at wasabisystems dot com>, binutils at sources dot redhat dot com
12Date: Fri, 23 Apr 2004 22:27:19 +0200
13Subject: Re: demand_empty_rest_of_line and ignore_rest_of_line
14
15Nathan Sidwell <nathan@codesourcery.com> writes:
16
17> Index: read.c
18> ===================================================================
19> RCS file: /cvs/src/src/gas/read.c,v
20> retrieving revision 1.76
21> diff -c -3 -p -r1.76 read.c
22> *** read.c 12 Mar 2004 17:48:12 -0000 1.76
23> --- read.c 18 Mar 2004 09:56:05 -0000
24> *************** read_a_source_file (char *name)
25> *** 1053,1059 ****
26> #endif
27> input_line_pointer--;
28> /* Report unknown char as ignored. */
29> ! ignore_rest_of_line ();
30> }
31>
32> #ifdef md_after_pass_hook
33> --- 1053,1059 ----
34> #endif
35> input_line_pointer--;
36> /* Report unknown char as ignored. */
37> ! demand_empty_rest_of_line ();
38> }
39>
40> #ifdef md_after_pass_hook
41
42This means that the unknown character is no longer ignored, despite the
43comment. As a side effect a line starting with a line comment character
44not followed by APP in NO_APP mode now triggers an error instead of just a
45warning, breaking builds of glibc on m68k-linux. Earlier in
46read_a_source_file where #APP is handled there is another comment that
47claims that unknown comments are ignored, when in fact they aren't (only
48the initial line comment character is skipped).
49
50Note that the presence of #APP will mess up the line counters, but
51that appears to be difficult to fix.
52
53Andreas.
54
552004-04-23 Andreas Schwab <schwab@suse.de>
56
57 * read.c (read_a_source_file): Ignore unknown text after line
58 comment character. Fix misleading comment.
59
60--- binutils/gas/read.c.~1.78.~ 2004-04-23 08:58:23.000000000 +0200
61+++ binutils/gas/read.c 2004-04-23 21:49:01.000000000 +0200
62@@ -950,10 +950,14 @@ read_a_source_file (char *name)
63 unsigned int new_length;
64 char *tmp_buf = 0;
65
66- bump_line_counters ();
67 s = input_line_pointer;
68 if (strncmp (s, "APP\n", 4))
69- continue; /* We ignore it */
70+ {
71+ /* We ignore it */
72+ ignore_rest_of_line ();
73+ continue;
74+ }
75+ bump_line_counters ();
76 s += 4;
77
78 sb_new (&sbuf);
79@@ -1052,7 +1056,7 @@ read_a_source_file (char *name)
80 continue;
81 #endif
82 input_line_pointer--;
83- /* Report unknown char as ignored. */
84+ /* Report unknown char as error. */
85 demand_empty_rest_of_line ();
86 }
87
88
89--
90Andreas Schwab, SuSE Labs, schwab@suse.de
91SuSE Linux AG, Maxfeldstra&#xC3;e 5, 90409 N&#xC3;rnberg, Germany
92Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 214B 8276 4ED5
93"And now for something completely different."
diff --git a/meta/packages/binutils/binutils-2.16/binutils-100_cflags_for_build.patch b/meta/packages/binutils/binutils-2.16/binutils-100_cflags_for_build.patch
new file mode 100644
index 0000000000..08e7049945
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16/binutils-100_cflags_for_build.patch
@@ -0,0 +1,28 @@
1--- binutils-2.16/binutils/Makefile.am.old 2005-06-05 16:59:47.000000000 +0100
2+++ binutils-2.16/binutils/Makefile.am 2005-06-05 17:00:39.000000000 +0100
3@@ -219,20 +219,20 @@
4 ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
5
6 sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
7- $(CC_FOR_BUILD) $(CFLAGS) $(LDFLAGS) -o $@ sysinfo.o syslex.o
8+ $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
9
10 syslex.o:
11 if [ -r syslex.c ]; then \
12- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) syslex.c ; \
13+ $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) syslex.c ; \
14 else \
15- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS) $(srcdir)/syslex.c ;\
16+ $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c ;\
17 fi
18
19 sysinfo.o:
20 if [ -r sysinfo.c ]; then \
21- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) sysinfo.c ; \
22+ $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) sysinfo.c ; \
23 else \
24- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS) $(srcdir)/sysinfo.c ; \
25+ $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c ; \
26 fi
27
28 # We need these for parallel make.
diff --git a/meta/packages/binutils/binutils-2.16/binutils-2.16-linux-uclibc.patch b/meta/packages/binutils/binutils-2.16/binutils-2.16-linux-uclibc.patch
new file mode 100644
index 0000000000..2f727a5b5a
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16/binutils-2.16-linux-uclibc.patch
@@ -0,0 +1,700 @@
1# This patch adds 'linux-uclibc' to all cases which otherwise only
2# fire for 'linux' - most of the time the 'linux-gnu*' cases. This
3# ensures that by default *-*-linux-uclibc is handled in the same way
4# as *-*-linux-gnu
5#
6--- binutils-2.16/bfd/config.bfd.orig 2005-09-06 19:58:39.153670708 -0700
7+++ binutils-2.16/bfd/config.bfd 2005-09-06 20:03:14.959026045 -0700
8@@ -140,7 +140,7 @@
9 targ_defvec=ecoffalpha_little_vec
10 targ_selvecs=bfd_elf64_alpha_vec
11 ;;
12- alpha*-*-linux-gnu* | alpha*-*-elf*)
13+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc* | alpha*-*-elf*)
14 targ_defvec=bfd_elf64_alpha_vec
15 targ_selvecs=ecoffalpha_little_vec
16 ;;
17@@ -150,7 +150,7 @@
18 alpha*-*-*)
19 targ_defvec=ecoffalpha_little_vec
20 ;;
21- ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
22+ ia64*-*-freebsd* | ia64*-*-netbsd* | ia64*-*-linux-gnu* | ia64*-*-linux-uclibc* | ia64*-*-elf* | ia64*-*-kfreebsd*-gnu)
23 targ_defvec=bfd_elf64_ia64_little_vec
24 targ_selvecs="bfd_elf64_ia64_big_vec bfd_efi_app_ia64_vec"
25 ;;
26@@ -227,7 +227,7 @@
27 targ_defvec=bfd_elf32_littlearm_vec
28 targ_selvecs=bfd_elf32_bigarm_vec
29 ;;
30- armeb-*-elf | arm*b-*-linux-gnu*)
31+ armeb-*-elf | arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*)
32 targ_defvec=bfd_elf32_bigarm_vec
33 targ_selvecs=bfd_elf32_littlearm_vec
34 ;;
35@@ -235,7 +235,7 @@
36 targ_defvec=bfd_elf32_littlearm_vec
37 targ_selvecs=bfd_elf32_bigarm_vec
38 ;;
39- arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-conix* | \
40+ arm-*-elf | arm-*-freebsd* | arm*-*-linux-gnu* | arm*-*-linux-uclibc* | arm*-*-conix* | \
41 arm*-*-uclinux* | arm-*-kfreebsd*-gnu | \
42 arm*-*-eabi* )
43 targ_defvec=bfd_elf32_littlearm_vec
44@@ -385,7 +385,7 @@
45 ;;
46
47 #ifdef BFD64
48- hppa*64*-*-linux-gnu*)
49+ hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*)
50 targ_defvec=bfd_elf64_hppa_linux_vec
51 targ_selvecs=bfd_elf64_hppa_vec
52 ;;
53@@ -396,7 +396,7 @@
54 ;;
55 #endif
56
57- hppa*-*-linux-gnu*)
58+ hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*)
59 targ_defvec=bfd_elf32_hppa_linux_vec
60 targ_selvecs=bfd_elf32_hppa_vec
61 ;;
62@@ -529,7 +529,7 @@
63 targ_selvecs=bfd_elf32_i386_vec
64 targ_underscore=yes
65 ;;
66- i[3-7]86-*-linux-gnu*)
67+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
68 targ_defvec=bfd_elf32_i386_vec
69 targ_selvecs="i386linux_vec bfd_efi_app_ia32_vec"
70 targ64_selvecs=bfd_elf64_x86_64_vec
71@@ -543,7 +543,7 @@
72 targ_defvec=bfd_elf64_x86_64_vec
73 targ_selvecs="bfd_elf32_i386_vec i386netbsd_vec i386coff_vec bfd_efi_app_ia32_vec"
74 ;;
75- x86_64-*-linux-gnu*)
76+ x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
77 targ_defvec=bfd_elf64_x86_64_vec
78 targ_selvecs="bfd_elf32_i386_vec i386linux_vec bfd_efi_app_ia32_vec"
79 ;;
80@@ -719,7 +719,7 @@
81 targ_selvecs=bfd_elf32_m68k_vec
82 targ_underscore=yes
83 ;;
84- m68*-*-linux-gnu*)
85+ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
86 targ_defvec=bfd_elf32_m68k_vec
87 targ_selvecs=m68klinux_vec
88 ;;
89@@ -1005,7 +1005,7 @@
90 ;;
91 #endif
92 powerpc-*-*bsd* | powerpc-*-elf* | powerpc-*-sysv4* | powerpc-*-eabi* | \
93- powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-rtems* | \
94+ powerpc-*-solaris2* | powerpc-*-linux-gnu* | powerpc-*-linux-uclibc* | powerpc-*-rtems* | \
95 powerpc-*-chorus* | powerpc-*-vxworks* | powerpc-*-windiss*)
96 targ_defvec=bfd_elf32_powerpc_vec
97 targ_selvecs="rs6000coff_vec bfd_elf32_powerpcle_vec ppcboot_vec"
98@@ -1042,7 +1042,7 @@
99 targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
100 ;;
101 powerpcle-*-elf* | powerpcle-*-sysv4* | powerpcle-*-eabi* | \
102- powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-vxworks* |\
103+ powerpcle-*-solaris2* | powerpcle-*-linux-gnu* | powerpcle-*-linux-uclibc* | powerpcle-*-vxworks* |\
104 powerpcle-*-rtems*)
105 targ_defvec=bfd_elf32_powerpcle_vec
106 targ_selvecs="rs6000coff_vec bfd_elf32_powerpc_vec ppcboot_vec"
107@@ -1213,7 +1213,7 @@
108 targ_selvecs="bfd_elf32_sparc_vec sunos_big_vec"
109 targ_underscore=yes
110 ;;
111- sparc-*-linux-gnu*)
112+ sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
113 targ_defvec=bfd_elf32_sparc_vec
114 targ_selvecs="sparclinux_vec bfd_elf64_sparc_vec sunos_big_vec"
115 ;;
116@@ -1260,7 +1260,7 @@
117 targ_defvec=sunos_big_vec
118 targ_underscore=yes
119 ;;
120- sparc64-*-linux-gnu*)
121+ sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
122 targ_defvec=bfd_elf64_sparc_vec
123 targ_selvecs="bfd_elf32_sparc_vec sparclinux_vec sunos_big_vec"
124 ;;
125@@ -1329,7 +1329,7 @@
126 targ_underscore=yes
127 ;;
128
129- vax-*-linux-gnu*)
130+ vax-*-linux-gnu* | vax-*-linux-uclibc*)
131 targ_defvec=bfd_elf32_vax_vec
132 ;;
133
134--- binutils-2.16/bfd/configure.in.orig 2005-09-06 20:25:48.848220921 -0700
135+++ binutils-2.16/bfd/configure.in 2005-09-06 20:26:58.628611924 -0700
136@@ -163,7 +163,7 @@
137 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
138 COREFILE=''
139 ;;
140- alpha*-*-linux-gnu*)
141+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
142 COREFILE=trad-core.lo
143 TRAD_HEADER='"hosts/alphalinux.h"'
144 ;;
145@@ -248,7 +248,7 @@
146 TRAD_HEADER='"hosts/i386mach3.h"'
147 ;;
148 changequote(,)dnl
149- i[3-7]86-*-linux-gnu*)
150+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
151 changequote([,])dnl
152 COREFILE=trad-core.lo
153 TRAD_HEADER='"hosts/i386linux.h"'
154@@ -289,7 +289,7 @@
155 COREFILE=trad-core.lo
156 TRAD_HEADER='"hosts/hp300bsd.h"'
157 ;;
158- m68*-*-linux-gnu*)
159+ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
160 COREFILE=trad-core.lo
161 TRAD_HEADER='"hosts/m68klinux.h"'
162 ;;
163@@ -375,7 +375,7 @@
164 COREFILE=trad-core.lo
165 TRAD_HEADER='"hosts/vaxult2.h"'
166 ;;
167- vax-*-linux-gnu*)
168+ vax-*-linux-gnu* | vax-*-linux-uclibc*)
169 COREFILE=trad-core.lo
170 TRAD_HEADER='"hosts/vaxlinux.h"'
171 ;;
172--- binutils-2.16/bfd/configure.orig 2005-09-06 20:03:14.991028059 -0700
173+++ binutils-2.16/bfd/configure 2005-09-06 20:04:48.512913020 -0700
174@@ -3572,7 +3572,7 @@
175 ;;
176
177 # This must be Linux ELF.
178-linux-gnu*)
179+linux-gnu* | linux-uclibc*)
180 case $host_cpu in
181 alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
182 lt_cv_deplibs_check_method=pass_all ;;
183@@ -9918,7 +9918,7 @@
184 alpha*-*-freebsd* | alpha*-*-kfreebsd*-gnu)
185 COREFILE=''
186 ;;
187- alpha*-*-linux-gnu*)
188+ alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*)
189 COREFILE=trad-core.lo
190 TRAD_HEADER='"hosts/alphalinux.h"'
191 ;;
192@@ -9982,7 +9982,7 @@
193 COREFILE=trad-core.lo
194 TRAD_HEADER='"hosts/i386mach3.h"'
195 ;;
196- i[3-7]86-*-linux-gnu*)
197+ i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*)
198 COREFILE=trad-core.lo
199 TRAD_HEADER='"hosts/i386linux.h"'
200 ;;
201@@ -10020,7 +10020,7 @@
202 COREFILE=trad-core.lo
203 TRAD_HEADER='"hosts/hp300bsd.h"'
204 ;;
205- m68*-*-linux-gnu*)
206+ m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
207 COREFILE=trad-core.lo
208 TRAD_HEADER='"hosts/m68klinux.h"'
209 ;;
210@@ -10154,7 +10154,7 @@
211 COREFILE=trad-core.lo
212 TRAD_HEADER='"hosts/vaxult2.h"'
213 ;;
214- vax-*-linux-gnu*)
215+ vax-*-linux-gnu* | vax-*-linux-uclibc*)
216 COREFILE=trad-core.lo
217 TRAD_HEADER='"hosts/vaxlinux.h"'
218 ;;
219--- binutils-2.16/binutils/configure.orig 2005-09-06 20:26:58.676614945 -0700
220+++ binutils-2.16/binutils/configure 2005-09-06 20:27:21.230034142 -0700
221@@ -1564,7 +1564,7 @@
222 ;;
223
224 # This must be Linux ELF.
225-linux-gnu*)
226+linux-gnu* | linux-uclibc*)
227 case $host_cpu in
228 alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
229 lt_cv_deplibs_check_method=pass_all ;;
230--- binutils-2.16/configure.in.orig 2005-09-06 20:31:11.872547560 -0700
231+++ binutils-2.16/configure.in 2005-09-06 20:31:47.322778302 -0700
232@@ -346,7 +346,7 @@
233 ;;
234 "")
235 case "${target}" in
236- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
237+ *-*-linux*-gnu | *-*-linux*-uclibc | *-*-gnu* | *-*-k*bsd*-gnu)
238 # Enable libmudflap by default in GNU and friends.
239 ;;
240 *-*-freebsd*)
241--- binutils-2.16/configure.orig 2005-09-06 20:30:00.120032459 -0700
242+++ binutils-2.16/configure 2005-09-06 20:31:11.832545043 -0700
243@@ -1142,7 +1142,7 @@
244 ;;
245 "")
246 case "${target}" in
247- *-*-linux*-gnu | *-*-gnu* | *-*-k*bsd*-gnu)
248+ *-*-linux*-gnu | *-*-linux*-uclibc | *-*-gnu* | *-*-k*bsd*-gnu)
249 # Enable libmudflap by default in GNU and friends.
250 ;;
251 *-*-freebsd*)
252--- binutils-2.16/gas/configure.in.orig 2005-09-06 20:32:36.993903909 -0700
253+++ binutils-2.16/gas/configure.in 2005-09-06 20:32:55.667078938 -0700
254@@ -161,7 +161,7 @@
255 AC_DEFINE(AIX_WEAK_SUPPORT, 1,
256 [Define if using AIX 5.2 value for C_WEAKEXT.])
257 ;;
258- ppc-*-linux-gnu*)
259+ ppc-*-linux-gnu* | ppc-*-linux-uclibc*)
260 case "$endian" in
261 big) ;;
262 *) AC_MSG_ERROR(GNU/Linux must be configured big endian) ;;
263--- binutils-2.16/gas/configure.orig 2005-09-06 20:31:55.247276960 -0700
264+++ binutils-2.16/gas/configure 2005-09-06 20:32:36.961901896 -0700
265@@ -3409,7 +3409,7 @@
266 ;;
267
268 # This must be Linux ELF.
269-linux-gnu*)
270+linux-gnu* | linux-uclibc*)
271 case $host_cpu in
272 alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
273 lt_cv_deplibs_check_method=pass_all ;;
274@@ -4462,7 +4462,7 @@
275 _ACEOF
276
277 ;;
278- ppc-*-linux-gnu*)
279+ ppc-*-linux-gnu* | ppc-*-linux-uclibc*)
280 case "$endian" in
281 big) ;;
282 *) { { echo "$as_me:$LINENO: error: GNU/Linux must be configured big endian" >&5
283--- binutils-2.16/gas/configure.tgt.orig 2005-09-06 20:32:55.695080700 -0700
284+++ binutils-2.16/gas/configure.tgt 2005-09-06 20:35:59.482645723 -0700
285@@ -100,7 +100,7 @@
286 alpha-*-*vms*) fmt=evax ;;
287 alpha-*-osf*) fmt=ecoff ;;
288 alpha-*-linuxecoff*) fmt=ecoff ;;
289- alpha-*-linux-gnu*) fmt=elf em=linux ;;
290+ alpha-*-linux-gnu* | alpha-*-linux-uclibc*) fmt=elf em=linux ;;
291 alpha-*-netbsd*) fmt=elf em=nbsd ;;
292 alpha-*-openbsd*) fmt=elf em=obsd ;;
293
294@@ -116,7 +116,7 @@
295 arm-*-conix*) fmt=elf ;;
296 arm-*-linux*aout*) fmt=aout em=linux ;;
297 arm-*-linux-gnueabi*) fmt=elf em=armlinuxeabi ;;
298- arm-*-linux-gnu*) fmt=elf em=linux ;;
299+ arm-*-linux-gnu* | arm-*-linux-uclibc*) fmt=elf em=linux ;;
300 arm-*-uclinux*) fmt=elf em=linux ;;
301 arm-*-netbsdelf*) fmt=elf em=nbsd ;;
302 arm-*-*n*bsd*) fmt=aout em=nbsd ;;
303@@ -128,7 +128,7 @@
304
305 avr-*-*) fmt=elf ;;
306
307- cris-*-linux-gnu* | crisv32-*-linux-gnu*)
308+ cris-*-linux-gnu* | crisv32-*-linux-gnu* | cris-*-linux-uclibc* | crisv32-*-linux-uclibc*)
309 fmt=multi bfd_gas=yes em=linux ;;
310 cris-*-* | crisv32-*-*) fmt=multi bfd_gas=yes ;;
311
312@@ -192,7 +192,7 @@
313 i386-*-linux*aout*) fmt=aout em=linux ;;
314 i386-*-linux*oldld) fmt=aout em=linux ;;
315 i386-*-linux*coff*) fmt=coff em=linux ;;
316- i386-*-linux-gnu*) fmt=elf em=linux ;;
317+ i386-*-linux-gnu* | i386-*-linux-uclibc*) fmt=elf em=linux ;;
318 i386-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
319 i386-*-sysv[45]*) fmt=elf ;;
320 i386-*-solaris*) fmt=elf ;;
321@@ -238,7 +238,7 @@
322
323 ia64-*-elf*) fmt=elf ;;
324 ia64-*-aix*) fmt=elf em=ia64aix ;;
325- ia64-*-linux-gnu*) fmt=elf em=linux ;;
326+ ia64-*-linux-gnu* | ia64-*-linux-uclibc*) fmt=elf em=linux ;;
327 ia64-*-hpux*) fmt=elf em=hpux ;;
328 ia64-*-netbsd*) fmt=elf em=nbsd ;;
329
330@@ -265,7 +265,7 @@
331 m68k-*-rtems*) fmt=elf ;;
332 m68k-*-hpux*) fmt=hp300 em=hp300 ;;
333 m68k-*-linux*aout*) fmt=aout em=linux ;;
334- m68k-*-linux-gnu*) fmt=elf em=linux ;;
335+ m68k-*-linux-gnu* | m68k-*-linux-uclibc*) fmt=elf em=linux ;;
336 m68k-*-uclinux*) fmt=elf ;;
337 m68k-*-gnu*) fmt=elf ;;
338 m68k-*-netbsdelf*) fmt=elf em=nbsd ;;
339@@ -332,7 +332,7 @@
340 ppc-*-beos*) fmt=coff ;;
341 ppc-*-*n*bsd* | ppc-*-elf*) fmt=elf ;;
342 ppc-*-eabi* | ppc-*-sysv4*) fmt=elf ;;
343- ppc-*-linux-gnu*) fmt=elf em=linux ;;
344+ ppc-*-linux-gnu* | ppc-*-linux-uclibc*) fmt=elf em=linux ;;
345 ppc-*-solaris*) fmt=elf ;;
346 ppc-*-rtems*) fmt=elf ;;
347 ppc-*-macos*) fmt=coff em=macos ;;
348@@ -340,7 +340,7 @@
349 ppc-*-kaos*) fmt=elf ;;
350 ppc-*-lynxos*) fmt=elf em=lynx bfd_gas=yes ;;
351
352- s390-*-linux-gnu*) fmt=elf em=linux ;;
353+ s390-*-linux-gnu* | s390-*-linux-uclibc*) fmt=elf em=linux ;;
354 s390-*-tpf*) fmt=elf ;;
355
356 sh*-*-linux*) fmt=elf em=linux
357@@ -369,7 +369,7 @@
358 sparc-*-aout | sparc*-*-vxworks*) fmt=aout em=sparcaout ;;
359 sparc-*-coff) fmt=coff ;;
360 sparc-*-linux*aout*) fmt=aout em=linux ;;
361- sparc-*-linux-gnu*) fmt=elf em=linux ;;
362+ sparc-*-linux-gnu* | sparc-*-linux-uclibc*) fmt=elf em=linux ;;
363 sparc-fujitsu-none) fmt=aout ;;
364 sparc-*-elf) fmt=elf ;;
365 sparc-*-sysv4*) fmt=elf ;;
366@@ -398,7 +398,7 @@
367 vax-*-netbsdelf*) fmt=elf em=nbsd ;;
368 vax-*-netbsd*) fmt=aout em=nbsd ;;
369 vax-*-bsd* | vax-*-ultrix*) fmt=aout ;;
370- vax-*-linux-gnu*) fmt=elf em=linux bfd_gas=yes ;;
371+ vax-*-linux-gnu* | vax-*-linux-uclibc*) fmt=elf em=linux bfd_gas=yes ;;
372
373 w65-*-*) fmt=coff ;;
374
375--- binutils-2.16/gprof/configure.orig 2005-09-06 20:36:04.850983531 -0700
376+++ binutils-2.16/gprof/configure 2005-09-06 20:36:26.344336022 -0700
377@@ -3407,7 +3407,7 @@
378 ;;
379
380 # This must be Linux ELF.
381-linux-gnu*)
382+linux-gnu* | linux-uclibc*)
383 case $host_cpu in
384 alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
385 lt_cv_deplibs_check_method=pass_all ;;
386--- binutils-2.16/ld/configure.host.orig 2005-09-06 20:37:46.085353808 -0700
387+++ binutils-2.16/ld/configure.host 2005-09-06 20:40:03.381993341 -0700
388@@ -83,7 +83,7 @@
389 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`
390 ;;
391
392-arm*-*-linux-gnu*)
393+arm*-*-linux-gnu* | arm*-*-linux-uclibc*)
394 HOSTING_CRT0='-p '`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]\*,ld-linux,g"`
395 ;;
396
397@@ -141,7 +141,7 @@
398 HOSTING_LIBS="$HOSTING_LIBS"' -lcygwin -L/usr/lib/w32api -luser32 -lkernel32 -ladvapi32 -lshell32 `if [ -f ../gcc/libgcc.a ] ; then echo ../gcc/libgcc.a ; else ${CC} -print-libgcc-file-name; fi`'
399 ;;
400
401-ia64-*-linux-gnu*)
402+ia64-*-linux-gnu* | ia64-*-linux-uclibc*)
403 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,ld\[^ \]*\*,ld-linux-ia64,g"`
404 ;;
405
406@@ -155,11 +155,11 @@
407 HOSTING_LIBS='-L/usr/lib32 '"$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o ; else ${CC} -print-file-name=crtend.o; fi` /usr/lib32/crtn.o -init __do_global_ctors -fini __do_global_dtors'
408 ;;
409
410-mips*-*-linux-gnu*)
411+mips*-*-linux-gnu* | mips*-*-linux-uclibc*)
412 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"`
413 ;;
414
415-m68*-*-linux-gnu*)
416+m68*-*-linux-gnu* | m68*-*-linux-uclibc*)
417 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"`
418 ;;
419
420@@ -183,19 +183,19 @@
421 HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi`'
422 ;;
423
424-powerpc64*-*-linux-gnu*)
425+powerpc64*-*-linux-gnu* | powerpc64*-*-linux-uclibc*)
426 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld64.so.1,"`
427 ;;
428
429-powerpc*-*-linux-gnu*)
430+powerpc*-*-linux-gnu* | powerpc*-*-linux-uclibc*)
431 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"`
432 ;;
433
434-s390x-*-linux-gnu*)
435+s390x-*-linux-gnu* | s390x-*-linux-uclibc*)
436 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld64.so.1,"`
437 ;;
438
439-s390-*-linux-gnu*)
440+s390-*-linux-gnu* | s390-*-linux-uclibc*)
441 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld.so.1,"`
442 ;;
443
444@@ -209,15 +209,15 @@
445 HOSTING_LIBS="$HOSTING_LIBS"' `if [ -f ../gcc/crtend.o ]; then echo ../gcc/crtend.o; else ${CC} -print-file-name=crtend.o; fi` `if [ -f ../gcc/crtn.o ]; then echo ../gcc/crtn.o; else ${CC} -print-file-name=crtn.o; fi`'
446 ;;
447
448-sparc-*-linux-gnu*)
449+sparc-*-linux-gnu* | sparc-*-linux-uclibc*)
450 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib/ld-linux.so.2,"`
451 ;;
452
453-sparc64-*-linux-gnu*)
454+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*)
455 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld-linux.so.2,"`
456 ;;
457
458-x86_64-*-linux-gnu*)
459+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*)
460 HOSTING_CRT0=`echo "$HOSTING_CRT0" | sed -e "s,\\\`specs.*\"\\\`,/lib64/ld-linux-x86-64.so.2,"`
461 ;;
462
463--- binutils-2.16/ld/configure.orig 2005-09-06 20:37:34.700637413 -0700
464+++ binutils-2.16/ld/configure 2005-09-06 20:37:46.013349277 -0700
465@@ -1568,7 +1568,7 @@
466 ;;
467
468 # This must be Linux ELF.
469-linux-gnu*)
470+linux-gnu* | linux-uclibc*)
471 case $host_cpu in
472 alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
473 lt_cv_deplibs_check_method=pass_all ;;
474--- binutils-2.16/ld/configure.tgt.orig 2005-09-06 20:40:03.413995355 -0700
475+++ binutils-2.16/ld/configure.tgt 2005-09-06 20:45:48.111685813 -0700
476@@ -30,7 +30,7 @@
477 cris-*-*aout*) targ_emul=crisaout
478 targ_extra_emuls="criself crislinux"
479 targ_extra_libpath=$targ_extra_emuls ;;
480-cris-*-linux-gnu* | cris-*-linux-gnu*)
481+cris-*-linux-gnu* | cris-*-linux-gnu* | cris-*-linux-uclibc* | cris-*-linux-uclibc*)
482 targ_emul=crislinux ;;
483 cris-*-* | crisv32-*-*) targ_emul=criself
484 targ_extra_emuls="crisaout crislinux"
485@@ -62,14 +62,14 @@
486 tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/aout//'`
487 tdir_sun4=sparc-sun-sunos4
488 ;;
489-sparc64-*-linux-gnu*) targ_emul=elf64_sparc
490+sparc64-*-linux-gnu* | sparc64-*-linux-uclibc*) targ_emul=elf64_sparc
491 targ_extra_emuls="elf32_sparc sparclinux sun4"
492 targ_extra_libpath=elf32_sparc
493 tdir_elf32_sparc=`echo ${targ_alias} | sed -e 's/64//'`
494 tdir_sparclinux=${tdir_elf32_sparc}aout
495 tdir_sun4=sparc-sun-sunos4
496 ;;
497-sparc*-*-linux-gnu*) targ_emul=elf32_sparc
498+sparc*-*-linux-gnu* | sparc*-*-linux-uclibc*) targ_emul=elf32_sparc
499 targ_extra_emuls="sparclinux elf64_sparc sun4"
500 targ_extra_libpath=elf64_sparc
501 tdir_sparclinux=${targ_alias}aout
502@@ -119,8 +119,8 @@
503 ia64-*-aix*) targ_emul=elf64_aix ;;
504 m32r*le-*-elf*) targ_emul=m32rlelf ;;
505 m32r*-*-elf*) targ_emul=m32relf ;;
506-m32r*le-*-linux-gnu*) targ_emul=m32rlelf_linux ;;
507-m32r*-*-linux-gnu*) targ_emul=m32relf_linux ;;
508+m32r*le-*-linux-gnu* | m32r*le-*-linux-uclibc*) targ_emul=m32rlelf_linux ;;
509+m32r*-*-linux-gnu* | m32r*-*-linux-uclibc*) targ_emul=m32relf_linux ;;
510 m68hc11-*-*|m6811-*-*) targ_emul=m68hc11elf
511 targ_extra_emuls="m68hc11elfb m68hc12elf m68hc12elfb" ;;
512 m68hc12-*-*|m6812-*-*) targ_emul=m68hc12elf
513@@ -131,7 +131,7 @@
514 m68*-apple-aux*) targ_emul=m68kaux ;;
515 maxq-*-coff) targ_emul=maxqcoff;;
516 *-tandem-none) targ_emul=st2000 ;;
517-i370-*-elf* | i370-*-linux-gnu*) targ_emul=elf32i370 ;;
518+i370-*-elf* | i370-*-linux-gnu* | i370-*-linux-uclibc*) targ_emul=elf32i370 ;;
519 i[3-7]86-*-nto-qnx*) targ_emul=i386nto ;;
520 i[3-7]86-*-vsta) targ_emul=vsta ;;
521 i[3-7]86-go32-rtems*) targ_emul=i386go32 ;;
522@@ -155,14 +155,14 @@
523 tdir_elf_i386=`echo ${targ_alias} | sed -e 's/aout//'`
524 ;;
525 i[3-7]86-*-linux*oldld) targ_emul=i386linux; targ_extra_emuls=elf_i386 ;;
526-i[3-7]86-*-linux-gnu*) targ_emul=elf_i386
527+i[3-7]86-*-linux-gnu* | i[3-7]86-*-linux-uclibc*) targ_emul=elf_i386
528 targ_extra_emuls=i386linux
529 if test x${want64} = xtrue; then
530 targ_extra_emuls="$targ_extra_emuls elf_x86_64"
531 fi
532 tdir_i386linux=${targ_alias}aout
533 ;;
534-x86_64-*-linux-gnu*) targ_emul=elf_x86_64
535+x86_64-*-linux-gnu* | x86_64-*-linux-uclibc*) targ_emul=elf_x86_64
536 targ_extra_emuls="elf_i386 i386linux"
537 targ_extra_libpath=elf_i386
538 tdir_i386linux=`echo ${targ_alias}aout | sed -e 's/x86_64/i386/'`
539@@ -262,13 +262,14 @@
540 arm-*-kaos*) targ_emul=armelf ;;
541 arm9e-*-elf) targ_emul=armelf ;;
542 arm*b-*-linux-gnueabi) targ_emul=armelfb_linux_eabi ;;
543-arm*b-*-linux-gnu*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
544+arm*b-*-linux-gnu* | arm*b-*-linux-uclibc*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
545 arm*-*-linux-gnueabi) targ_emul=armelf_linux_eabi ;;
546-arm*-*-linux-gnu*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
547+arm*-*-linux-gnu* | arm*-*-linux-uclibc*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
548 arm*-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
549 arm-*-vxworks) targ_emul=armelf_vxworks ;;
550 arm*-*-conix*) targ_emul=armelf ;;
551-thumb-*-linux-gnu* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
552+thumb-*-linux-gnu* | thumb-*-linux-uclibc* | thumb-*-uclinux*) targ_emul=armelf_linux; targ_extra_emuls=armelf ;;
553+thumbb-*-linux-gnu* | thumbb-*-linux-uclibc* | thumbb-*-uclinux*) targ_emul=armelfb_linux; targ_extra_emuls=armelfb ;;
554 strongarm-*-coff) targ_emul=armcoff ;;
555 strongarm-*-elf) targ_emul=armelf ;;
556 strongarm-*-kaos*) targ_emul=armelf ;;
557@@ -372,7 +373,7 @@
558 targ_extra_emuls=m68kelf
559 tdir_m68kelf=`echo ${targ_alias} | sed -e 's/aout//'`
560 ;;
561-m68k-*-linux-gnu*) targ_emul=m68kelf
562+m68k-*-linux-gnu* | m68k-*-linux-uclibc*) targ_emul=m68kelf
563 targ_extra_emuls=m68klinux
564 tdir_m68klinux=`echo ${targ_alias} | sed -e 's/linux/linuxaout/'`
565 ;;
566@@ -388,9 +389,9 @@
567 m68*-*-psos*) targ_emul=m68kpsos ;;
568 m68*-*-rtemscoff*) targ_emul=m68kcoff ;;
569 m68*-*-rtems*) targ_emul=m68kelf ;;
570-hppa*64*-*-linux-gnu*) targ_emul=hppa64linux ;;
571+hppa*64*-*-linux-gnu* | hppa*64*-*-linux-uclibc*) targ_emul=hppa64linux ;;
572 hppa*64*-*) targ_emul=elf64hppa ;;
573-hppa*-*-linux-gnu*) targ_emul=hppalinux ;;
574+hppa*-*-linux-gnu* | hppa*-*-linux-uclibc*) targ_emul=hppalinux ;;
575 hppa*-*-*elf*) targ_emul=hppaelf ;;
576 hppa*-*-lites*) targ_emul=hppaelf ;;
577 hppa*-*-netbsd*) targ_emul=hppanbsd ;;
578@@ -402,7 +403,7 @@
579 vax-*-netbsdaout* | vax-*-netbsd*)
580 targ_emul=vaxnbsd
581 targ_extra_emuls=elf32vax ;;
582-vax-*-linux-gnu*) targ_emul=elf32vax ;;
583+vax-*-linux-gnu* | vax-*-linux-uclibc*) targ_emul=elf32vax ;;
584 mips*-*-pe) targ_emul=mipspe ;
585 targ_extra_ofiles="deffilep.o pe-dll.o" ;;
586 mips*-dec-ultrix*) targ_emul=mipslit ;;
587@@ -436,18 +437,18 @@
588 mips*-*-vxworks*) targ_emul=elf32ebmip
589 targ_extra_emuls="elf32elmip" ;;
590 mips*-*-windiss) targ_emul=elf32mipswindiss ;;
591-mips64*el-*-linux-gnu*) targ_emul=elf32ltsmipn32
592+mips64*el-*-linux-gnu* | mips64*el-*-linux-uclibc*) targ_emul=elf32ltsmipn32
593 targ_extra_emuls="elf32btsmipn32 elf32ltsmip elf32btsmip elf64ltsmip elf64btsmip"
594 targ_extra_libpath="elf32ltsmip elf64ltsmip"
595 ;;
596-mips64*-*-linux-gnu*) targ_emul=elf32btsmipn32
597+mips64*-*-linux-gnu* | mips64*-*-linux-uclibc*) targ_emul=elf32btsmipn32
598 targ_extra_emuls="elf32ltsmipn32 elf32btsmip elf32ltsmip elf64btsmip elf64ltsmip"
599 targ_extra_libpath="elf32btsmip elf64btsmip"
600 ;;
601-mips*el-*-linux-gnu*) targ_emul=elf32ltsmip
602+mips*el-*-linux-gnu* | mips*el-*-linux-uclibc*) targ_emul=elf32ltsmip
603 targ_extra_emuls="elf32btsmip elf32ltsmipn32 elf64ltsmip elf32btsmipn32 elf64btsmip"
604 ;;
605-mips*-*-linux-gnu*) targ_emul=elf32btsmip
606+mips*-*-linux-gnu* | mips*-*-linux-uclibc*) targ_emul=elf32btsmip
607 targ_extra_emuls="elf32ltsmip elf32btsmipn32 elf64btsmip elf32ltsmipn32 elf64ltsmip"
608 ;;
609 mips*-*-lnews*) targ_emul=mipslnews ;;
610@@ -467,7 +468,7 @@
611 alpha*-*-linuxecoff*) targ_emul=alpha targ_extra_emuls=elf64alpha
612 tdir_elf64alpha=`echo ${targ_alias} | sed -e 's/ecoff//'`
613 ;;
614-alpha*-*-linux-gnu*) targ_emul=elf64alpha targ_extra_emuls=alpha
615+alpha*-*-linux-gnu* | alpha*-*-linux-uclibc*) targ_emul=elf64alpha targ_extra_emuls=alpha
616 tdir_alpha=`echo ${targ_alias} | sed -e 's/linux/linuxecoff/'`
617 ;;
618 alpha*-*-osf*) targ_emul=alpha ;;
619--- binutils-2.16/ld/emultempl/elf32.em.orig 2005-09-06 20:45:48.247694371 -0700
620+++ binutils-2.16/ld/emultempl/elf32.em 2005-09-06 20:46:39.158898011 -0700
621@@ -65,7 +65,7 @@
622
623 if [ "x${USE_LIBPATH}" = xyes ] ; then
624 case ${target} in
625- *-*-linux-gnu*)
626+ *-*-linux-gnu* | *-*-linux-uclibc*)
627 cat >>e${EMULATION_NAME}.c <<EOF
628 #ifdef HAVE_GLOB
629 #include <glob.h>
630@@ -350,7 +350,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@@ -522,7 +522,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@@ -932,7 +932,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--- binutils-2.16/libtool.m4.orig 2005-09-06 20:46:55.131903129 -0700
658+++ binutils-2.16/libtool.m4 2005-09-06 20:47:07.364672889 -0700
659@@ -634,7 +634,7 @@
660 ;;
661
662 # This must be Linux ELF.
663-linux-gnu*)
664+linux-gnu* | linux-uclibc*)
665 case $host_cpu in
666 alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
667 lt_cv_deplibs_check_method=pass_all ;;
668--- binutils-2.16/ltconfig.orig 2005-09-06 20:47:13.965088227 -0700
669+++ binutils-2.16/ltconfig 2005-09-06 20:49:12.944575134 -0700
670@@ -1247,7 +1247,7 @@
671 ;;
672
673 # This must be Linux ELF.
674-linux-gnu*)
675+linux-gnu* | linux-uclibc*)
676 version_type=linux
677 need_lib_prefix=no
678 need_version=no
679--- binutils-2.16/ltmain.sh.orig 2005-09-06 20:49:12.980577399 -0700
680+++ binutils-2.16/ltmain.sh 2005-09-06 20:50:15.180491393 -0700
681@@ -2600,7 +2600,7 @@
682 versuffix="$major.$revision"
683 ;;
684
685- linux)
686+ linux | linux-uclibc)
687 major=.`expr $current - $age`
688 versuffix="$major.$age.$revision"
689 ;;
690--- binutils-2.16/opcodes/configure.orig 2005-09-06 20:50:15.220493910 -0700
691+++ binutils-2.16/opcodes/configure 2005-09-06 20:50:38.053930728 -0700
692@@ -3576,7 +3576,7 @@
693 ;;
694
695 # This must be Linux ELF.
696-linux-gnu*)
697+linux-gnu* | linux-uclibc*)
698 case $host_cpu in
699 alpha* | mips* | hppa* | i*86 | powerpc* | sparc* | ia64* )
700 lt_cv_deplibs_check_method=pass_all ;;
diff --git a/meta/packages/binutils/binutils-2.16/binutils-2.16-objcopy-rename-errorcode.patch b/meta/packages/binutils/binutils-2.16/binutils-2.16-objcopy-rename-errorcode.patch
new file mode 100644
index 0000000000..e4372de88f
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16/binutils-2.16-objcopy-rename-errorcode.patch
@@ -0,0 +1,29 @@
1# strip (and objcopy) fail to set the error code if there is no
2# output file name and the rename of the stripped (or copied) file
3# fails, yet the command fails to do anything. This fixes both
4# objcopy and strip.
5#
6#Signed-off-by: John Bowler <jbowler@acm.org>
7
8--- binutils-2.16/binutils/objcopy.c.orig 2006-01-31 11:15:38.797318519 -0800
9+++ binutils-2.16/binutils/objcopy.c 2006-01-31 11:15:40.463318516 -0800
10@@ -2434,7 +2434,8 @@ strip_main (int argc, char *argv[])
11 if (preserve_dates)
12 set_times (tmpname, &statbuf);
13 if (output_file == NULL)
14- smart_rename (tmpname, argv[i], preserve_dates);
15+ if (smart_rename (tmpname, argv[i], preserve_dates))
16+ hold_status = 1;
17 status = hold_status;
18 }
19 else
20@@ -3013,7 +3014,8 @@ copy_main (int argc, char *argv[])
21 {
22 if (preserve_dates)
23 set_times (tmpname, &statbuf);
24- smart_rename (tmpname, input_filename, preserve_dates);
25+ if (smart_rename (tmpname, input_filename, preserve_dates))
26+ status = 1;
27 }
28 else
29 unlink (tmpname);
diff --git a/meta/packages/binutils/binutils-2.16/binutils-2.16-thumb-glue.patch b/meta/packages/binutils/binutils-2.16/binutils-2.16-thumb-glue.patch
new file mode 100644
index 0000000000..59d8035f7d
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16/binutils-2.16-thumb-glue.patch
@@ -0,0 +1,76 @@
1# The ARM->Thumb glue uses an ldr of the target function address, this
2# simply doesn't work for PIC code, changed to use 4 word PIC glue
3#
4--- binutils-2.16/.pc/binutils-2.16-thumb-glue.patch/bfd/elf32-arm.c 2005-09-18 03:52:15.465165051 -0700
5+++ binutils-2.16/bfd/elf32-arm.c 2005-09-18 03:52:33.546302825 -0700
6@@ -1493,19 +1493,20 @@
7 return myh;
8 }
9
10-/* ARM->Thumb glue:
11+/* ARM->Thumb glue (PIC version):
12
13 .arm
14 __func_from_arm:
15 ldr r12, __func_addr
16+ add r12, r12, pc @ pc is __func_addr, so r12 is func
17 bx r12
18 __func_addr:
19- .word func @ behave as if you saw a ARM_32 reloc. */
20+ .word func-.+1 @ offset to actual function, low bit set */
21
22-#define ARM2THUMB_GLUE_SIZE 12
23-static const insn32 a2t1_ldr_insn = 0xe59fc000;
24-static const insn32 a2t2_bx_r12_insn = 0xe12fff1c;
25-static const insn32 a2t3_func_addr_insn = 0x00000001;
26+#define ARM2THUMB_GLUE_SIZE 16
27+static const insn32 a2t1_ldr_insn = 0xe59fc004;
28+static const insn32 a2t2_add_r12_insn = 0xe08fc00c;
29+static const insn32 a2t3_bx_r12_insn = 0xe12fff1c;
30
31 /* Thumb->ARM: Thumb->(non-interworking aware) ARM
32
33@@ -2187,6 +2188,8 @@
34
35 if ((my_offset & 0x01) == 0x01)
36 {
37+ long int ret_offset;
38+
39 if (sym_sec != NULL
40 && sym_sec->owner != NULL
41 && !INTERWORK_FLAG (sym_sec->owner))
42@@ -2203,12 +2206,31 @@
43 bfd_put_32 (output_bfd, (bfd_vma) a2t1_ldr_insn,
44 s->contents + my_offset);
45
46- bfd_put_32 (output_bfd, (bfd_vma) a2t2_bx_r12_insn,
47+ bfd_put_32 (output_bfd, (bfd_vma) a2t2_add_r12_insn,
48 s->contents + my_offset + 4);
49
50- /* It's a thumb address. Add the low order bit. */
51- bfd_put_32 (output_bfd, val | a2t3_func_addr_insn,
52+ bfd_put_32 (output_bfd, (bfd_vma) a2t3_bx_r12_insn,
53 s->contents + my_offset + 8);
54+
55+ /* Calculate the offset to the actual function. */
56+ ret_offset =
57+ /* Address of destination of the stub. */
58+ ((bfd_signed_vma) val)
59+ - ((bfd_signed_vma)
60+ /* Offset from the start of the current section
61+ to the start of the stubs. */
62+ (s->output_offset
63+ /* Offset of the start of this stub from the start of the stubs. */
64+ + my_offset
65+ /* Address of the start of the current section. */
66+ + s->output_section->vma)
67+ /* The word is 12 bytes into the stub. */
68+ + 12
69+ /* The destination is a thumb function so the bottom bit must be set. */
70+ - 1);
71+
72+ bfd_put_32 (output_bfd, (bfd_vma) ret_offset,
73+ s->contents + my_offset + 12);
74 }
75
76 BFD_ASSERT (my_offset <= globals->arm_glue_size);
diff --git a/meta/packages/binutils/binutils-2.16/binutils-2.16-thumb-trampoline.patch b/meta/packages/binutils/binutils-2.16/binutils-2.16-thumb-trampoline.patch
new file mode 100644
index 0000000000..a4f90a7254
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.16/binutils-2.16-thumb-trampoline.patch
@@ -0,0 +1,292 @@
1--- binutils-2.16/.pc/binutils-2.16-thumb-trampoline.patch/bfd/elf32-arm.c 2005-05-02 12:43:06.000000000 -0700
2+++ binutils-2.16/bfd/elf32-arm.c 2005-09-19 22:58:49.834931044 -0700
3@@ -24,6 +24,8 @@
4 #include "libbfd.h"
5 #include "elf-bfd.h"
6
7+#define NOTE_DEBUG 0
8+
9 #ifndef NUM_ELEM
10 #define NUM_ELEM(a) (sizeof (a) / (sizeof (a)[0]))
11 #endif
12@@ -1127,6 +1129,10 @@
13 used, we need to record the index into .got.plt instead of
14 recomputing it from the PLT offset. */
15 bfd_signed_vma plt_got_offset;
16+
17+ /* This is used to sanity check that the Thumb trampoline space
18+ really was allocated. */
19+ int accomodate_trampoline;
20 };
21
22 /* Traverse an arm ELF linker hash table. */
23@@ -1219,9 +1225,15 @@
24 table, string));
25 if (ret != NULL)
26 {
27+#if NOTE_DEBUG
28+ _bfd_error_handler(
29+ _("NOTE: %x(%s): New hash entry (plt refcount %d)"),
30+ ret, string, ret->root.plt.refcount);
31+#endif
32 ret->relocs_copied = NULL;
33 ret->plt_thumb_refcount = 0;
34 ret->plt_got_offset = -1;
35+ ret->accomodate_trampoline = 0;
36 }
37
38 return (struct bfd_hash_entry *) ret;
39@@ -1335,16 +1347,38 @@
40 eind->relocs_copied = NULL;
41 }
42
43- /* If the direct symbol already has an associated PLT entry, the
44- indirect symbol should not. If it doesn't, swap refcount information
45- from the indirect symbol. */
46- if (edir->plt_thumb_refcount == 0)
47+ if (ind->root.type == bfd_link_hash_indirect)
48 {
49- edir->plt_thumb_refcount = eind->plt_thumb_refcount;
50- eind->plt_thumb_refcount = 0;
51+ bfd_signed_vma tmp;
52+ bfd_signed_vma lowest_valid = bed->can_refcount;
53+
54+ /* If the direct symbol already has an associated PLT entry, the
55+ indirect symbol should not. If it doesn't, swap refcount information
56+ from the indirect symbol. */
57+#if NOTE_DEBUG
58+ _bfd_error_handler(_("NOTE: %x(%s,%d,%d) <== %x(%s,%d,%d)"),
59+ dir, dir->root.root.string, dir->plt.refcount, edir->plt_thumb_refcount,
60+ ind, ind->root.root.string, ind->plt.refcount, eind->plt_thumb_refcount);
61+#endif
62+
63+ /* Copy over the global and procedure linkage table refcount entries.
64+ These may have been already set up by a check_relocs routine. This
65+ code duplicates that for the plt refcount in elf.c
66+ _bfd_elf_link_hash_copy_indirect */
67+ tmp = dir->plt.refcount;
68+ /* this obfuscated test evaluates to bed->can_refcount && plt.refcount == 0
69+ * || plt.refcount < 0.
70+ */
71+ if (tmp < lowest_valid)
72+ {
73+ tmp = edir->plt_thumb_refcount;
74+ edir->plt_thumb_refcount = eind->plt_thumb_refcount;
75+ eind->plt_thumb_refcount = tmp;
76+ BFD_ASSERT(eind->accomodate_trampoline == 0);
77+ }
78+ else
79+ BFD_ASSERT (eind->plt_thumb_refcount == 0);
80 }
81- else
82- BFD_ASSERT (eind->plt_thumb_refcount == 0);
83
84 _bfd_elf_link_hash_copy_indirect (bed, dir, ind);
85 }
86@@ -2060,7 +2094,7 @@
87 (*_bfd_error_handler)
88 (_("%B(%s): warning: interworking not enabled.\n"
89 " first occurrence: %B: thumb call to arm"),
90- sym_sec->owner, input_bfd, name);
91+ sym_sec->owner, name, input_bfd);
92
93 return FALSE;
94 }
95@@ -2165,7 +2199,7 @@
96 (*_bfd_error_handler)
97 (_("%B(%s): warning: interworking not enabled.\n"
98 " first occurrence: %B: arm call to thumb"),
99- sym_sec->owner, input_bfd, name);
100+ sym_sec->owner, name, input_bfd);
101 }
102
103 --my_offset;
104@@ -2481,7 +2515,7 @@
105 instruction instead ? */
106 if (sym_flags != STT_ARM_TFUNC)
107 (*_bfd_error_handler)
108- (_("\%B: Warning: Arm BLX instruction targets Arm function '%s'."),
109+ (_("%B: Warning: Arm BLX instruction targets Arm function '%s'."),
110 input_bfd,
111 h ? h->root.root.string : "(local)");
112 }
113@@ -2697,6 +2731,20 @@
114 /* Handle calls via the PLT. */
115 if (h != NULL && splt != NULL && h->plt.offset != (bfd_vma) -1)
116 {
117+ struct elf32_arm_link_hash_entry *eh;
118+ eh = (struct elf32_arm_link_hash_entry *) h;
119+ if (!eh->accomodate_trampoline)
120+ {
121+ /* %B of output_bfd crashes here, so %x is used instead */
122+ _bfd_error_handler(
123+ _("ERROR: %B: %x(%s): missing thumb trampoline, refcount(thumb %d, plt %d) in %x at %x+%x+%x"),
124+ input_bfd, h, h->root.root.string, eh->plt_thumb_refcount,
125+ h->plt.refcount, output_bfd, splt->output_section->vma,
126+ splt->output_offset, h->plt.offset);
127+ /* The relocation would point to garbage, it gets skipped... */
128+ return bfd_reloc_dangerous;
129+ }
130+
131 value = (splt->output_section->vma
132 + splt->output_offset
133 + h->plt.offset);
134@@ -3525,8 +3573,9 @@
135 {
136 _bfd_error_handler
137 (_("ERROR: Source object %B has EABI version %d, but target %B has EABI version %d"),
138- ibfd, obfd,
139+ ibfd,
140 (in_flags & EF_ARM_EABIMASK) >> 24,
141+ obfd,
142 (out_flags & EF_ARM_EABIMASK) >> 24);
143 return FALSE;
144 }
145@@ -3538,8 +3587,9 @@
146 {
147 _bfd_error_handler
148 (_("ERROR: %B is compiled for APCS-%d, whereas target %B uses APCS-%d"),
149- ibfd, obfd,
150+ ibfd,
151 in_flags & EF_ARM_APCS_26 ? 26 : 32,
152+ obfd,
153 out_flags & EF_ARM_APCS_26 ? 26 : 32);
154 flags_compatible = FALSE;
155 }
156@@ -3903,10 +3953,18 @@
157 eh = (struct elf32_arm_link_hash_entry *) h;
158
159 if (h->plt.refcount > 0)
160+ h->plt.refcount -= 1;
161+
162+ if (ELF32_R_TYPE (rel->r_info) == R_ARM_THM_PC22)
163 {
164- h->plt.refcount -= 1;
165- if (ELF32_R_TYPE (rel->r_info) == R_ARM_THM_PC22)
166- eh->plt_thumb_refcount--;
167+ BFD_ASSERT (eh->plt_thumb_refcount > 0);
168+ eh->plt_thumb_refcount--;
169+ BFD_ASSERT (eh->accomodate_trampoline == 0);
170+#if NOTE_DEBUG
171+ _bfd_error_handler(
172+ _("NOTE: %B: %x(%s): Thumb refcount decremented to %d (plt refcount %d)"),
173+ abfd, h, h->root.root.string, eh->plt_thumb_refcount, h->plt.refcount);
174+#endif
175 }
176
177 if (r_type == R_ARM_ABS32
178@@ -3994,6 +4052,10 @@
179 h = sym_hashes[r_symndx - symtab_hdr->sh_info];
180
181 eh = (struct elf32_arm_link_hash_entry *) h;
182+#if NOTE_DEBUG
183+ if (h != NULL)
184+ _bfd_error_handler(_("NOTE: %B: %x(%s): verify relocation"), abfd, h, h->root.root.string);
185+#endif
186
187 switch (r_type)
188 {
189@@ -4078,10 +4140,30 @@
190
191 /* If we create a PLT entry, this relocation will reference
192 it, even if it's an ABS32 relocation. */
193- h->plt.refcount += 1;
194+ if (h->plt.refcount >= 0)
195+ h->plt.refcount += 1;
196+ else
197+ {
198+ /* This happens, I suspect it happens with glue code because,
199+ * somehow, the backend data had can_refcount==0. Expert required...
200+ */
201+ _bfd_error_handler(
202+ _("WARNING: %B: %x(%s): PLT refcount was %d (set to 1)"),
203+ abfd, h, h->root.root.string, h->plt.refcount);
204+ h->plt.refcount = 1;
205+ }
206
207 if (r_type == R_ARM_THM_PC22)
208- eh->plt_thumb_refcount += 1;
209+ {
210+ eh->plt_thumb_refcount += 1;
211+ BFD_ASSERT (eh->plt_thumb_refcount <= h->plt.refcount);
212+ BFD_ASSERT (eh->accomodate_trampoline == 0);
213+#if NOTE_DEBUG
214+ _bfd_error_handler(
215+ _("NOTE: %B: %x(%s): Thumb refcount incremented to %d (plt refcount %d)"),
216+ abfd, h, h->root.root.string, eh->plt_thumb_refcount, h->plt.refcount);
217+#endif
218+ }
219 }
220
221 /* If we are creating a shared library or relocatable executable,
222@@ -4376,8 +4458,15 @@
223 object, or if all references were garbage collected. In
224 such a case, we don't actually need to build a procedure
225 linkage table, and we can just do a PC24 reloc instead. */
226+#if NOTE_DEBUG
227+ _bfd_error_handler(
228+ _("NOTE: %x(%s): Thumb refcount zeroed (plt refcount %d, thumb %d) (%s)"),
229+ h, h->root.root.string, h->plt.refcount, eh->plt_thumb_refcount,
230+ SYMBOL_CALLS_LOCAL (info, h) ? "local call" : "invisible");
231+#endif
232 h->plt.offset = (bfd_vma) -1;
233 eh->plt_thumb_refcount = 0;
234+ BFD_ASSERT (eh->accomodate_trampoline == 0);
235 h->needs_plt = 0;
236 }
237
238@@ -4390,8 +4479,14 @@
239 in check_relocs. We can't decide accurately between function
240 and non-function syms in check-relocs; Objects loaded later in
241 the link may change h->type. So fix it now. */
242+#if NOTE_DEBUG
243+ _bfd_error_handler(
244+ _("NOTE: %x(%s): Thumb refcount zeroed (%d, plt refcount %d)"),
245+ h, h->root.root.string, eh->plt_thumb_refcount, h->plt.refcount);
246+#endif
247 h->plt.offset = (bfd_vma) -1;
248 eh->plt_thumb_refcount = 0;
249+ BFD_ASSERT (eh->accomodate_trampoline == 0);
250 }
251
252 /* If this is a weak symbol, and there is a real definition, the
253@@ -4521,8 +4616,14 @@
254 for it. */
255 if (!htab->symbian_p && eh->plt_thumb_refcount > 0)
256 {
257+#if NOTE_DEBUG
258+ _bfd_error_handler(_("NOTE: %x(%s): Thumb trampoline created at %x"),
259+ h, h->root.root.string, h->plt.offset);
260+#endif
261 h->plt.offset += PLT_THUMB_STUB_SIZE;
262 s->size += PLT_THUMB_STUB_SIZE;
263+ BFD_ASSERT (eh->accomodate_trampoline == 0);
264+ eh->accomodate_trampoline = 1;
265 }
266
267 /* If this symbol is not defined in a regular file, and we are
268@@ -5014,10 +5115,20 @@
269
270 if (eh->plt_thumb_refcount > 0)
271 {
272- bfd_put_16 (output_bfd, elf32_arm_plt_thumb_stub[0],
273- splt->contents + h->plt.offset - 4);
274- bfd_put_16 (output_bfd, elf32_arm_plt_thumb_stub[1],
275- splt->contents + h->plt.offset - 2);
276+ if (eh->accomodate_trampoline == 1)
277+ {
278+ bfd_put_16 (output_bfd, elf32_arm_plt_thumb_stub[0],
279+ splt->contents + h->plt.offset - 4);
280+ bfd_put_16 (output_bfd, elf32_arm_plt_thumb_stub[1],
281+ splt->contents + h->plt.offset - 2);
282+ }
283+ else
284+ {
285+ (*_bfd_error_handler) (
286+ _("%B: no space for THUMB trampoline at %x[%x]"),
287+ output_bfd, h->plt.offset, got_offset);
288+ return FALSE;
289+ }
290 }
291
292 bfd_put_32 (output_bfd, elf32_arm_plt_entry[0] | ((got_displacement & 0x0ff00000) >> 20),
diff --git a/meta/packages/binutils/binutils-cross.inc b/meta/packages/binutils/binutils-cross.inc
new file mode 100644
index 0000000000..c63ea687aa
--- /dev/null
+++ b/meta/packages/binutils/binutils-cross.inc
@@ -0,0 +1,30 @@
1SECTION = "devel"
2inherit cross
3DEPENDS += "flex-native bison-native"
4PROVIDES = "virtual/${TARGET_PREFIX}binutils"
5PACKAGES = ""
6EXTRA_OECONF = "--with-sysroot=${CROSS_DIR}/${TARGET_SYS} \
7 --program-prefix=${TARGET_PREFIX}"
8
9do_stage () {
10 oe_runmake install
11
12 # We don't really need these, so we'll remove them...
13 rm -rf ${CROSS_DIR}/lib/ldscripts
14 rm -rf ${CROSS_DIR}/share/info
15 rm -rf ${CROSS_DIR}/share/locale
16 rm -rf ${CROSS_DIR}/share/man
17 rmdir ${CROSS_DIR}/share || :
18 rmdir ${CROSS_DIR}/${libdir}/gcc-lib || :
19 rmdir ${CROSS_DIR}/${libdir} || :
20 rmdir ${CROSS_DIR}/${prefix} || :
21
22 # We want to move this into the target specific location
23 mkdir -p ${CROSS_DIR}/${TARGET_SYS}/lib
24 mv -f ${CROSS_DIR}/lib/libiberty.a ${CROSS_DIR}/${TARGET_SYS}/lib
25 rmdir ${CROSS_DIR}/lib || :
26}
27
28do_install () {
29 :
30}
diff --git a/meta/packages/binutils/binutils-cross_2.15.94.0.1.bb b/meta/packages/binutils/binutils-cross_2.15.94.0.1.bb
new file mode 100644
index 0000000000..7e165271d7
--- /dev/null
+++ b/meta/packages/binutils/binutils-cross_2.15.94.0.1.bb
@@ -0,0 +1,32 @@
1SECTION = "devel"
2include binutils_${PV}.bb
3inherit cross
4DEPENDS += "flex-native bison-native"
5PROVIDES = "virtual/${TARGET_PREFIX}binutils"
6FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-${PV}"
7PACKAGES = ""
8EXTRA_OECONF = "--with-sysroot=${CROSS_DIR}/${TARGET_SYS} \
9 --program-prefix=${TARGET_PREFIX}"
10
11do_stage () {
12 oe_runmake install
13
14 # We don't really need these, so we'll remove them...
15 rm -rf ${CROSS_DIR}/lib/ldscripts
16 rm -rf ${CROSS_DIR}/share/info
17 rm -rf ${CROSS_DIR}/share/locale
18 rm -rf ${CROSS_DIR}/share/man
19 rmdir ${CROSS_DIR}/share || :
20 rmdir ${CROSS_DIR}/${libdir}/gcc-lib || :
21 rmdir ${CROSS_DIR}/${libdir} || :
22 rmdir ${CROSS_DIR}/${prefix} || :
23
24 # We want to move this into the target specific location
25 mkdir -p ${CROSS_DIR}/${TARGET_SYS}/lib
26 mv -f ${CROSS_DIR}/lib/libiberty.a ${CROSS_DIR}/${TARGET_SYS}/lib
27 rmdir ${CROSS_DIR}/lib || :
28}
29
30do_install () {
31 :
32}
diff --git a/meta/packages/binutils/binutils-cross_2.16.91.0.7.bb b/meta/packages/binutils/binutils-cross_2.16.91.0.7.bb
new file mode 100644
index 0000000000..7e165271d7
--- /dev/null
+++ b/meta/packages/binutils/binutils-cross_2.16.91.0.7.bb
@@ -0,0 +1,32 @@
1SECTION = "devel"
2include binutils_${PV}.bb
3inherit cross
4DEPENDS += "flex-native bison-native"
5PROVIDES = "virtual/${TARGET_PREFIX}binutils"
6FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-${PV}"
7PACKAGES = ""
8EXTRA_OECONF = "--with-sysroot=${CROSS_DIR}/${TARGET_SYS} \
9 --program-prefix=${TARGET_PREFIX}"
10
11do_stage () {
12 oe_runmake install
13
14 # We don't really need these, so we'll remove them...
15 rm -rf ${CROSS_DIR}/lib/ldscripts
16 rm -rf ${CROSS_DIR}/share/info
17 rm -rf ${CROSS_DIR}/share/locale
18 rm -rf ${CROSS_DIR}/share/man
19 rmdir ${CROSS_DIR}/share || :
20 rmdir ${CROSS_DIR}/${libdir}/gcc-lib || :
21 rmdir ${CROSS_DIR}/${libdir} || :
22 rmdir ${CROSS_DIR}/${prefix} || :
23
24 # We want to move this into the target specific location
25 mkdir -p ${CROSS_DIR}/${TARGET_SYS}/lib
26 mv -f ${CROSS_DIR}/lib/libiberty.a ${CROSS_DIR}/${TARGET_SYS}/lib
27 rmdir ${CROSS_DIR}/lib || :
28}
29
30do_install () {
31 :
32}
diff --git a/meta/packages/binutils/binutils-cross_2.16.bb b/meta/packages/binutils/binutils-cross_2.16.bb
new file mode 100644
index 0000000000..df0f17b1ef
--- /dev/null
+++ b/meta/packages/binutils/binutils-cross_2.16.bb
@@ -0,0 +1,3 @@
1FILESDIR = "${@os.path.dirname(bb.data.getVar('FILE',d,1))}/binutils-${PV}"
2include binutils_${PV}.bb
3include binutils-cross.inc
diff --git a/meta/packages/binutils/binutils.inc b/meta/packages/binutils/binutils.inc
new file mode 100644
index 0000000000..680e579a06
--- /dev/null
+++ b/meta/packages/binutils/binutils.inc
@@ -0,0 +1,117 @@
1inherit autotools gettext
2
3PACKAGES = "${PN} ${PN}-dev ${PN}-doc ${PN}-symlinks"
4
5FILES_${PN} = " \
6 ${bindir}/${TARGET_PREFIX}* \
7 ${libdir}/lib*-*.so \
8 ${prefix}/${TARGET_SYS}/bin/*"
9
10FILES_${PN}-dev = " \
11 ${includedir} \
12 ${libdir}/*.a \
13 ${libdir}/*.la \
14 ${libdir}/libbfd.so \
15 ${libdir}/libopcodes.so"
16
17FILES_${PN}-symlinks = " \
18 ${bindir}/addr2line \
19 ${bindir}/as \
20 ${bindir}/c++filt \
21 ${bindir}/gprof \
22 ${bindir}/ld \
23 ${bindir}/nm \
24 ${bindir}/objcopy \
25 ${bindir}/objdump \
26 ${bindir}/ranlib \
27 ${bindir}/readelf \
28 ${bindir}/size \
29 ${bindir}/strip"
30
31EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
32 --enable-shared"
33
34# This is necessary due to a bug in the binutils Makefiles
35EXTRA_OEMAKE = "configure-build-libiberty all"
36
37export AR = "${HOST_PREFIX}ar"
38export AS = "${HOST_PREFIX}as"
39export LD = "${HOST_PREFIX}ld"
40export NM = "${HOST_PREFIX}nm"
41export RANLIB = "${HOST_PREFIX}ranlib"
42export OBJCOPY = "${HOST_PREFIX}objcopy"
43export OBJDUMP = "${HOST_PREFIX}objdump"
44
45export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
46export AS_FOR_TARGET = "${TARGET_PREFIX}as"
47export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
48export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
49export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
50
51export CC_FOR_HOST = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
52export CXX_FOR_HOST = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
53
54export CC_FOR_BUILD = "${BUILD_CC}"
55export CPP_FOR_BUILD = "${BUILD_CPP}"
56export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
57
58export CC = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
59
60do_configure () {
61 (cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
62 oe_runconf
63}
64
65do_stage () {
66 oe_libinstall -so -a -C opcodes libopcodes ${STAGING_LIBDIR}/
67 oe_libinstall -a -C libiberty libiberty ${STAGING_LIBDIR}/
68 oe_libinstall -so -a -C bfd libbfd ${STAGING_LIBDIR}/
69 install -m 0644 ${S}/include/dis-asm.h ${STAGING_INCDIR}/
70 install -m 0644 ${S}/include/symcat.h ${STAGING_INCDIR}/
71 install -m 0644 ${S}/include/libiberty.h ${STAGING_INCDIR}/
72 install -m 0644 ${S}/include/ansidecl.h ${STAGING_INCDIR}/
73 install -m 0644 ${S}/include/bfdlink.h ${STAGING_INCDIR}/
74 install -m 0644 bfd/bfd.h ${STAGING_INCDIR}/
75}
76
77do_install () {
78 autotools_do_install
79
80 # We don't really need these, so we'll remove them...
81 rm -rf ${D}${libdir}/ldscripts
82
83 # Fix the /usr/${TARGET_SYS}/bin/* links
84 for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
85 rm -f $l
86 ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
87 | tr -s / \
88 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
89 done
90
91 # Install the libiberty header
92 install -d ${D}${includedir}
93 install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
94 install -m 644 ${S}/include/libiberty.h ${D}${includedir}
95
96 cd ${D}${bindir}
97
98 # Symlinks for ease of running these on the native target
99 for p in ${TARGET_SYS}-* ; do
100 ln -sf $p `echo $p | sed -e s,${TARGET_SYS}-,,`
101 done
102
103 rm ${D}${bindir}/ar ${D}${bindir}/strings
104}
105
106
107pkg_postinst_${PN}-symlinks () {
108 update-alternatives --install ${bindir}/ar ar ${TARGET_SYS}-ar 100
109 update-alternatives --install ${bindir}/strings strings ${TARGET_SYS}-strings 100
110}
111
112
113pkg_prerm_${PN}-symlinks () {
114 update-alternatives --remove ar ${TARGET_SYS}-ar
115 update-alternatives --remove strings ${TARGET_SYS}-strings
116}
117
diff --git a/meta/packages/binutils/binutils_2.15.94.0.1.bb b/meta/packages/binutils/binutils_2.15.94.0.1.bb
new file mode 100644
index 0000000000..2b2996abe6
--- /dev/null
+++ b/meta/packages/binutils/binutils_2.15.94.0.1.bb
@@ -0,0 +1,124 @@
1DESCRIPTION = "A GNU collection of binary utilities"
2HOMEPAGE = "http://www.gnu.org/software/binutils/"
3SECTION = "devel"
4LICENSE = "GPL"
5MAINTAINER = "Gerald Britton <gbritton@doomcom.org>"
6PR = "r2"
7
8inherit autotools gettext
9
10PACKAGES = "${PN} ${PN}-dev ${PN}-doc ${PN}-symlinks"
11
12FILES_${PN} = " \
13 ${bindir}/${TARGET_PREFIX}* \
14 ${libdir}/lib*-*.so \
15 ${prefix}/${TARGET_SYS}/bin/*"
16
17FILES_${PN}-dev = " \
18 ${includedir} \
19 ${libdir}/*.a \
20 ${libdir}/*.la \
21 ${libdir}/libbfd.so \
22 ${libdir}/libopcodes.so"
23
24FILES_${PN}-symlinks = " \
25 ${bindir}/addr2line \
26 ${bindir}/ar \
27 ${bindir}/as \
28 ${bindir}/c++filt \
29 ${bindir}/gprof \
30 ${bindir}/ld \
31 ${bindir}/nm \
32 ${bindir}/objcopy \
33 ${bindir}/objdump \
34 ${bindir}/ranlib \
35 ${bindir}/readelf \
36 ${bindir}/size \
37 ${bindir}/strings \
38 ${bindir}/strip"
39
40SRC_URI = \
41 "http://ftp.kernel.org/pub/linux/devel/binutils/binutils-${PV}.tar.bz2 \
42 file://ld_makefile.patch;patch=1 \
43 file://better_file_error.patch;patch=1 \
44 file://signed_char_fix.patch;patch=1 \
45 file://objdump_fix.patch;patch=1 \
46 file://binutils-100_cflags_for_build.patch;patch=1 \
47 file://binutils-2.15.91.0.1-uclibc-100-conf.patch;patch=1 \
48 file://binutils-2.15.90.0.3-uclibc-200-build_modules.patch;patch=1"
49
50S = "${WORKDIR}/binutils-${PV}"
51B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
52
53EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
54 --enable-shared"
55
56# This is necessary due to a bug in the binutils Makefiles
57EXTRA_OEMAKE = "configure-build-libiberty all"
58
59export AR = "${HOST_PREFIX}ar"
60export AS = "${HOST_PREFIX}as"
61export LD = "${HOST_PREFIX}ld"
62export NM = "${HOST_PREFIX}nm"
63export RANLIB = "${HOST_PREFIX}ranlib"
64export OBJCOPY = "${HOST_PREFIX}objcopy"
65export OBJDUMP = "${HOST_PREFIX}objdump"
66
67export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
68export AS_FOR_TARGET = "${TARGET_PREFIX}as"
69export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
70export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
71export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
72
73export CC_FOR_HOST = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
74export CXX_FOR_HOST = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
75
76export CC_FOR_BUILD = "${BUILD_CC}"
77export CPP_FOR_BUILD = "${BUILD_CPP}"
78export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
79
80export CC = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
81
82do_configure () {
83 (cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
84 oe_runconf
85}
86
87do_stage () {
88 oe_libinstall -so -a -C opcodes libopcodes ${STAGING_LIBDIR}/
89 oe_libinstall -a -C libiberty libiberty ${STAGING_LIBDIR}/
90 oe_libinstall -so -a -C bfd libbfd ${STAGING_LIBDIR}/
91 install -m 0644 ${S}/include/dis-asm.h ${STAGING_INCDIR}/
92 install -m 0644 ${S}/include/symcat.h ${STAGING_INCDIR}/
93 install -m 0644 ${S}/include/libiberty.h ${STAGING_INCDIR}/
94 install -m 0644 ${S}/include/ansidecl.h ${STAGING_INCDIR}/
95 install -m 0644 ${S}/include/bfdlink.h ${STAGING_INCDIR}/
96 install -m 0644 bfd/bfd.h ${STAGING_INCDIR}/
97}
98
99do_install () {
100 autotools_do_install
101
102 # We don't really need these, so we'll remove them...
103 rm -rf ${D}${libdir}/ldscripts
104
105 # Fix the /usr/${TARGET_SYS}/bin/* links
106 for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
107 rm -f $l
108 ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
109 | tr -s / \
110 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
111 done
112
113 # Install the libiberty header
114 install -d ${D}${includedir}
115 install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
116 install -m 644 ${S}/include/libiberty.h ${D}${includedir}
117
118 cd ${D}${bindir}
119
120 # Symlinks for ease of running these on the native target
121 for p in ${TARGET_SYS}-* ; do
122 ln -sf $p `echo $p | sed -e s,${TARGET_SYS}-,,`
123 done
124}
diff --git a/meta/packages/binutils/binutils_2.16.91.0.7.bb b/meta/packages/binutils/binutils_2.16.91.0.7.bb
new file mode 100644
index 0000000000..664fce8cb7
--- /dev/null
+++ b/meta/packages/binutils/binutils_2.16.91.0.7.bb
@@ -0,0 +1,123 @@
1DESCRIPTION = "A GNU collection of binary utilities"
2HOMEPAGE = "http://www.gnu.org/software/binutils/"
3SECTION = "devel"
4LICENSE = "GPL"
5DEFAULT_PREFERENCE = "-1"
6
7inherit autotools gettext
8
9PACKAGES = "${PN} ${PN}-dev ${PN}-doc ${PN}-symlinks"
10
11FILES_${PN} = " \
12 ${bindir}/${TARGET_PREFIX}* \
13 ${libdir}/lib*-*.so \
14 ${prefix}/${TARGET_SYS}/bin/*"
15
16FILES_${PN}-dev = " \
17 ${includedir} \
18 ${libdir}/*.a \
19 ${libdir}/*.la \
20 ${libdir}/libbfd.so \
21 ${libdir}/libopcodes.so"
22
23FILES_${PN}-symlinks = " \
24 ${bindir}/addr2line \
25 ${bindir}/ar \
26 ${bindir}/as \
27 ${bindir}/c++filt \
28 ${bindir}/gprof \
29 ${bindir}/ld \
30 ${bindir}/nm \
31 ${bindir}/objcopy \
32 ${bindir}/objdump \
33 ${bindir}/ranlib \
34 ${bindir}/readelf \
35 ${bindir}/size \
36 ${bindir}/strings \
37 ${bindir}/strip"
38
39SRC_URI = \
40 "http://ftp.kernel.org/pub/linux/devel/binutils/binutils-${PV}.tar.bz2 \
41 file://binutils-2.16.91.0.6-objcopy-rename-errorcode.patch;patch=1 \
42 file://binutils-uclibc-100-uclibc-conf.patch;patch=1 \
43 file://binutils-uclibc-300-001_ld_makefile_patch.patch;patch=1 \
44 file://binutils-uclibc-300-006_better_file_error.patch;patch=1 \
45 file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
46 file://binutils-uclibc-400-mips-ELF_MAXPAGESIZE-4K.patch;patch=1 \
47 file://binutils-uclibc-702-binutils-skip-comments.patch;patch=1"
48
49S = "${WORKDIR}/binutils-${PV}"
50B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
51
52EXTRA_OECONF = "--program-prefix=${TARGET_PREFIX} \
53 --enable-shared"
54
55# This is necessary due to a bug in the binutils Makefiles
56EXTRA_OEMAKE = "configure-build-libiberty all"
57
58export AR = "${HOST_PREFIX}ar"
59export AS = "${HOST_PREFIX}as"
60export LD = "${HOST_PREFIX}ld"
61export NM = "${HOST_PREFIX}nm"
62export RANLIB = "${HOST_PREFIX}ranlib"
63export OBJCOPY = "${HOST_PREFIX}objcopy"
64export OBJDUMP = "${HOST_PREFIX}objdump"
65
66export AR_FOR_TARGET = "${TARGET_PREFIX}ar"
67export AS_FOR_TARGET = "${TARGET_PREFIX}as"
68export LD_FOR_TARGET = "${TARGET_PREFIX}ld"
69export NM_FOR_TARGET = "${TARGET_PREFIX}nm"
70export RANLIB_FOR_TARGET = "${TARGET_PREFIX}ranlib"
71
72export CC_FOR_HOST = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
73export CXX_FOR_HOST = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
74
75export CC_FOR_BUILD = "${BUILD_CC}"
76export CPP_FOR_BUILD = "${BUILD_CPP}"
77export CFLAGS_FOR_BUILD = "${BUILD_CFLAGS}"
78
79export CC = "${CCACHE} ${HOST_PREFIX}gcc ${HOST_CC_ARCH}"
80
81do_configure () {
82 (cd ${S}; gnu-configize) || die "Failed to run gnu-configize"
83 oe_runconf
84}
85
86do_stage () {
87 oe_libinstall -so -a -C opcodes libopcodes ${STAGING_LIBDIR}/
88 oe_libinstall -a -C libiberty libiberty ${STAGING_LIBDIR}/
89 oe_libinstall -so -a -C bfd libbfd ${STAGING_LIBDIR}/
90 install -m 0644 ${S}/include/dis-asm.h ${STAGING_INCDIR}/
91 install -m 0644 ${S}/include/symcat.h ${STAGING_INCDIR}/
92 install -m 0644 ${S}/include/libiberty.h ${STAGING_INCDIR}/
93 install -m 0644 ${S}/include/ansidecl.h ${STAGING_INCDIR}/
94 install -m 0644 ${S}/include/bfdlink.h ${STAGING_INCDIR}/
95 install -m 0644 bfd/bfd.h ${STAGING_INCDIR}/
96}
97
98do_install () {
99 autotools_do_install
100
101 # We don't really need these, so we'll remove them...
102 rm -rf ${D}${libdir}/ldscripts
103
104 # Fix the /usr/${TARGET_SYS}/bin/* links
105 for l in ${D}${prefix}/${TARGET_SYS}/bin/*; do
106 rm -f $l
107 ln -sf `echo ${prefix}/${TARGET_SYS}/bin \
108 | tr -s / \
109 | sed -e 's,^/,,' -e 's,[^/]*,..,g'`${bindir}/${TARGET_PREFIX}`basename $l` $l
110 done
111
112 # Install the libiberty header
113 install -d ${D}${includedir}
114 install -m 644 ${S}/include/ansidecl.h ${D}${includedir}
115 install -m 644 ${S}/include/libiberty.h ${D}${includedir}
116
117 cd ${D}${bindir}
118
119 # Symlinks for ease of running these on the native target
120 for p in ${TARGET_SYS}-* ; do
121 ln -sf $p `echo $p | sed -e s,${TARGET_SYS}-,,`
122 done
123}
diff --git a/meta/packages/binutils/binutils_2.16.bb b/meta/packages/binutils/binutils_2.16.bb
new file mode 100644
index 0000000000..5b936dcc66
--- /dev/null
+++ b/meta/packages/binutils/binutils_2.16.bb
@@ -0,0 +1,26 @@
1DESCRIPTION = "A GNU collection of binary utilities"
2HOMEPAGE = "http://www.gnu.org/software/binutils/"
3SECTION = "devel"
4LICENSE = "GPL"
5MAINTAINER = "Gerald Britton <gbritton@doomcom.org>"
6PR = "r7"
7
8SRC_URI = \
9 "http://ftp.gnu.org/gnu/binutils/binutils-${PV}.tar.bz2 \
10 file://ld_makefile.patch;patch=1 \
11 file://better_file_error.patch;patch=1 \
12 file://signed_char_fix.patch;patch=1 \
13 file://binutils-2.16-objcopy-rename-errorcode.patch;patch=1 \
14 file://binutils-100_cflags_for_build.patch;patch=1"
15
16# uclibc patches
17SRC_URI += "file://binutils-2.16-linux-uclibc.patch;patch=1"
18
19# thumb support patches
20SRC_URI += "file://binutils-2.16-thumb-trampoline.patch;patch=1"
21SRC_URI += "file://binutils-2.16-thumb-glue.patch;patch=1"
22
23S = "${WORKDIR}/binutils-${PV}"
24B = "${S}/build.${HOST_SYS}.${TARGET_SYS}"
25
26include binutils.inc
diff --git a/meta/packages/binutils/files/better_file_error.patch b/meta/packages/binutils/files/better_file_error.patch
new file mode 100644
index 0000000000..38ef52966e
--- /dev/null
+++ b/meta/packages/binutils/files/better_file_error.patch
@@ -0,0 +1,17 @@
1diff -urN binutils-2.11.92.0.5/bfd/opncls.c binutils-2.11.92.0.5.new/bfd/opncls.c
2--- binutils-2.11.92.0.5/bfd/opncls.c Mon Oct 1 18:25:21 2001
3+++ binutils-2.11.92.0.5.new/bfd/opncls.c Sat Oct 13 11:26:59 2001
4@@ -127,6 +127,13 @@
5 {
6 bfd *nbfd;
7 const bfd_target *target_vec;
8+ struct stat s;
9+
10+ if (stat (filename, &s) == 0)
11+ if (S_ISDIR(s.st_mode)) {
12+ bfd_set_error (bfd_error_file_not_recognized);
13+ return NULL;
14+ }
15
16 nbfd = _bfd_new_bfd ();
17 if (nbfd == NULL)
diff --git a/meta/packages/binutils/files/ld_makefile.patch b/meta/packages/binutils/files/ld_makefile.patch
new file mode 100644
index 0000000000..c1d2ac1ece
--- /dev/null
+++ b/meta/packages/binutils/files/ld_makefile.patch
@@ -0,0 +1,22 @@
1--- binutils-2.11.90.0.19.orig/ld/Makefile.am
2+++ binutils-2.11.90.0.19/ld/Makefile.am
3@@ -19,7 +19,7 @@
4 # We put the scripts in the directory $(scriptdir)/ldscripts.
5 # We can't put the scripts in $(datadir) because the SEARCH_DIR
6 # directives need to be different for native and cross linkers.
7-scriptdir = $(tooldir)/lib
8+scriptdir = $(libdir)
9
10 EMUL = @EMUL@
11 EMULATION_OFILES = @EMULATION_OFILES@
12--- binutils-2.11.90.0.19.orig/ld/Makefile.in
13+++ binutils-2.11.90.0.19/ld/Makefile.in
14@@ -123,7 +123,7 @@
15 # We put the scripts in the directory $(scriptdir)/ldscripts.
16 # We can't put the scripts in $(datadir) because the SEARCH_DIR
17 # directives need to be different for native and cross linkers.
18-scriptdir = $(tooldir)/lib
19+scriptdir = $(libdir)
20
21 EMUL = @EMUL@
22 EMULATION_OFILES = @EMULATION_OFILES@
diff --git a/meta/packages/binutils/files/objdump_fix.patch b/meta/packages/binutils/files/objdump_fix.patch
new file mode 100644
index 0000000000..90ad732c06
--- /dev/null
+++ b/meta/packages/binutils/files/objdump_fix.patch
@@ -0,0 +1,134 @@
1From binutils-return-38148-listarch-binutils=sources dot redhat dot com at sources dot redhat dot com Tue Feb 22 19:24:15 2005
2Return-Path: <binutils-return-38148-listarch-binutils=sources dot redhat dot com at sources dot redhat dot com>
3Delivered-To: listarch-binutils at sources dot redhat dot com
4Received: (qmail 4446 invoked by alias); 22 Feb 2005 19:24:15 -0000
5Mailing-List: contact binutils-help at sources dot redhat dot com; run by ezmlm
6Precedence: bulk
7List-Subscribe: <mailto:binutils-subscribe at sources dot redhat dot com>
8List-Archive: <http://sources.redhat.com/ml/binutils/>
9List-Post: <mailto:binutils at sources dot redhat dot com>
10List-Help: <mailto:binutils-help at sources dot redhat dot com>, <http://sources dot redhat dot com/ml/#faqs>
11Sender: binutils-owner at sources dot redhat dot com
12Delivered-To: mailing list binutils at sources dot redhat dot com
13Received: (qmail 4401 invoked from network); 22 Feb 2005 19:24:08 -0000
14Received: from unknown (HELO bgo1smout1.broadpark.no) (217.13.4.94)
15 by sourceware dot org with SMTP; 22 Feb 2005 19:24:08 -0000
16Received: from bgo1sminn1.broadpark.no ([217.13.4.93])
17 by bgo1smout1 dot broadpark dot no
18 (Sun Java System Messaging Server 6 dot 1 HotFix 0 dot 05 (built Oct 21 2004))
19 with ESMTP id <0ICB007QZUZCC0C0 at bgo1smout1 dot broadpark dot no> for
20 binutils at sources dot redhat dot com; Tue, 22 Feb 2005 20:18:48 +0100 (CET)
21Received: from [127.0.0.1] ([80.202.165.9]) by bgo1sminn1.broadpark.no
22 (Sun Java System Messaging Server 6 dot 1 HotFix 0 dot 05 (built Oct 21 2004))
23 with ESMTP id <0ICB006NCVBVHE21 at bgo1sminn1 dot broadpark dot no> for
24 binutils at sources dot redhat dot com; Tue, 22 Feb 2005 20:26:20 +0100 (CET)
25Date: Tue, 22 Feb 2005 20:24:08 +0100
26From: =?ISO-8859-1?Q?Stig_Petter_Olsr=F8d?= <stigpo at users dot sourceforge dot net>
27Subject: [PATCH] objdump relocation fixes for ARM disassembly
28To: binutils at sources dot redhat dot com
29Message-id: <421B86D8.8080604@users.sourceforge.net>
30MIME-version: 1.0
31Content-type: text/plain; charset=ISO-8859-1; format=flowed
32Content-transfer-encoding: 7BIT
33User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206)
34
35Hello,
36
37objdump disassembly did not relocate correctly for the ARM processor. It seems
38that the test for triggering the INSN_HAS_RELOC flag was void (one test killed the other,
39since octets would always be zero) and all relocations would thus fail. I changed the test
40so the flag is set when we are about to disassemble an insn that the current relocation
41entry points to. I also changed objdump_print_addr to use the current relocation entry if
42the insn has such an entry. This causes the symbol printed to be correct for both external
43symbols (from the undefined section) and local symbols.
44
45This has only been tested for the ARM processor, but I don't think it should break other
46DISASSEMBLER_NEEDS_RELOCS processors either.
47
48
49binutils/
50
512005-02-22 Stig Petter Olsroed <stigpo@users.sourceforge.net>
52
53 * objdump.c (disassemble_bytes): Fixed relocation check for
54 DISASSEMBLER_NEEDS_RELOCS platforms to properly trigger the
55 INSN_HAS_RELOC flag. Set the current relocation entry in
56 objdump_disasm_info to allow printing the proper symbol.
57 (objdump_print_addr): Use the relocation entry in
58 objdump_disasm_info to lookup the correct symbol for
59 DISASSEMBLER_NEEDS_RELOCS platforms.
60
61--- 1/binutils/objdump.c 2005-02-22 01:50:06.000000000 +0100
62+++ 2/binutils/objdump.c 2005-02-22 14:27:33.066960900 +0100
63@@ -128,6 +128,7 @@
64 arelent ** dynrelbuf;
65 long dynrelcount;
66 disassembler_ftype disassemble_fn;
67+ arelent * reloc;
68 };
69
70 /* Architecture to disassemble for, or default if NULL. */
71@@ -852,6 +853,8 @@
72 {
73 struct objdump_disasm_info *aux;
74 asymbol *sym;
75+ arelent *q;
76+ int skip_find = 0;
77
78 if (sorted_symcount < 1)
79 {
80@@ -861,6 +864,22 @@
81 }
82
83 aux = (struct objdump_disasm_info *) info->application_data;
84+
85+ q = aux->reloc;
86+ if (q != NULL)
87+ {
88+ if (q->sym_ptr_ptr != NULL && *q->sym_ptr_ptr != NULL)
89+ {
90+ /* Adjust the vma to the reloc */
91+ vma += bfd_asymbol_value (*q->sym_ptr_ptr);
92+ if (bfd_is_und_section (bfd_get_section (*q->sym_ptr_ptr)))
93+ {
94+ skip_find = 1;
95+ sym = *q->sym_ptr_ptr;
96+ }
97+ }
98+ }
99+ if (!skip_find)
100 sym = find_symbol_for_address (vma, info, NULL);
101 objdump_print_addr_with_sym (aux->abfd, aux->sec, sym, vma, info,
102 skip_zeroes);
103@@ -1350,16 +1369,22 @@
104 info->bytes_per_chunk = 0;
105
106 #ifdef DISASSEMBLER_NEEDS_RELOCS
107- /* FIXME: This is wrong. It tests the number of octets
108- in the last instruction, not the current one. */
109- if (*relppp < relppend
110- && (**relppp)->address >= rel_offset + addr_offset
111- && ((**relppp)->address
112- < rel_offset + addr_offset + octets / opb))
113+ /* Check if the current relocation entry applies to the
114+ instruction we are about to disassemble.
115+ This works for ARM at least.
116+ */
117+ if ((*relppp) < relppend
118+ && ((**relppp)->address == rel_offset + addr_offset))
119+ {
120 info->flags = INSN_HAS_RELOC;
121+ aux->reloc = **relppp;
122+ }
123 else
124 #endif
125+ {
126 info->flags = 0;
127+ aux->reloc = NULL;
128+ }
129
130 octets = (*disassemble_fn) (section->vma + addr_offset, info);
131 info->fprintf_func = (fprintf_ftype) fprintf;
132
133
134
diff --git a/meta/packages/binutils/files/plt32trunc.patch b/meta/packages/binutils/files/plt32trunc.patch
new file mode 100644
index 0000000000..4990f5dbb6
--- /dev/null
+++ b/meta/packages/binutils/files/plt32trunc.patch
@@ -0,0 +1,24 @@
1--- binutils/bfd/elf32-arm.h.orig 2004-04-22 22:11:15.000000000 -0400
2+++ binutils/bfd/elf32-arm.h 2004-04-22 22:28:37.000000000 -0400
3@@ -2229,6 +2229,8 @@ elf32_arm_relocate_section (output_bfd,
4 case R_ARM_PC24:
5 case R_ARM_ABS32:
6 case R_ARM_THM_PC22:
7+ case R_ARM_PLT32:
8+
9 if (info->shared
10 && (
11 (!info->symbolic && h->dynindx != -1)
12@@ -2262,11 +2264,6 @@ elf32_arm_relocate_section (output_bfd,
13 relocation = 0;
14 break;
15
16- case R_ARM_PLT32:
17- if (h->plt.offset != (bfd_vma)-1)
18- relocation = 0;
19- break;
20-
21 default:
22 if (unresolved_reloc)
23 _bfd_error_handler
24
diff --git a/meta/packages/binutils/files/signed_char_fix.patch b/meta/packages/binutils/files/signed_char_fix.patch
new file mode 100644
index 0000000000..b3709dabed
--- /dev/null
+++ b/meta/packages/binutils/files/signed_char_fix.patch
@@ -0,0 +1,12 @@
1diff -urN binutils-2.11.92.0.12.3/opcodes/i386-dis.c binutils-2.11.92.0.12.3.new/opcodes/i386-dis.c
2--- binutils-2.11.92.0.12.3/opcodes/i386-dis.c Fri Nov 16 17:05:55 2001
3+++ binutils-2.11.92.0.12.3.new/opcodes/i386-dis.c Mon Dec 31 15:55:04 2001
4@@ -1830,7 +1830,7 @@
5 * The function returns the length of this instruction in bytes.
6 */
7
8-static char intel_syntax;
9+static signed char intel_syntax;
10 static char open_char;
11 static char close_char;
12 static char separator_char;