This is the mail archive of the
binutils-cvs@sourceware.org
mailing list for the binutils project.
[binutils-gdb] Do not pass host compiler sanitization flags on to linker testsuite.
- From: Nick Clifton <nickc at sourceware dot org>
- To: bfd-cvs at sourceware dot org
- Date: 6 Sep 2016 16:36:23 -0000
- Subject: [binutils-gdb] Do not pass host compiler sanitization flags on to linker testsuite.
https://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;h=22d6c51be8de9a091d89c0e11e6e140f333ade62
commit 22d6c51be8de9a091d89c0e11e6e140f333ade62
Author: Nick Clifton <nickc@redhat.com>
Date: Tue Sep 6 17:35:35 2016 +0100
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.
Diff:
---
ld/ChangeLog | 9 +++++++++
ld/Makefile.am | 8 ++++++--
ld/Makefile.in | 8 ++++++--
3 files changed, 21 insertions(+), 4 deletions(-)
diff --git a/ld/ChangeLog b/ld/ChangeLog
index a13c8d1..85d7820 100644
--- a/ld/ChangeLog
+++ b/ld/ChangeLog
@@ -1,3 +1,12 @@
+2016-09-06 Nick Clifton <nickc@redhat.com>
+
+ * 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.
+
2016-09-02 Senthil Kumar Selvaraj <senthil_kumar.selvaraj@atmel.com>
PR ld/20545
diff --git a/ld/Makefile.am b/ld/Makefile.am
index 16d95bc..1a7fc3f 100644
--- 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)" \
diff --git a/ld/Makefile.in b/ld/Makefile.in
index 1ce019a..48b7ba7 100644
--- 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)" \