summaryrefslogtreecommitdiffstats
path: root/meta/packages/binutils
diff options
context:
space:
mode:
authorRichard Purdie <rpurdie@linux.intel.com>2010-02-23 17:30:19 +0000
committerRichard Purdie <rpurdie@linux.intel.com>2010-02-23 17:30:19 +0000
commit8d382809b3e06a3fc9f22156d988a5b539001eac (patch)
treeba06d0d0476484437e663ac9de4cf7116b3ef4a4 /meta/packages/binutils
parent2baf8bbf8b48a10853030e0d560ddd48b2b5efea (diff)
downloadpoky-8d382809b3e06a3fc9f22156d988a5b539001eac.tar.gz
binutils: Add 2.20 (patchset from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'meta/packages/binutils')
-rw-r--r--meta/packages/binutils/binutils-2.20/110-arm-eabi-conf.patch22
-rw-r--r--meta/packages/binutils/binutils-2.20/binutils-2.16.1-e300c2c3.patch18
-rw-r--r--meta/packages/binutils/binutils-2.20/binutils-arm-non-empty-know.patch18
-rw-r--r--meta/packages/binutils/binutils-2.20/binutils-powerpc-pr11088.patch275
-rw-r--r--meta/packages/binutils/binutils-2.20/binutils-uclibc-100-uclibc-conf.patch34
-rw-r--r--meta/packages/binutils/binutils-2.20/binutils-uclibc-300-001_ld_makefile_patch.patch50
-rw-r--r--meta/packages/binutils/binutils-2.20/binutils-uclibc-300-006_better_file_error.patch43
-rw-r--r--meta/packages/binutils/binutils-2.20/binutils-uclibc-300-012_check_ldrunpath_length.patch47
-rw-r--r--meta/packages/binutils/binutils-2.20/binutils-uclibc-gas-needs-libm.patch38
-rw-r--r--meta/packages/binutils/binutils-2.20/binutils-x86_64_i386_biarch.patch26
-rw-r--r--meta/packages/binutils/binutils-2.20/binutils_unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch95
-rw-r--r--meta/packages/binutils/binutils-2.20/ld-stub-crash.patch26
-rw-r--r--meta/packages/binutils/binutils-2.20/libtool.patch69
-rw-r--r--meta/packages/binutils/binutils-cross-canadian_2.20.bb3
-rw-r--r--meta/packages/binutils/binutils-cross_2.20.bb3
-rw-r--r--meta/packages/binutils/binutils-crosssdk_2.20.bb12
-rw-r--r--meta/packages/binutils/binutils_2.20.bb24
17 files changed, 803 insertions, 0 deletions
diff --git a/meta/packages/binutils/binutils-2.20/110-arm-eabi-conf.patch b/meta/packages/binutils/binutils-2.20/110-arm-eabi-conf.patch
new file mode 100644
index 0000000000..2623301da0
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/110-arm-eabi-conf.patch
@@ -0,0 +1,22 @@
1--- /tmp/configure.ac 2008-06-22 14:14:59.000000000 +0200
2+++ binutils-2.18.50.0.7/configure.ac 2008-06-22 14:15:30.000000000 +0200
3@@ -561,7 +561,7 @@
4 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
5 libgloss_dir=arm
6 ;;
7- arm*-*-linux-gnueabi)
8+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
9 noconfigdirs="$noconfigdirs target-qthreads"
10 noconfigdirs="$noconfigdirs target-libobjc"
11 case ${with_newlib} in
12--- /tmp/configure 2008-06-22 14:17:11.000000000 +0200
13+++ binutils-2.18.50.0.7/configure 2008-06-22 14:17:56.000000000 +0200
14@@ -2307,7 +2307,7 @@
15 noconfigdirs="$noconfigdirs target-libffi target-qthreads"
16 libgloss_dir=arm
17 ;;
18- arm*-*-linux-gnueabi)
19+ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
20 noconfigdirs="$noconfigdirs target-qthreads"
21 noconfigdirs="$noconfigdirs target-libobjc"
22 case ${with_newlib} in
diff --git a/meta/packages/binutils/binutils-2.20/binutils-2.16.1-e300c2c3.patch b/meta/packages/binutils/binutils-2.20/binutils-2.16.1-e300c2c3.patch
new file mode 100644
index 0000000000..dfe9b18e17
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-2.16.1-e300c2c3.patch
@@ -0,0 +1,18 @@
1Adds support for Freescale Power architecture e300c2 and e300c3 cores.
2http://www.bitshrine.org/gpp/tc-fsl-x86lnx-e300c3-nptl-4.0.2-2.src.rpm
3
4Leon Woestenberg <leonw@mailcan.com>
5
6Index: binutils-2.19.51.0.3/opcodes/ppc-dis.c
7===================================================================
8--- binutils-2.19.51.0.3.orig/opcodes/ppc-dis.c 2009-04-16 00:38:45.000000000 -0700
9+++ binutils-2.19.51.0.3/opcodes/ppc-dis.c 2009-04-16 00:43:56.000000000 -0700
10@@ -132,6 +132,8 @@
11 | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 | PPC_OPCODE_ALTIVEC
12 | PPC_OPCODE_VSX),
13 0 },
14+ { "pmr", (PPC_OPCODE_PMR),
15+ 0 },
16 { "ppc", (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32),
17 0 },
18 { "ppc32", (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32),
diff --git a/meta/packages/binutils/binutils-2.20/binutils-arm-non-empty-know.patch b/meta/packages/binutils/binutils-2.20/binutils-arm-non-empty-know.patch
new file mode 100644
index 0000000000..f0f54b2bf8
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-arm-non-empty-know.patch
@@ -0,0 +1,18 @@
1This is backported partially from 2.20 branch
2
3http://sourceware.org/ml/binutils-cvs/2009-10/msg00173.html
4
5-Khem
6Index: binutils-2.20/gas/as.h
7===================================================================
8--- binutils-2.20.orig/gas/as.h 2009-10-22 00:27:08.700469349 -0700
9+++ binutils-2.20/gas/as.h 2009-10-22 00:28:04.068416318 -0700
10@@ -238,7 +238,7 @@ typedef addressT valueT;
11 #define know(p) gas_assert(p) /* Verify our assumptions! */
12 #endif /* not yet defined */
13 #else
14-#define know(p) /* know() checks are no-op.ed */
15+#define know(p) do {} while (0) /* know() checks are no-op.ed */
16 #endif
17
18 /* input_scrub.c */
diff --git a/meta/packages/binutils/binutils-2.20/binutils-powerpc-pr11088.patch b/meta/packages/binutils/binutils-2.20/binutils-powerpc-pr11088.patch
new file mode 100644
index 0000000000..d5be1760e0
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-powerpc-pr11088.patch
@@ -0,0 +1,275 @@
1Fix ld segfault when compiling Qt 4.6.0 on powerpc. See:
2
3http://sourceware.org/bugzilla/show_bug.cgi?id=11088
4
5===================================================================
6RCS file: /cvs/src/src/include/elf/ppc.h,v
7retrieving revision 1.26
8retrieving revision 1.27
9diff -u -r1.26 -r1.27
10--- src/include/elf/ppc.h 2009/09/21 11:51:01 1.26
11+++ src/include/elf/ppc.h 2009/12/17 05:45:25 1.27
12@@ -73,10 +73,9 @@
13
14 #ifndef RELOC_MACROS_GEN_FUNC
15 /* Fake relocations for branch stubs, only used internally by ld. */
16- RELOC_NUMBER (R_PPC_RELAX32, 48)
17- RELOC_NUMBER (R_PPC_RELAX32PC, 49)
18- RELOC_NUMBER (R_PPC_RELAX32_PLT, 50)
19- RELOC_NUMBER (R_PPC_RELAX32PC_PLT, 51)
20+ RELOC_NUMBER (R_PPC_RELAX, 48)
21+ RELOC_NUMBER (R_PPC_RELAX_PLT, 49)
22+ RELOC_NUMBER (R_PPC_RELAX_PLTREL24, 50)
23 #endif
24
25 /* Relocs added to support TLS. */
26===================================================================
27RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
28retrieving revision 1.272
29retrieving revision 1.273
30diff -u -r1.272 -r1.273
31--- src/bfd/elf32-ppc.c 2009/12/11 13:42:02 1.272
32+++ src/bfd/elf32-ppc.c 2009/12/17 05:45:25 1.273
33@@ -3323,6 +3323,8 @@
34 {
35 struct plt_entry *ent;
36
37+ if (addend < 32768)
38+ sec = NULL;
39 for (ent = *plist; ent != NULL; ent = ent->next)
40 if (ent->sec == sec && ent->addend == addend)
41 break;
42@@ -3508,8 +3510,7 @@
43 if (info->shared)
44 addend = rel->r_addend;
45 }
46- if (!update_plt_info (abfd, ifunc,
47- addend < 32768 ? NULL : got2, addend))
48+ if (!update_plt_info (abfd, ifunc, got2, addend))
49 return FALSE;
50 }
51 }
52@@ -3748,8 +3749,7 @@
53 addend = rel->r_addend;
54 }
55 h->needs_plt = 1;
56- if (!update_plt_info (abfd, &h->plt.plist,
57- addend < 32768 ? NULL : got2, addend))
58+ if (!update_plt_info (abfd, &h->plt.plist, got2, addend))
59 return FALSE;
60 }
61 break;
62@@ -3780,10 +3780,9 @@
63 case R_PPC_EMB_MRKREF:
64 case R_PPC_NONE:
65 case R_PPC_max:
66- case R_PPC_RELAX32:
67- case R_PPC_RELAX32PC:
68- case R_PPC_RELAX32_PLT:
69- case R_PPC_RELAX32PC_PLT:
70+ case R_PPC_RELAX:
71+ case R_PPC_RELAX_PLT:
72+ case R_PPC_RELAX_PLTREL24:
73 break;
74
75 /* These should only appear in dynamic objects. */
76@@ -4486,7 +4485,7 @@
77 struct plt_entry *ent;
78
79 ent = find_plt_ent (&h->plt.plist, NULL, 0);
80- if (ent->plt.refcount > 0)
81+ if (ent != NULL && ent->plt.refcount > 0)
82 ent->plt.refcount -= 1;
83 }
84 }
85@@ -4534,7 +4533,7 @@
86 if (r_type == R_PPC_PLTREL24 && info->shared)
87 addend = rel->r_addend;
88 ent = find_plt_ent (&h->plt.plist, got2, addend);
89- if (ent->plt.refcount > 0)
90+ if (ent != NULL && ent->plt.refcount > 0)
91 ent->plt.refcount -= 1;
92 }
93 break;
94@@ -4582,9 +4581,10 @@
95 && tga->root.type == bfd_link_hash_undefweak)))
96 {
97 struct plt_entry *ent;
98- ent = find_plt_ent (&tga->plt.plist, NULL, 0);
99- if (ent != NULL
100- && ent->plt.refcount > 0)
101+ for (ent = tga->plt.plist; ent != NULL; ent = ent->next)
102+ if (ent->plt.refcount > 0)
103+ break;
104+ if (ent != NULL)
105 {
106 tga->root.type = bfd_link_hash_indirect;
107 tga->root.u.i.link = &opt->root;
108@@ -4669,6 +4669,7 @@
109 {
110 Elf_Internal_Sym *locsyms = NULL;
111 Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (ibfd);
112+ asection *got2 = bfd_get_section_by_name (ibfd, ".got2");
113
114 for (sec = ibfd->sections; sec != NULL; sec = sec->next)
115 if (sec->has_tls_reloc && !bfd_is_abs_section (sec->output_section))
116@@ -4762,6 +4763,13 @@
117 else
118 continue;
119
120+ case R_PPC_TLSGD:
121+ case R_PPC_TLSLD:
122+ expecting_tls_get_addr = 2;
123+ tls_set = 0;
124+ tls_clear = 0;
125+ break;
126+
127 default:
128 continue;
129 }
130@@ -4769,7 +4777,8 @@
131 if (pass == 0)
132 {
133 if (!expecting_tls_get_addr
134- || !sec->has_tls_get_addr_call)
135+ || (expecting_tls_get_addr == 1
136+ && !sec->has_tls_get_addr_call))
137 continue;
138
139 if (rel + 1 < relend
140@@ -4785,6 +4794,23 @@
141 break;
142 }
143
144+ if (expecting_tls_get_addr)
145+ {
146+ struct plt_entry *ent;
147+ bfd_vma addend = 0;
148+
149+ if (info->shared
150+ && ELF32_R_TYPE (rel[1].r_info) == R_PPC_PLTREL24)
151+ addend = rel[1].r_addend;
152+ ent = find_plt_ent (&htab->tls_get_addr->plt.plist,
153+ got2, addend);
154+ if (ent != NULL && ent->plt.refcount > 0)
155+ ent->plt.refcount -= 1;
156+
157+ if (expecting_tls_get_addr == 2)
158+ continue;
159+ }
160+
161 if (h != NULL)
162 {
163 tls_mask = &ppc_elf_hash_entry (h)->tls_mask;
164@@ -4829,16 +4855,6 @@
165 *got_count -= 1;
166 }
167
168- if (expecting_tls_get_addr)
169- {
170- struct plt_entry *ent;
171-
172- ent = find_plt_ent (&htab->tls_get_addr->plt.plist,
173- NULL, 0);
174- if (ent != NULL && ent->plt.refcount > 0)
175- ent->plt.refcount -= 1;
176- }
177-
178 *tls_mask |= tls_set;
179 *tls_mask &= ~tls_clear;
180 }
181@@ -6239,28 +6255,28 @@
182 {
183 size = 4 * ARRAY_SIZE (shared_stub_entry);
184 insn_offset = 12;
185- stub_rtype = R_PPC_RELAX32PC;
186 }
187 else
188 {
189 size = 4 * ARRAY_SIZE (stub_entry);
190 insn_offset = 0;
191- stub_rtype = R_PPC_RELAX32;
192 }
193-
194- if (R_PPC_RELAX32_PLT - R_PPC_RELAX32
195- != R_PPC_RELAX32PC_PLT - R_PPC_RELAX32PC)
196- abort ();
197+ stub_rtype = R_PPC_RELAX;
198 if (tsec == htab->plt
199 || tsec == htab->glink)
200- stub_rtype += R_PPC_RELAX32_PLT - R_PPC_RELAX32;
201+ {
202+ stub_rtype = R_PPC_RELAX_PLT;
203+ if (r_type == R_PPC_PLTREL24)
204+ stub_rtype = R_PPC_RELAX_PLTREL24;
205+ }
206
207 /* Hijack the old relocation. Since we need two
208 relocations for this use a "composite" reloc. */
209 irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
210 stub_rtype);
211 irel->r_offset = trampoff + insn_offset;
212- if (r_type == R_PPC_PLTREL24)
213+ if (r_type == R_PPC_PLTREL24
214+ && stub_rtype != R_PPC_RELAX_PLTREL24)
215 irel->r_addend = 0;
216
217 /* Record the fixup so we don't do it again this section. */
218@@ -6430,7 +6446,7 @@
219 {
220 /* Convert the internal relax relocs to external form. */
221 for (irel = internal_relocs; irel < irelend; irel++)
222- if (ELF32_R_TYPE (irel->r_info) == R_PPC_RELAX32)
223+ if (ELF32_R_TYPE (irel->r_info) == R_PPC_RELAX)
224 {
225 unsigned long r_symndx = ELF32_R_SYM (irel->r_info);
226
227@@ -7669,12 +7685,20 @@
228 }
229 break;
230
231- case R_PPC_RELAX32PC_PLT:
232- case R_PPC_RELAX32_PLT:
233+ case R_PPC_RELAX_PLT:
234+ case R_PPC_RELAX_PLTREL24:
235 if (h != NULL)
236 {
237- struct plt_entry *ent = find_plt_ent (&h->plt.plist, got2,
238- info->shared ? addend : 0);
239+ struct plt_entry *ent;
240+ bfd_vma got2_addend = 0;
241+
242+ if (r_type == R_PPC_RELAX_PLTREL24)
243+ {
244+ if (info->shared)
245+ got2_addend = addend;
246+ addend = 0;
247+ }
248+ ent = find_plt_ent (&h->plt.plist, got2, got2_addend);
249 if (htab->plt_type == PLT_NEW)
250 relocation = (htab->glink->output_section->vma
251 + htab->glink->output_offset
252@@ -7684,18 +7708,14 @@
253 + htab->plt->output_offset
254 + ent->plt.offset);
255 }
256- if (r_type == R_PPC_RELAX32_PLT)
257- goto relax32;
258 /* Fall thru */
259
260- case R_PPC_RELAX32PC:
261- relocation -= (input_section->output_section->vma
262- + input_section->output_offset
263- + rel->r_offset - 4);
264- /* Fall thru */
265+ case R_PPC_RELAX:
266+ if (info->shared)
267+ relocation -= (input_section->output_section->vma
268+ + input_section->output_offset
269+ + rel->r_offset - 4);
270
271- case R_PPC_RELAX32:
272- relax32:
273 {
274 unsigned long t0;
275 unsigned long t1;
diff --git a/meta/packages/binutils/binutils-2.20/binutils-uclibc-100-uclibc-conf.patch b/meta/packages/binutils/binutils-2.20/binutils-uclibc-100-uclibc-conf.patch
new file mode 100644
index 0000000000..8de04e0fe0
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-uclibc-100-uclibc-conf.patch
@@ -0,0 +1,34 @@
1--- binutils-2.18.orig/configure
2+++ binutils-2.18/configure
3@@ -2206,7 +2206,7 @@
4 am33_2.0-*-linux*)
5 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
6 ;;
7- sh-*-linux*)
8+ sh*-*-linux*)
9 noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
10 ;;
11 sh*-*-pe|mips*-*-pe|*arm-wince-pe)
12@@ -2504,7 +2504,7 @@
13 romp-*-*)
14 noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
15 ;;
16- sh-*-* | sh64-*-*)
17+ sh*-*-* | sh64-*-*)
18 case "${host}" in
19 i[3456789]86-*-vsta) ;; # don't add gprof back in
20 i[3456789]86-*-go32*) ;; # don't add gprof back in
21--- binutils-2.18.orig/gprof/configure
22+++ binutils-2.18/gprof/configure
23@@ -4124,6 +4124,11 @@
24 lt_cv_deplibs_check_method=pass_all
25 ;;
26
27+linux-uclibc*)
28+ lt_cv_deplibs_check_method=pass_all
29+ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
30+ ;;
31+
32 netbsd*)
33 if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
34 lt_cv_deplibs_check_method='match_pattern /lib[^/]+(\.so\.[0-9]+\.[0-9]+|_pic\.a)$'
diff --git a/meta/packages/binutils/binutils-2.20/binutils-uclibc-300-001_ld_makefile_patch.patch b/meta/packages/binutils/binutils-2.20/binutils-uclibc-300-001_ld_makefile_patch.patch
new file mode 100644
index 0000000000..04a7e61e25
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/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.20/binutils-uclibc-300-006_better_file_error.patch b/meta/packages/binutils/binutils-2.20/binutils-uclibc-300-006_better_file_error.patch
new file mode 100644
index 0000000000..f337611edf
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/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.20/binutils-uclibc-300-012_check_ldrunpath_length.patch b/meta/packages/binutils/binutils-2.20/binutils-uclibc-300-012_check_ldrunpath_length.patch
new file mode 100644
index 0000000000..498651a90c
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/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.20/binutils-uclibc-gas-needs-libm.patch b/meta/packages/binutils/binutils-2.20/binutils-uclibc-gas-needs-libm.patch
new file mode 100644
index 0000000000..db838cf20c
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-uclibc-gas-needs-libm.patch
@@ -0,0 +1,38 @@
1Source: Khem Raj <raj.khem@gmail.com>
2Disposition: submit upstream.
3
4Description:
5
6We do not need to have the libtool patch anymore for binutils after
7libtool has been updated upstream it include support for it. However
8for building gas natively on uclibc systems we have to link it with
9-lm so that it picks up missing symbols.
10
11/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_from_double':
12floatformat.c:(.text+0x1ec): undefined reference to `frexp'
13floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
14/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_to_double':
15floatformat.c:(.text+0x38a): undefined reference to `ldexp'
16floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
17floatformat.c:(.text+0x43e): undefined reference to `ldexp' floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
18collect2: ld returned 1 exit status
19make[4]: *** [as-new] Error 1
20
21Index: binutils-2.17.50/gas/configure.tgt
22===================================================================
23--- binutils-2.17.50.orig/gas/configure.tgt
24+++ binutils-2.17.50/gas/configure.tgt
25@@ -408,6 +408,12 @@ case ${generic_target} in
26 *-*-netware) fmt=elf em=netware ;;
27 esac
28
29+case ${generic_target} in
30+ arm-*-*uclibc*)
31+ need_libm=yes
32+ ;;
33+esac
34+
35 case ${cpu_type} in
36 alpha | arm | i386 | ia64 | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k)
37 bfd_gas=yes
38
diff --git a/meta/packages/binutils/binutils-2.20/binutils-x86_64_i386_biarch.patch b/meta/packages/binutils/binutils-2.20/binutils-x86_64_i386_biarch.patch
new file mode 100644
index 0000000000..60544345dc
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-x86_64_i386_biarch.patch
@@ -0,0 +1,26 @@
1#!/bin/sh -e
2## 127_x86_64_i386_biarch.dpatch
3##
4## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
5## DP: Author: Aurelien Jarno <aurel32.debian.org>
6## DP: Upstream status: Debian specific
7#
8# Hacked to apply with quilt
9# Adapted to binutils 2.18.50.0.7
10
11--- binutils/ld/emulparams/elf_i386.sh
12+++ binutils/ld/emulparams/elf_i386.sh
13@@ -12,3 +12,13 @@
14 NO_SMALL_DATA=yes
15 SEPARATE_GOTPLT=12
16 SHARABLE_SECTIONS=yes
17+
18+# Linux modify the default library search path to first include
19+# a 32-bit specific directory.
20+case "$target" in
21+ x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
22+ case "$EMULATION_NAME" in
23+ *i386*) LIBPATH_SUFFIX=32 ;;
24+ esac
25+ ;;
26+esac
diff --git a/meta/packages/binutils/binutils-2.20/binutils_unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch b/meta/packages/binutils/binutils-2.20/binutils_unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch
new file mode 100644
index 0000000000..535d714b25
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils_unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch
@@ -0,0 +1,95 @@
1Description:
2
3This patch is needed in situations where build system is running same version of
4binutils that is intended to be built cross-native ( build != host = target)
5 and has shared libraries enabled. binutils/binutils
6Makefile has some tools which are built to run on build system. Toplevel makefile
7for binutils passes HOST_EXPORTS to sub-makefiles which also include RPATH_ENVVARS
8containing LD_LIBRARY_PATH which is modified so that it also includes host libraries
9like opcodes and libbfd which are just built for the host system.
10
11Now the problem is that same LD_LIBRARY_PATH value gets set in environment even
12for the tools that are being built for build system using CC_FOR_BUILD and the tools
13like as,ld it invokes from build machine get the LD_LIBRARY_PATH set to search
14the newly build host libraries like opcodes and bfd and if host is like a big endian
15system say (mips-linux) the build system linker and assembler do not run because
16ld.so tries to load these shared libraries instead of the ones from /usr/lib for
17the build tools.
18
19This patch fixes the issue by clearing LD_LIBRARY_PATH for BUILD tools
20
21This patch would be needed on other versions of binutils. I just cared about 2.20
22May be upstream is also interested in such a patch.
23
24-Khem
25
26Index: binutils-2.20/binutils/Makefile.am
27===================================================================
28--- binutils-2.20.orig/binutils/Makefile.am 2009-12-30 15:30:35.302438121 -0800
29+++ binutils-2.20/binutils/Makefile.am 2009-12-30 15:33:09.154420373 -0800
30@@ -251,24 +251,24 @@ sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sy
31 ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
32
33 sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
34- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
35+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
36
37 syslex.o: syslex.c sysinfo.h config.h
38 if [ -r syslex.c ]; then \
39- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) syslex.c -Wno-error ; \
40+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) syslex.c -Wno-error ; \
41 else \
42- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c -Wno-error ;\
43+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c -Wno-error ;\
44 fi
45
46 sysinfo.o: sysinfo.c
47 if [ -r sysinfo.c ]; then \
48- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) sysinfo.c -Wno-error ; \
49+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) sysinfo.c -Wno-error ; \
50 else \
51- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c -Wno-error ; \
52+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c -Wno-error ; \
53 fi
54
55 bin2c$(EXEEXT_FOR_BUILD):
56- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
57+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
58
59 embedspu: embedspu.sh
60 sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@
61Index: binutils-2.20/binutils/Makefile.in
62===================================================================
63--- binutils-2.20.orig/binutils/Makefile.in 2009-12-30 15:30:44.582922535 -0800
64+++ binutils-2.20/binutils/Makefile.in 2009-12-30 15:33:47.322422313 -0800
65@@ -1193,24 +1193,24 @@ sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sy
66 ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
67
68 sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
69- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
70+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
71
72 syslex.o: syslex.c sysinfo.h config.h
73 if [ -r syslex.c ]; then \
74- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) syslex.c -Wno-error ; \
75+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) syslex.c -Wno-error ; \
76 else \
77- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c -Wno-error ;\
78+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c -Wno-error ;\
79 fi
80
81 sysinfo.o: sysinfo.c
82 if [ -r sysinfo.c ]; then \
83- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) sysinfo.c -Wno-error ; \
84+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) sysinfo.c -Wno-error ; \
85 else \
86- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c -Wno-error ; \
87+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c -Wno-error ; \
88 fi
89
90 bin2c$(EXEEXT_FOR_BUILD):
91- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
92+ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
93
94 embedspu: embedspu.sh
95 sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@
diff --git a/meta/packages/binutils/binutils-2.20/ld-stub-crash.patch b/meta/packages/binutils/binutils-2.20/ld-stub-crash.patch
new file mode 100644
index 0000000000..1952649eb8
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/ld-stub-crash.patch
@@ -0,0 +1,26 @@
1Index: bfd/elf32-arm.c
2===================================================================
3RCS file: /cvs/src/src/bfd/elf32-arm.c,v
4retrieving revision 1.196
5diff -p -c -u -r1.196 elf32-arm.c
6--- bfd/elf32-arm.c 22 May 2009 11:58:44 -0000 1.196
7+++ bfd/elf32-arm.c 12 Jun 2009 13:18:20 -0000
8@@ -3175,11 +3175,15 @@ arm_type_of_stub (struct bfd_link_info *
9
10 /* We have an extra 2-bytes reach because of
11 the mode change (bit 24 (H) of BLX encoding). */
12+ /* A stub is needed only if this call is not throught a PLT
13+ entry, because PLT stubs handle mode switching
14+ already. */
15 if (branch_offset > (ARM_MAX_FWD_BRANCH_OFFSET + 2)
16 || (branch_offset < ARM_MAX_BWD_BRANCH_OFFSET)
17- || ((r_type == R_ARM_CALL) && !globals->use_blx)
18- || (r_type == R_ARM_JUMP24)
19- || (r_type == R_ARM_PLT32))
20+ || ( (((r_type == R_ARM_CALL) && !globals->use_blx)
21+ || (r_type == R_ARM_JUMP24)
22+ || (r_type == R_ARM_PLT32))
23+ && !use_plt))
24 {
25 stub_type = (info->shared | globals->pic_veneer)
26 /* PIC stubs. */
diff --git a/meta/packages/binutils/binutils-2.20/libtool.patch b/meta/packages/binutils/binutils-2.20/libtool.patch
new file mode 100644
index 0000000000..81289f3006
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/libtool.patch
@@ -0,0 +1,69 @@
1A command like /bin/sh ../../i586-poky-linux-libtool --mode=install /usr/bin/install -c gck-roots-store-standalone.la '/media/data1/builds/poky1/tmp/work/core2-poky-linux/gnome-keyring-2.26.1-r1/image/usr/lib/gnome-keyring/standalone/' fails (e.g. gnome-keyring or pulseaudio)
2
3This is because libdir has a trailing slash which breaks the comparision.
4
5RP 2/1/10
6
7Index: binutils-2.19/ltmain.sh
8===================================================================
9--- binutils-2.19.orig/ltmain.sh 2007-05-25 20:56:24.000000000 +0100
10+++ binutils-2.19/ltmain.sh 2010-02-10 22:49:07.191629027 +0000
11@@ -2320,8 +2320,12 @@
12 dir="$dir$objdir"
13
14 if test -n "$relink_command"; then
15+ # Strip any trailing slash from the destination.
16+ func_stripname '' '/' "$libdir"
17+ destlibdir=$func_stripname_result
18+
19 # Determine the prefix the user has applied to our future dir.
20- inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
21+ inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$destlibdir\$%%"`
22
23 # Don't allow the user to place us outside of our expected
24 # location b/c this prevents finding dependent libraries that
25@@ -3958,8 +3962,14 @@
26 absdir="$abs_ladir"
27 libdir="$abs_ladir"
28 else
29- dir="$libdir"
30- absdir="$libdir"
31+ # Adding 'libdir' from the .la file to our library search paths
32+ # breaks crosscompilation horribly. We cheat here and don't add
33+ # it, instead adding the path where we found the .la. -CL
34+ dir="$abs_ladir"
35+ absdir="$abs_ladir"
36+ libdir="$abs_ladir"
37+ #dir="$libdir"
38+ #absdir="$libdir"
39 fi
40 test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
41 else
42@@ -4329,8 +4339,6 @@
43 add="$libdir/$linklib"
44 fi
45 else
46- # We cannot seem to hardcode it, guess we'll fake it.
47- add_dir="-L$libdir"
48 # Try looking first in the location we're being installed to.
49 if test -n "$inst_prefix_dir"; then
50 case $libdir in
51@@ -4478,7 +4486,17 @@
52 fi
53 ;;
54 *)
55- path="-L$absdir/$objdir"
56+ # OE sets installed=no in staging. We need to look in $objdir and $absdir,
57+ # preferring $objdir. RP 31/04/2008
58+ if test -f "$absdir/$objdir/$depdepl" ; then
59+ depdepl="$absdir/$objdir/$depdepl"
60+ path="-L$absdir/$objdir"
61+ elif test -f "$absdir/$depdepl" ; then
62+ depdepl="$absdir/$depdepl"
63+ path="-L$absdir"
64+ else
65+ path="-L$absdir/$objdir"
66+ fi
67 ;;
68 esac
69 else
diff --git a/meta/packages/binutils/binutils-cross-canadian_2.20.bb b/meta/packages/binutils/binutils-cross-canadian_2.20.bb
new file mode 100644
index 0000000000..7dad2a620b
--- /dev/null
+++ b/meta/packages/binutils/binutils-cross-canadian_2.20.bb
@@ -0,0 +1,3 @@
1require binutils_${PV}.bb
2require binutils-cross-canadian.inc
3PR = "r0"
diff --git a/meta/packages/binutils/binutils-cross_2.20.bb b/meta/packages/binutils/binutils-cross_2.20.bb
new file mode 100644
index 0000000000..8c7e4bc1a3
--- /dev/null
+++ b/meta/packages/binutils/binutils-cross_2.20.bb
@@ -0,0 +1,3 @@
1require binutils_${PV}.bb
2require binutils-cross.inc
3
diff --git a/meta/packages/binutils/binutils-crosssdk_2.20.bb b/meta/packages/binutils/binutils-crosssdk_2.20.bb
new file mode 100644
index 0000000000..8a9275003f
--- /dev/null
+++ b/meta/packages/binutils/binutils-crosssdk_2.20.bb
@@ -0,0 +1,12 @@
1require binutils-cross_${PV}.bb
2
3inherit crosssdk
4
5PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
6
7PR = "r1"
8
9do_configure_prepend () {
10 sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATH}/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
11}
12
diff --git a/meta/packages/binutils/binutils_2.20.bb b/meta/packages/binutils/binutils_2.20.bb
new file mode 100644
index 0000000000..bd259cf158
--- /dev/null
+++ b/meta/packages/binutils/binutils_2.20.bb
@@ -0,0 +1,24 @@
1require binutils.inc
2LICENSE = "GPLv3"
3
4PR = "r0"
5
6SRC_URI = "\
7 ${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2 \
8 file://binutils-uclibc-100-uclibc-conf.patch;patch=1 \
9 file://110-arm-eabi-conf.patch;patch=1 \
10 file://binutils-uclibc-300-001_ld_makefile_patch.patch;patch=1 \
11 file://binutils-uclibc-300-006_better_file_error.patch;patch=1 \
12 file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
13 file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
14 file://ld-stub-crash.patch;patch=1;pnum=0 \
15 file://binutils-arm-non-empty-know.patch;patch=1 \
16 file://binutils_unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch;patch=1 \
17 file://libtool.patch;patch=1 \
18 "
19
20# powerpc patches
21SRC_URI += "\
22 file://binutils-2.16.1-e300c2c3.patch;patch=1 \
23 file://binutils-powerpc-pr11088.patch;patch=1 \
24 "