aboutsummaryrefslogtreecommitdiffstats
path: root/package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch
diff options
context:
space:
mode:
authorHauke Mehrtens <hauke@hauke-m.de>2017-04-02 17:40:43 +0200
committerFelix Fietkau <nbd@nbd.name>2017-04-12 09:54:39 +0200
commitefb22b6f06d44bd156ea42d39779dabd356c7181 (patch)
tree4c185a3378ef7e2ac13eb5ec8fb15e44dd2de575 /package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch
parent6713694fe4377f0988e2d558a6cd9b05ca9b18f1 (diff)
downloadupstream-efb22b6f06d44bd156ea42d39779dabd356c7181.tar.gz
upstream-efb22b6f06d44bd156ea42d39779dabd356c7181.tar.bz2
upstream-efb22b6f06d44bd156ea42d39779dabd356c7181.zip
binutils: fix build with host gcc < 4.9
binutils 2.27 checks if the target compiler supports -Wstack- usage=262144, and also uses this setting for the host compiler. If the host compiler is gcc < 4.9 binutils build will fail. This backports 2 commits which are fixing this problem for binutils 2.28. Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
Diffstat (limited to 'package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch')
-rw-r--r--package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch65
1 files changed, 65 insertions, 0 deletions
diff --git a/package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch b/package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch
new file mode 100644
index 0000000000..823527a2bc
--- /dev/null
+++ b/package/devel/binutils/patches/0001-Do-not-pass-host-compiler-sanitization-flags-on-to-l.patch
@@ -0,0 +1,65 @@
+From 183eb37e25d903ccd68cc2d8f8a37e75872c03d2 Mon Sep 17 00:00:00 2001
+From: Nick Clifton <nickc@redhat.com>
+Date: Tue, 6 Sep 2016 17:35:35 +0100
+Subject: [PATCH 1/2] Do not pass host compiler sanitization flags on to linker
+ testsuite.
+
+ * Makefile.am (CFLAGS_FOR_TARGET): Define as a copy of CFLAGS but
+ without any sanitization options.
+ (CXXFLAGS_FOR_TARGET): Define as a copy of CXXFLAGS but without
+ any sanitization options.
+ (check-DEJAGNU): Pass CFLAGS_FOR_TARGET and CXXFLAGS_FOR_TARGET
+ as CFLAGS and CXXFLAGS respectively.
+---
+ ld/Makefile.am | 8 ++++++--
+ ld/Makefile.in | 8 ++++++--
+ 2 files changed, 12 insertions(+), 4 deletions(-)
+
+--- a/ld/Makefile.am
++++ b/ld/Makefile.am
+@@ -136,6 +136,10 @@ CXX_FOR_TARGET = ` \
+ fi; \
+ fi`
+
++# Strip out sanitization options as we want to test building binaries without any extra paraphernalia
++CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
++CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
++
+ transform = s/^ld-new$$/$(installed_linker)/;@program_transform_name@
+ bin_PROGRAMS = ld-new
+ info_TEXINFOS = ld.texinfo
+@@ -2075,8 +2079,8 @@ check-DEJAGNU: site.exp
+ runtest=$(RUNTEST); \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
+- CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
+- CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
++ CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS_FOR_TARGET)" \
++ CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
+ CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
+ OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
+ LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \
+--- a/ld/Makefile.in
++++ b/ld/Makefile.in
+@@ -507,6 +507,10 @@ CXX_FOR_TARGET = ` \
+ fi; \
+ fi`
+
++
++# Strip out sanitization options as they require special host libraries.
++CFLAGS_FOR_TARGET = `echo $(CFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
++CXXFLAGS_FOR_TARGET = `echo $(CXXFLAGS) | sed -e 's/-fsanitize=address//g' -e 's/-fsanitize=undefined//g'`
+ info_TEXINFOS = ld.texinfo
+ ld_TEXINFOS = configdoc.texi
+ noinst_TEXINFOS = ldint.texinfo
+@@ -3644,8 +3648,8 @@ check-DEJAGNU: site.exp
+ runtest=$(RUNTEST); \
+ if $(SHELL) -c "$$runtest --version" > /dev/null 2>&1; then \
+ $$runtest --tool $(DEJATOOL) --srcdir $${srcroot}/testsuite \
+- CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS)" \
+- CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS)" \
++ CC="$(CC_FOR_TARGET)" CFLAGS="$(CFLAGS_FOR_TARGET)" \
++ CXX="$(CXX_FOR_TARGET)" CXXFLAGS="$(CXXFLAGS_FOR_TARGET)" \
+ CC_FOR_HOST="$(CC)" CFLAGS_FOR_HOST="$(CFLAGS)" \
+ OFILES="$(OFILES)" BFDLIB="$(TESTBFDLIB)" \
+ LIBIBERTY="$(LIBIBERTY) $(LIBINTL)" LIBS="$(LIBS)" \