This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] Add --with-build-config=bootstrap-asan support
- From: "H.J. Lu" <hjl dot tools at gmail dot com>
- To: gcc-patches at gcc dot gnu dot org
- Date: Thu, 22 Nov 2012 12:37:47 -0800
- Subject: [PATCH] Add --with-build-config=bootstrap-asan support
Hi,
This patch adds --with-build-config=bootstrap-asan support. Tested on
Linux/x86-64. OK to install?
Thanks.
H.J.
---
2012-11-21 H.J. Lu <hongjiu.lu@intel.com>
* Makefile.def (target_modules): Add bootstrap=true and
raw_cxx=true to libsanitizer.
* configure.ac (bootstrap_target_libs): Add libsanitizer.
* Makefile.in: Regenerated.
* configure: Likewise.
config/
2012-11-21 H.J. Lu <hongjiu.lu@intel.com>
* bootstrap-asan.mk: New file.
diff --git a/Makefile.def b/Makefile.def
index 1ea63ac..8d8af23 100644
--- a/Makefile.def
+++ b/Makefile.def
@@ -119,7 +119,10 @@ target_modules = { module= libstdc++-v3;
lib_path=src/.libs;
raw_cxx=true; };
target_modules = { module= libmudflap; lib_path=.libs; };
-target_modules = { module= libsanitizer; lib_path=.libs; };
+target_modules = { module= libsanitizer;
+ bootstrap=true;
+ lib_path=.libs;
+ raw_cxx=true; };
target_modules = { module= libssp; lib_path=.libs; };
target_modules = { module= newlib; };
target_modules = { module= libgcc; bootstrap=true; no_check=true; };
diff --git a/config/bootstrap-asan.mk b/config/bootstrap-asan.mk
new file mode 100644
index 0000000..d37a9da
--- /dev/null
+++ b/config/bootstrap-asan.mk
@@ -0,0 +1,6 @@
+# This option enables -fsanitize=address for stage2 and stage3.
+
+STAGE2_CFLAGS += -fsanitize=address
+STAGE3_CFLAGS += -fsanitize=address
+POSTSTAGE1_LDFLAGS += -fsanitize=address -static-libasan \
+ -B$$r/prev-$(TARGET_SUBDIR)/libsanitizer/asan/.libs
diff --git a/configure.ac b/configure.ac
index 24ea7e5..64e0387 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2433,6 +2433,11 @@ if echo " ${target_configdirs} " | grep " libgomp " > /dev/null 2>&1 ; then
bootstrap_target_libs=${bootstrap_target_libs}target-libgomp,
fi
+# If we are building libsanitizer, bootstrap it.
+if echo " ${target_configdirs} " | grep " libsanitizer " > /dev/null 2>&1 ; then
+ bootstrap_target_libs=${bootstrap_target_libs}target-libsanitizer,
+fi
+
# Determine whether gdb needs tk/tcl or not.
# Use 'maybe' since enable_gdbtk might be true even if tk isn't available
# and in that case we want gdb to be built without tk. Ugh!
--
1.7.11.7