summaryrefslogtreecommitdiff
path: root/patches
diff options
context:
space:
mode:
authorJoachim Nilsson <jocke@vmlinux.org>2010-01-07 00:08:08 (GMT)
committerJoachim Nilsson <jocke@vmlinux.org>2010-01-07 00:08:08 (GMT)
commitcfbcdd378646594887c9d488aee529c07838ee8e (patch)
tree51a79051c2c5d82c913c6ab8a2f111d5dde684dc /patches
parent6dc69b4938fee7c3e33164e5666805d6607943a3 (diff)
binutils/binultils: import binutils-2.20 patches from OE
This is a set of patches for binutils-2.20 that have been "ported", or rather shamelessly stolen, from the OpenEmbedded project: http://cgit.openembedded.org/cgit.cgi/openembedded/tree/recipes/binutils/binutils-2.20 Tried and tested on Arm (big-endian Xscale, and little-endian i.MX27) with GCC 4.4.2 Signed-off-by: Joachim Nilsson <jocke@vmlinux.org>
Diffstat (limited to 'patches')
-rw-r--r--patches/binutils/2.20/240-ld_makefile.patch25
-rw-r--r--patches/binutils/2.20/250-arm-eabi-conf.patch24
-rw-r--r--patches/binutils/2.20/260-arm-non-empty-know.patch18
-rw-r--r--patches/binutils/2.20/270-better_file_error.patch43
-rw-r--r--patches/binutils/2.20/280-unexport_LD_LIBRARY_PATH.patch95
-rw-r--r--patches/binutils/2.20/290-ld-stub-crash.patch22
6 files changed, 227 insertions, 0 deletions
diff --git a/patches/binutils/2.20/240-ld_makefile.patch b/patches/binutils/2.20/240-ld_makefile.patch
new file mode 100644
index 0000000..c1ae311
--- /dev/null
+++ b/patches/binutils/2.20/240-ld_makefile.patch
@@ -0,0 +1,25 @@
+Description: correct where ld scripts are installed
+Author: Chris Chimelis <chris@debian.org>
+
+--- 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/patches/binutils/2.20/250-arm-eabi-conf.patch b/patches/binutils/2.20/250-arm-eabi-conf.patch
new file mode 100644
index 0000000..d5be3bb
--- /dev/null
+++ b/patches/binutils/2.20/250-arm-eabi-conf.patch
@@ -0,0 +1,24 @@
+diff -u binutils-2.20.orig/configure binutils-2.20/configure
+--- binutils-2.20.orig/configure 2010-01-05 11:15:44.000000000 +0100
++++ binutils-2.20/configure 2010-01-05 12:25:41.000000000 +0100
+@@ -3086,7 +3086,7 @@
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ libgloss_dir=arm
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-*gnueabi)
+ noconfigdirs="$noconfigdirs target-qthreads"
+ case ${with_newlib} in
+ no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
+diff -u binutils-2.20.orig/configure.ac binutils-2.20/configure.ac
+--- binutils-2.20.orig/configure.ac 2010-01-05 11:15:44.000000000 +0100
++++ binutils-2.20/configure.ac 2010-01-05 12:25:51.000000000 +0100
+@@ -573,7 +573,7 @@
+ noconfigdirs="$noconfigdirs target-libffi target-qthreads"
+ libgloss_dir=arm
+ ;;
+- arm*-*-linux-gnueabi)
++ arm*-*-linux-*gnueabi)
+ noconfigdirs="$noconfigdirs target-qthreads"
+ case ${with_newlib} in
+ no) noconfigdirs="$noconfigdirs target-newlib target-libgloss"
diff --git a/patches/binutils/2.20/260-arm-non-empty-know.patch b/patches/binutils/2.20/260-arm-non-empty-know.patch
new file mode 100644
index 0000000..f0f54b2
--- /dev/null
+++ b/patches/binutils/2.20/260-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/patches/binutils/2.20/270-better_file_error.patch b/patches/binutils/2.20/270-better_file_error.patch
new file mode 100644
index 0000000..f337611
--- /dev/null
+++ b/patches/binutils/2.20/270-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/patches/binutils/2.20/280-unexport_LD_LIBRARY_PATH.patch b/patches/binutils/2.20/280-unexport_LD_LIBRARY_PATH.patch
new file mode 100644
index 0000000..535d714
--- /dev/null
+++ b/patches/binutils/2.20/280-unexport_LD_LIBRARY_PATH.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/patches/binutils/2.20/290-ld-stub-crash.patch b/patches/binutils/2.20/290-ld-stub-crash.patch
new file mode 100644
index 0000000..e4723e5
--- /dev/null
+++ b/patches/binutils/2.20/290-ld-stub-crash.patch
@@ -0,0 +1,22 @@
+diff -p -c -u -r1.196 elf32-arm.c
+--- a/bfd/elf32-arm.c 22 May 2009 11:58:44 -0000 1.196
++++ b/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. */