From: "H.J. Lu" <hjl.tools@gmail.com>
To: gcc-patches@gcc.gnu.org
Subject: [PATCH] Add --with-build-config=bootstrap-asan support
Date: Thu, 22 Nov 2012 20:37:00 -0000 [thread overview]
Message-ID: <20121122203747.GA4264@gmail.com> (raw)
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
next reply other threads:[~2012-11-22 20:37 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-11-22 20:37 H.J. Lu [this message]
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20121122203747.GA4264@gmail.com \
--to=hjl.tools@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).