public inbox for gcc-patches@gcc.gnu.org
 help / color / mirror / Atom feed
* [PATCH] Add --with-build-config=bootstrap-asan support
@ 2012-11-22 20:37 H.J. Lu
  2012-11-29 16:12 ` Jakub Jelinek
  2012-11-29 17:36 ` Tobias Burnus
  0 siblings, 2 replies; 15+ messages in thread
From: H.J. Lu @ 2012-11-22 20:37 UTC (permalink / raw)
  To: gcc-patches

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2012-12-06 12:06 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-11-22 20:37 [PATCH] Add --with-build-config=bootstrap-asan support H.J. Lu
2012-11-29 16:12 ` Jakub Jelinek
2012-11-29 17:36 ` Tobias Burnus
2012-11-29 17:44   ` H.J. Lu
2012-11-29 18:03   ` Tobias Burnus
2012-11-29 18:24   ` Paolo Carlini
2012-11-29 18:33     ` H.J. Lu
2012-11-29 19:04       ` H.J. Lu
2012-11-29 19:26         ` Andrew Pinski
2012-11-29 19:06     ` Jakub Jelinek
2012-11-29 20:12       ` H.J. Lu
2012-12-06 12:06         ` Markus Trippelsdorf
2012-11-29 20:46       ` H.J. Lu
2012-12-03 11:52         ` Jakub Jelinek
2012-12-03 18:02           ` H.J. Lu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).