summaryrefslogtreecommitdiffstats
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
parent2baf8bbf8b48a10853030e0d560ddd48b2b5efea (diff)
downloadast2050-yocto-poky-8d382809b3e06a3fc9f22156d988a5b539001eac.zip
ast2050-yocto-poky-8d382809b3e06a3fc9f22156d988a5b539001eac.tar.gz
binutils: Add 2.20 (patchset from OE.dev)
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
-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 0000000..2623301
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/110-arm-eabi-conf.patch
@@ -0,0 +1,22 @@
+--- /tmp/configure.ac 2008-06-22 14:14:59.000000000 +0200
++++ binutils-2.18.50.0.7/configure.ac 2008-06-22 14:15:30.000000000 +0200
+@@ -561,7 +561,7 @@
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ libgloss_dir=arm
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-qthreads"
+ noconfigdirs="$noconfigdirs target-libobjc"
+ case ${with_newlib} in
+--- /tmp/configure 2008-06-22 14:17:11.000000000 +0200
++++ binutils-2.18.50.0.7/configure 2008-06-22 14:17:56.000000000 +0200
+@@ -2307,7 +2307,7 @@
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ libgloss_dir=arm
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-gnueabi | arm*-*-linux-uclibcgnueabi)
+ noconfigdirs="$noconfigdirs target-qthreads"
+ noconfigdirs="$noconfigdirs target-libobjc"
+ 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 0000000..dfe9b18
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-2.16.1-e300c2c3.patch
@@ -0,0 +1,18 @@
+Adds support for Freescale Power architecture e300c2 and e300c3 cores.
+http://www.bitshrine.org/gpp/tc-fsl-x86lnx-e300c3-nptl-4.0.2-2.src.rpm
+
+Leon Woestenberg <leonw@mailcan.com>
+
+Index: binutils-2.19.51.0.3/opcodes/ppc-dis.c
+===================================================================
+--- binutils-2.19.51.0.3.orig/opcodes/ppc-dis.c 2009-04-16 00:38:45.000000000 -0700
++++ binutils-2.19.51.0.3/opcodes/ppc-dis.c 2009-04-16 00:43:56.000000000 -0700
+@@ -132,6 +132,8 @@
+ | PPC_OPCODE_POWER6 | PPC_OPCODE_POWER7 | PPC_OPCODE_ALTIVEC
+ | PPC_OPCODE_VSX),
+ 0 },
++ { "pmr", (PPC_OPCODE_PMR),
++ 0 },
+ { "ppc", (PPC_OPCODE_PPC | PPC_OPCODE_CLASSIC | PPC_OPCODE_32),
+ 0 },
+ { "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 0000000..f0f54b2
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-arm-non-empty-know.patch
@@ -0,0 +1,18 @@
+This is backported partially from 2.20 branch
+
+http://sourceware.org/ml/binutils-cvs/2009-10/msg00173.html
+
+-Khem
+Index: binutils-2.20/gas/as.h
+===================================================================
+--- binutils-2.20.orig/gas/as.h 2009-10-22 00:27:08.700469349 -0700
++++ binutils-2.20/gas/as.h 2009-10-22 00:28:04.068416318 -0700
+@@ -238,7 +238,7 @@ typedef addressT valueT;
+ #define know(p) gas_assert(p) /* Verify our assumptions! */
+ #endif /* not yet defined */
+ #else
+-#define know(p) /* know() checks are no-op.ed */
++#define know(p) do {} while (0) /* know() checks are no-op.ed */
+ #endif
+
+ /* 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 0000000..d5be176
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-powerpc-pr11088.patch
@@ -0,0 +1,275 @@
+Fix ld segfault when compiling Qt 4.6.0 on powerpc. See:
+
+http://sourceware.org/bugzilla/show_bug.cgi?id=11088
+
+===================================================================
+RCS file: /cvs/src/src/include/elf/ppc.h,v
+retrieving revision 1.26
+retrieving revision 1.27
+diff -u -r1.26 -r1.27
+--- src/include/elf/ppc.h 2009/09/21 11:51:01 1.26
++++ src/include/elf/ppc.h 2009/12/17 05:45:25 1.27
+@@ -73,10 +73,9 @@
+
+ #ifndef RELOC_MACROS_GEN_FUNC
+ /* Fake relocations for branch stubs, only used internally by ld. */
+- RELOC_NUMBER (R_PPC_RELAX32, 48)
+- RELOC_NUMBER (R_PPC_RELAX32PC, 49)
+- RELOC_NUMBER (R_PPC_RELAX32_PLT, 50)
+- RELOC_NUMBER (R_PPC_RELAX32PC_PLT, 51)
++ RELOC_NUMBER (R_PPC_RELAX, 48)
++ RELOC_NUMBER (R_PPC_RELAX_PLT, 49)
++ RELOC_NUMBER (R_PPC_RELAX_PLTREL24, 50)
+ #endif
+
+ /* Relocs added to support TLS. */
+===================================================================
+RCS file: /cvs/src/src/bfd/elf32-ppc.c,v
+retrieving revision 1.272
+retrieving revision 1.273
+diff -u -r1.272 -r1.273
+--- src/bfd/elf32-ppc.c 2009/12/11 13:42:02 1.272
++++ src/bfd/elf32-ppc.c 2009/12/17 05:45:25 1.273
+@@ -3323,6 +3323,8 @@
+ {
+ struct plt_entry *ent;
+
++ if (addend < 32768)
++ sec = NULL;
+ for (ent = *plist; ent != NULL; ent = ent->next)
+ if (ent->sec == sec && ent->addend == addend)
+ break;
+@@ -3508,8 +3510,7 @@
+ if (info->shared)
+ addend = rel->r_addend;
+ }
+- if (!update_plt_info (abfd, ifunc,
+- addend < 32768 ? NULL : got2, addend))
++ if (!update_plt_info (abfd, ifunc, got2, addend))
+ return FALSE;
+ }
+ }
+@@ -3748,8 +3749,7 @@
+ addend = rel->r_addend;
+ }
+ h->needs_plt = 1;
+- if (!update_plt_info (abfd, &h->plt.plist,
+- addend < 32768 ? NULL : got2, addend))
++ if (!update_plt_info (abfd, &h->plt.plist, got2, addend))
+ return FALSE;
+ }
+ break;
+@@ -3780,10 +3780,9 @@
+ case R_PPC_EMB_MRKREF:
+ case R_PPC_NONE:
+ case R_PPC_max:
+- case R_PPC_RELAX32:
+- case R_PPC_RELAX32PC:
+- case R_PPC_RELAX32_PLT:
+- case R_PPC_RELAX32PC_PLT:
++ case R_PPC_RELAX:
++ case R_PPC_RELAX_PLT:
++ case R_PPC_RELAX_PLTREL24:
+ break;
+
+ /* These should only appear in dynamic objects. */
+@@ -4486,7 +4485,7 @@
+ struct plt_entry *ent;
+
+ ent = find_plt_ent (&h->plt.plist, NULL, 0);
+- if (ent->plt.refcount > 0)
++ if (ent != NULL && ent->plt.refcount > 0)
+ ent->plt.refcount -= 1;
+ }
+ }
+@@ -4534,7 +4533,7 @@
+ if (r_type == R_PPC_PLTREL24 && info->shared)
+ addend = rel->r_addend;
+ ent = find_plt_ent (&h->plt.plist, got2, addend);
+- if (ent->plt.refcount > 0)
++ if (ent != NULL && ent->plt.refcount > 0)
+ ent->plt.refcount -= 1;
+ }
+ break;
+@@ -4582,9 +4581,10 @@
+ && tga->root.type == bfd_link_hash_undefweak)))
+ {
+ struct plt_entry *ent;
+- ent = find_plt_ent (&tga->plt.plist, NULL, 0);
+- if (ent != NULL
+- && ent->plt.refcount > 0)
++ for (ent = tga->plt.plist; ent != NULL; ent = ent->next)
++ if (ent->plt.refcount > 0)
++ break;
++ if (ent != NULL)
+ {
+ tga->root.type = bfd_link_hash_indirect;
+ tga->root.u.i.link = &opt->root;
+@@ -4669,6 +4669,7 @@
+ {
+ Elf_Internal_Sym *locsyms = NULL;
+ Elf_Internal_Shdr *symtab_hdr = &elf_symtab_hdr (ibfd);
++ asection *got2 = bfd_get_section_by_name (ibfd, ".got2");
+
+ for (sec = ibfd->sections; sec != NULL; sec = sec->next)
+ if (sec->has_tls_reloc && !bfd_is_abs_section (sec->output_section))
+@@ -4762,6 +4763,13 @@
+ else
+ continue;
+
++ case R_PPC_TLSGD:
++ case R_PPC_TLSLD:
++ expecting_tls_get_addr = 2;
++ tls_set = 0;
++ tls_clear = 0;
++ break;
++
+ default:
+ continue;
+ }
+@@ -4769,7 +4777,8 @@
+ if (pass == 0)
+ {
+ if (!expecting_tls_get_addr
+- || !sec->has_tls_get_addr_call)
++ || (expecting_tls_get_addr == 1
++ && !sec->has_tls_get_addr_call))
+ continue;
+
+ if (rel + 1 < relend
+@@ -4785,6 +4794,23 @@
+ break;
+ }
+
++ if (expecting_tls_get_addr)
++ {
++ struct plt_entry *ent;
++ bfd_vma addend = 0;
++
++ if (info->shared
++ && ELF32_R_TYPE (rel[1].r_info) == R_PPC_PLTREL24)
++ addend = rel[1].r_addend;
++ ent = find_plt_ent (&htab->tls_get_addr->plt.plist,
++ got2, addend);
++ if (ent != NULL && ent->plt.refcount > 0)
++ ent->plt.refcount -= 1;
++
++ if (expecting_tls_get_addr == 2)
++ continue;
++ }
++
+ if (h != NULL)
+ {
+ tls_mask = &ppc_elf_hash_entry (h)->tls_mask;
+@@ -4829,16 +4855,6 @@
+ *got_count -= 1;
+ }
+
+- if (expecting_tls_get_addr)
+- {
+- struct plt_entry *ent;
+-
+- ent = find_plt_ent (&htab->tls_get_addr->plt.plist,
+- NULL, 0);
+- if (ent != NULL && ent->plt.refcount > 0)
+- ent->plt.refcount -= 1;
+- }
+-
+ *tls_mask |= tls_set;
+ *tls_mask &= ~tls_clear;
+ }
+@@ -6239,28 +6255,28 @@
+ {
+ size = 4 * ARRAY_SIZE (shared_stub_entry);
+ insn_offset = 12;
+- stub_rtype = R_PPC_RELAX32PC;
+ }
+ else
+ {
+ size = 4 * ARRAY_SIZE (stub_entry);
+ insn_offset = 0;
+- stub_rtype = R_PPC_RELAX32;
+ }
+-
+- if (R_PPC_RELAX32_PLT - R_PPC_RELAX32
+- != R_PPC_RELAX32PC_PLT - R_PPC_RELAX32PC)
+- abort ();
++ stub_rtype = R_PPC_RELAX;
+ if (tsec == htab->plt
+ || tsec == htab->glink)
+- stub_rtype += R_PPC_RELAX32_PLT - R_PPC_RELAX32;
++ {
++ stub_rtype = R_PPC_RELAX_PLT;
++ if (r_type == R_PPC_PLTREL24)
++ stub_rtype = R_PPC_RELAX_PLTREL24;
++ }
+
+ /* Hijack the old relocation. Since we need two
+ relocations for this use a "composite" reloc. */
+ irel->r_info = ELF32_R_INFO (ELF32_R_SYM (irel->r_info),
+ stub_rtype);
+ irel->r_offset = trampoff + insn_offset;
+- if (r_type == R_PPC_PLTREL24)
++ if (r_type == R_PPC_PLTREL24
++ && stub_rtype != R_PPC_RELAX_PLTREL24)
+ irel->r_addend = 0;
+
+ /* Record the fixup so we don't do it again this section. */
+@@ -6430,7 +6446,7 @@
+ {
+ /* Convert the internal relax relocs to external form. */
+ for (irel = internal_relocs; irel < irelend; irel++)
+- if (ELF32_R_TYPE (irel->r_info) == R_PPC_RELAX32)
++ if (ELF32_R_TYPE (irel->r_info) == R_PPC_RELAX)
+ {
+ unsigned long r_symndx = ELF32_R_SYM (irel->r_info);
+
+@@ -7669,12 +7685,20 @@
+ }
+ break;
+
+- case R_PPC_RELAX32PC_PLT:
+- case R_PPC_RELAX32_PLT:
++ case R_PPC_RELAX_PLT:
++ case R_PPC_RELAX_PLTREL24:
+ if (h != NULL)
+ {
+- struct plt_entry *ent = find_plt_ent (&h->plt.plist, got2,
+- info->shared ? addend : 0);
++ struct plt_entry *ent;
++ bfd_vma got2_addend = 0;
++
++ if (r_type == R_PPC_RELAX_PLTREL24)
++ {
++ if (info->shared)
++ got2_addend = addend;
++ addend = 0;
++ }
++ ent = find_plt_ent (&h->plt.plist, got2, got2_addend);
+ if (htab->plt_type == PLT_NEW)
+ relocation = (htab->glink->output_section->vma
+ + htab->glink->output_offset
+@@ -7684,18 +7708,14 @@
+ + htab->plt->output_offset
+ + ent->plt.offset);
+ }
+- if (r_type == R_PPC_RELAX32_PLT)
+- goto relax32;
+ /* Fall thru */
+
+- case R_PPC_RELAX32PC:
+- relocation -= (input_section->output_section->vma
+- + input_section->output_offset
+- + rel->r_offset - 4);
+- /* Fall thru */
++ case R_PPC_RELAX:
++ if (info->shared)
++ relocation -= (input_section->output_section->vma
++ + input_section->output_offset
++ + rel->r_offset - 4);
+
+- case R_PPC_RELAX32:
+- relax32:
+ {
+ unsigned long t0;
+ 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 0000000..8de04e0
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-uclibc-100-uclibc-conf.patch
@@ -0,0 +1,34 @@
+--- binutils-2.18.orig/configure
++++ binutils-2.18/configure
+@@ -2206,7 +2206,7 @@
+ am33_2.0-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+- sh-*-linux*)
++ sh*-*-linux*)
+ noconfigdirs="$noconfigdirs ${libgcj} target-newlib target-libgloss"
+ ;;
+ sh*-*-pe|mips*-*-pe|*arm-wince-pe)
+@@ -2504,7 +2504,7 @@
+ romp-*-*)
+ noconfigdirs="$noconfigdirs bfd binutils ld gas opcodes target-libgloss ${libgcj}"
+ ;;
+- sh-*-* | sh64-*-*)
++ sh*-*-* | sh64-*-*)
+ case "${host}" in
+ i[3456789]86-*-vsta) ;; # don't add gprof back in
+ i[3456789]86-*-go32*) ;; # don't add gprof back in
+--- binutils-2.18.orig/gprof/configure
++++ binutils-2.18/gprof/configure
+@@ -4124,6 +4124,11 @@
+ lt_cv_deplibs_check_method=pass_all
+ ;;
+
++linux-uclibc*)
++ lt_cv_deplibs_check_method=pass_all
++ lt_cv_file_magic_test_file=`echo /lib/libuClibc-*.so`
++ ;;
++
+ netbsd*)
+ if echo __ELF__ | $CC -E - | $GREP __ELF__ > /dev/null; then
+ 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 0000000..04a7e61
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-uclibc-300-001_ld_makefile_patch.patch
@@ -0,0 +1,50 @@
+#!/bin/sh -e
+## 001_ld_makefile_patch.dpatch
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Description: correct where ld scripts are installed
+## DP: Author: Chris Chimelis <chris@debian.org>
+## DP: Upstream status: N/A
+## DP: Date: ??
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+--- binutils-2.16.91.0.1/ld/Makefile.am
++++ binutils-2.16.91.0.1/ld/Makefile.am
+@@ -20,7 +20,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+
+ EMUL = @EMUL@
+ EMULATION_OFILES = @EMULATION_OFILES@
+--- binutils-2.16.91.0.1/ld/Makefile.in
++++ binutils-2.16.91.0.1/ld/Makefile.in
+@@ -268,7 +268,7 @@
+ # We put the scripts in the directory $(scriptdir)/ldscripts.
+ # We can't put the scripts in $(datadir) because the SEARCH_DIR
+ # directives need to be different for native and cross linkers.
+-scriptdir = $(tooldir)/lib
++scriptdir = $(libdir)
+ BASEDIR = $(srcdir)/..
+ BFDDIR = $(BASEDIR)/bfd
+ 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 0000000..f337611
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-uclibc-300-006_better_file_error.patch
@@ -0,0 +1,43 @@
+#!/bin/sh -e
+## 006_better_file_error.dpatch by David Kimdon <dwhedon@gordian.com>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Specify which filename is causing an error if the filename is a
+## DP: directory. (#45832)
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c binutils-2.14.90.0.6/bfd/opncls.c
+--- /home/james/debian/packages/binutils/binutils-2.14.90.0.6/bfd/opncls.c 2003-07-23 16:08:09.000000000 +0100
++++ binutils-2.14.90.0.6/bfd/opncls.c 2003-09-10 22:35:00.000000000 +0100
+@@ -150,6 +150,13 @@
+ {
+ bfd *nbfd;
+ const bfd_target *target_vec;
++ struct stat s;
++
++ if (stat (filename, &s) == 0)
++ if (S_ISDIR(s.st_mode)) {
++ bfd_set_error (bfd_error_file_not_recognized);
++ return NULL;
++ }
+
+ nbfd = _bfd_new_bfd ();
+ 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 0000000..498651a
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-uclibc-300-012_check_ldrunpath_length.patch
@@ -0,0 +1,47 @@
+#!/bin/sh -e
+## 012_check_ldrunpath_length.dpatch by Chris Chimelis <chris@debian.org>
+##
+## All lines beginning with `## DP:' are a description of the patch.
+## DP: Only generate an RPATH entry if LD_RUN_PATH is not empty, for
+## DP: cases where -rpath isn't specified. (#151024)
+
+if [ $# -ne 1 ]; then
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1
+fi
+
+[ -f debian/patches/00patch-opts ] && . debian/patches/00patch-opts
+patch_opts="${patch_opts:--f --no-backup-if-mismatch}"
+
+case "$1" in
+ -patch) patch $patch_opts -p1 < $0;;
+ -unpatch) patch $patch_opts -p1 -R < $0;;
+ *)
+ echo >&2 "`basename $0`: script expects -patch|-unpatch as argument"
+ exit 1;;
+esac
+
+exit 0
+
+@DPATCH@
+diff -urNad /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em binutils-2.15/ld/emultempl/elf32.em
+--- /home/james/debian/packages/binutils/new/binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:58.000000000 +0100
++++ binutils-2.15/ld/emultempl/elf32.em 2004-05-21 23:12:59.000000000 +0100
+@@ -692,6 +692,8 @@
+ && command_line.rpath == NULL)
+ {
+ lib_path = (const char *) getenv ("LD_RUN_PATH");
++ if ((lib_path) && (strlen (lib_path) == 0))
++ lib_path = NULL;
+ if (gld${EMULATION_NAME}_search_needed (lib_path, &n,
+ force))
+ break;
+@@ -871,6 +873,8 @@
+ rpath = command_line.rpath;
+ if (rpath == NULL)
+ rpath = (const char *) getenv ("LD_RUN_PATH");
++ if ((rpath) && (strlen (rpath) == 0))
++ rpath = NULL;
+ if (! (bfd_elf_size_dynamic_sections
+ (output_bfd, command_line.soname, rpath,
+ 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 0000000..db838cf
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-uclibc-gas-needs-libm.patch
@@ -0,0 +1,38 @@
+Source: Khem Raj <raj.khem@gmail.com>
+Disposition: submit upstream.
+
+Description:
+
+We do not need to have the libtool patch anymore for binutils after
+libtool has been updated upstream it include support for it. However
+for building gas natively on uclibc systems we have to link it with
+-lm so that it picks up missing symbols.
+
+/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_from_double':
+floatformat.c:(.text+0x1ec): undefined reference to `frexp'
+floatformat.c:(.text+0x2f8): undefined reference to `ldexp'
+/local/build_area/BUILD/arm_v5t_le_uclibc/binutils-2.17.50/objdir/libiberty/pic/libiberty.a(floatformat.o): In function `floatformat_to_double':
+floatformat.c:(.text+0x38a): undefined reference to `ldexp'
+floatformat.c:(.text+0x3d2): undefined reference to `ldexp'
+floatformat.c:(.text+0x43e): undefined reference to `ldexp' floatformat.c:(.text+0x4e2): undefined reference to `ldexp'
+collect2: ld returned 1 exit status
+make[4]: *** [as-new] Error 1
+
+Index: binutils-2.17.50/gas/configure.tgt
+===================================================================
+--- binutils-2.17.50.orig/gas/configure.tgt
++++ binutils-2.17.50/gas/configure.tgt
+@@ -408,6 +408,12 @@ case ${generic_target} in
+ *-*-netware) fmt=elf em=netware ;;
+ esac
+
++case ${generic_target} in
++ arm-*-*uclibc*)
++ need_libm=yes
++ ;;
++esac
++
+ case ${cpu_type} in
+ alpha | arm | i386 | ia64 | mips | ns32k | pdp11 | ppc | sparc | z80 | z8k)
+ bfd_gas=yes
+
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 0000000..6054434
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils-x86_64_i386_biarch.patch
@@ -0,0 +1,26 @@
+#!/bin/sh -e
+## 127_x86_64_i386_biarch.dpatch
+##
+## DP: Description: Add (/usr)/lib32 to the search paths on x86_64.
+## DP: Author: Aurelien Jarno <aurel32.debian.org>
+## DP: Upstream status: Debian specific
+#
+# Hacked to apply with quilt
+# Adapted to binutils 2.18.50.0.7
+
+--- binutils/ld/emulparams/elf_i386.sh
++++ binutils/ld/emulparams/elf_i386.sh
+@@ -12,3 +12,13 @@
+ NO_SMALL_DATA=yes
+ SEPARATE_GOTPLT=12
+ SHARABLE_SECTIONS=yes
++
++# Linux modify the default library search path to first include
++# a 32-bit specific directory.
++case "$target" in
++ x86_64*-linux* | i[3-7]86*-linux* | x86_64*-kfreebsd*-gnu | i[3-7]86*-kfreebsd*-gnu)
++ case "$EMULATION_NAME" in
++ *i386*) LIBPATH_SUFFIX=32 ;;
++ esac
++ ;;
++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 0000000..535d714
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/binutils_unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch
@@ -0,0 +1,95 @@
+Description:
+
+This patch is needed in situations where build system is running same version of
+binutils that is intended to be built cross-native ( build != host = target)
+ and has shared libraries enabled. binutils/binutils
+Makefile has some tools which are built to run on build system. Toplevel makefile
+for binutils passes HOST_EXPORTS to sub-makefiles which also include RPATH_ENVVARS
+containing LD_LIBRARY_PATH which is modified so that it also includes host libraries
+like opcodes and libbfd which are just built for the host system.
+
+Now the problem is that same LD_LIBRARY_PATH value gets set in environment even
+for the tools that are being built for build system using CC_FOR_BUILD and the tools
+like as,ld it invokes from build machine get the LD_LIBRARY_PATH set to search
+the newly build host libraries like opcodes and bfd and if host is like a big endian
+system say (mips-linux) the build system linker and assembler do not run because
+ld.so tries to load these shared libraries instead of the ones from /usr/lib for
+the build tools.
+
+This patch fixes the issue by clearing LD_LIBRARY_PATH for BUILD tools
+
+This patch would be needed on other versions of binutils. I just cared about 2.20
+May be upstream is also interested in such a patch.
+
+-Khem
+
+Index: binutils-2.20/binutils/Makefile.am
+===================================================================
+--- binutils-2.20.orig/binutils/Makefile.am 2009-12-30 15:30:35.302438121 -0800
++++ binutils-2.20/binutils/Makefile.am 2009-12-30 15:33:09.154420373 -0800
+@@ -251,24 +251,24 @@ sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sy
+ ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
+
+ sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
+- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
+
+ syslex.o: syslex.c sysinfo.h config.h
+ if [ -r syslex.c ]; then \
+- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) syslex.c -Wno-error ; \
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) syslex.c -Wno-error ; \
+ else \
+- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c -Wno-error ;\
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c -Wno-error ;\
+ fi
+
+ sysinfo.o: sysinfo.c
+ if [ -r sysinfo.c ]; then \
+- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) sysinfo.c -Wno-error ; \
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) sysinfo.c -Wno-error ; \
+ else \
+- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c -Wno-error ; \
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c -Wno-error ; \
+ fi
+
+ bin2c$(EXEEXT_FOR_BUILD):
+- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
+
+ embedspu: embedspu.sh
+ sed "s@^program_transform_name=@program_transform_name=$(program_transform_name)@" < $< > $@
+Index: binutils-2.20/binutils/Makefile.in
+===================================================================
+--- binutils-2.20.orig/binutils/Makefile.in 2009-12-30 15:30:44.582922535 -0800
++++ binutils-2.20/binutils/Makefile.in 2009-12-30 15:33:47.322422313 -0800
+@@ -1193,24 +1193,24 @@ sysroff.h: sysinfo$(EXEEXT_FOR_BUILD) sy
+ ./sysinfo$(EXEEXT_FOR_BUILD) -d <$(srcdir)/sysroff.info >sysroff.h
+
+ sysinfo$(EXEEXT_FOR_BUILD): sysinfo.o syslex.o
+- $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) -o $@ sysinfo.o syslex.o
+
+ syslex.o: syslex.c sysinfo.h config.h
+ if [ -r syslex.c ]; then \
+- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) syslex.c -Wno-error ; \
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) syslex.c -Wno-error ; \
+ else \
+- $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c -Wno-error ;\
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. -I$(srcdir) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/syslex.c -Wno-error ;\
+ fi
+
+ sysinfo.o: sysinfo.c
+ if [ -r sysinfo.c ]; then \
+- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) sysinfo.c -Wno-error ; \
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) sysinfo.c -Wno-error ; \
+ else \
+- $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c -Wno-error ; \
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -c -I. $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(srcdir)/sysinfo.c -Wno-error ; \
+ fi
+
+ bin2c$(EXEEXT_FOR_BUILD):
+- $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
++ LD_LIBRARY_PATH= $(CC_FOR_BUILD) -o $@ $(AM_CPPFLAGS) $(AM_CFLAGS) $(CFLAGS_FOR_BUILD) $(LDFLAGS_FOR_BUILD) $(srcdir)/bin2c.c $(srcdir)/version.c
+
+ embedspu: embedspu.sh
+ 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 0000000..1952649
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/ld-stub-crash.patch
@@ -0,0 +1,26 @@
+Index: bfd/elf32-arm.c
+===================================================================
+RCS file: /cvs/src/src/bfd/elf32-arm.c,v
+retrieving revision 1.196
+diff -p -c -u -r1.196 elf32-arm.c
+--- bfd/elf32-arm.c 22 May 2009 11:58:44 -0000 1.196
++++ bfd/elf32-arm.c 12 Jun 2009 13:18:20 -0000
+@@ -3175,11 +3175,15 @@ arm_type_of_stub (struct bfd_link_info *
+
+ /* We have an extra 2-bytes reach because of
+ the mode change (bit 24 (H) of BLX encoding). */
++ /* A stub is needed only if this call is not throught a PLT
++ entry, because PLT stubs handle mode switching
++ already. */
+ if (branch_offset > (ARM_MAX_FWD_BRANCH_OFFSET + 2)
+ || (branch_offset < ARM_MAX_BWD_BRANCH_OFFSET)
+- || ((r_type == R_ARM_CALL) && !globals->use_blx)
+- || (r_type == R_ARM_JUMP24)
+- || (r_type == R_ARM_PLT32))
++ || ( (((r_type == R_ARM_CALL) && !globals->use_blx)
++ || (r_type == R_ARM_JUMP24)
++ || (r_type == R_ARM_PLT32))
++ && !use_plt))
+ {
+ stub_type = (info->shared | globals->pic_veneer)
+ /* 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 0000000..81289f3
--- /dev/null
+++ b/meta/packages/binutils/binutils-2.20/libtool.patch
@@ -0,0 +1,69 @@
+A 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)
+
+This is because libdir has a trailing slash which breaks the comparision.
+
+RP 2/1/10
+
+Index: binutils-2.19/ltmain.sh
+===================================================================
+--- binutils-2.19.orig/ltmain.sh 2007-05-25 20:56:24.000000000 +0100
++++ binutils-2.19/ltmain.sh 2010-02-10 22:49:07.191629027 +0000
+@@ -2320,8 +2320,12 @@
+ dir="$dir$objdir"
+
+ if test -n "$relink_command"; then
++ # Strip any trailing slash from the destination.
++ func_stripname '' '/' "$libdir"
++ destlibdir=$func_stripname_result
++
+ # Determine the prefix the user has applied to our future dir.
+- inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$libdir\$%%"`
++ inst_prefix_dir=`$ECHO "X$destdir" | $Xsed -e "s%$destlibdir\$%%"`
+
+ # Don't allow the user to place us outside of our expected
+ # location b/c this prevents finding dependent libraries that
+@@ -3958,8 +3962,14 @@
+ absdir="$abs_ladir"
+ libdir="$abs_ladir"
+ else
+- dir="$libdir"
+- absdir="$libdir"
++ # Adding 'libdir' from the .la file to our library search paths
++ # breaks crosscompilation horribly. We cheat here and don't add
++ # it, instead adding the path where we found the .la. -CL
++ dir="$abs_ladir"
++ absdir="$abs_ladir"
++ libdir="$abs_ladir"
++ #dir="$libdir"
++ #absdir="$libdir"
+ fi
+ test "X$hardcode_automatic" = Xyes && avoidtemprpath=yes
+ else
+@@ -4329,8 +4339,6 @@
+ add="$libdir/$linklib"
+ fi
+ else
+- # We cannot seem to hardcode it, guess we'll fake it.
+- add_dir="-L$libdir"
+ # Try looking first in the location we're being installed to.
+ if test -n "$inst_prefix_dir"; then
+ case $libdir in
+@@ -4478,7 +4486,17 @@
+ fi
+ ;;
+ *)
+- path="-L$absdir/$objdir"
++ # OE sets installed=no in staging. We need to look in $objdir and $absdir,
++ # preferring $objdir. RP 31/04/2008
++ if test -f "$absdir/$objdir/$depdepl" ; then
++ depdepl="$absdir/$objdir/$depdepl"
++ path="-L$absdir/$objdir"
++ elif test -f "$absdir/$depdepl" ; then
++ depdepl="$absdir/$depdepl"
++ path="-L$absdir"
++ else
++ path="-L$absdir/$objdir"
++ fi
+ ;;
+ esac
+ 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 0000000..7dad2a6
--- /dev/null
+++ b/meta/packages/binutils/binutils-cross-canadian_2.20.bb
@@ -0,0 +1,3 @@
+require binutils_${PV}.bb
+require binutils-cross-canadian.inc
+PR = "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 0000000..8c7e4bc
--- /dev/null
+++ b/meta/packages/binutils/binutils-cross_2.20.bb
@@ -0,0 +1,3 @@
+require binutils_${PV}.bb
+require binutils-cross.inc
+
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 0000000..8a92750
--- /dev/null
+++ b/meta/packages/binutils/binutils-crosssdk_2.20.bb
@@ -0,0 +1,12 @@
+require binutils-cross_${PV}.bb
+
+inherit crosssdk
+
+PROVIDES = "virtual/${TARGET_PREFIX}binutils-crosssdk"
+
+PR = "r1"
+
+do_configure_prepend () {
+ sed -i 's#/usr/local/lib /lib /usr/lib#${SDKPATH}/lib /usr/local/lib /lib /usr/lib#' ${S}/ld/configure.tgt
+}
+
diff --git a/meta/packages/binutils/binutils_2.20.bb b/meta/packages/binutils/binutils_2.20.bb
new file mode 100644
index 0000000..bd259cf
--- /dev/null
+++ b/meta/packages/binutils/binutils_2.20.bb
@@ -0,0 +1,24 @@
+require binutils.inc
+LICENSE = "GPLv3"
+
+PR = "r0"
+
+SRC_URI = "\
+ ${GNU_MIRROR}/binutils/binutils-${PV}.tar.bz2 \
+ file://binutils-uclibc-100-uclibc-conf.patch;patch=1 \
+ file://110-arm-eabi-conf.patch;patch=1 \
+ file://binutils-uclibc-300-001_ld_makefile_patch.patch;patch=1 \
+ file://binutils-uclibc-300-006_better_file_error.patch;patch=1 \
+ file://binutils-uclibc-300-012_check_ldrunpath_length.patch;patch=1 \
+ file://binutils-uclibc-gas-needs-libm.patch;patch=1 \
+ file://ld-stub-crash.patch;patch=1;pnum=0 \
+ file://binutils-arm-non-empty-know.patch;patch=1 \
+ file://binutils_unexport_LD_LIBRARY_PATH_for_CC_FOR_BUILD.patch;patch=1 \
+ file://libtool.patch;patch=1 \
+ "
+
+# powerpc patches
+SRC_URI += "\
+ file://binutils-2.16.1-e300c2c3.patch;patch=1 \
+ file://binutils-powerpc-pr11088.patch;patch=1 \
+ "
OpenPOWER on IntegriCloud