From patchwork Thu Nov 22 20:37:47 2012 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "H.J. Lu" X-Patchwork-Id: 201189 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) by ozlabs.org (Postfix) with SMTP id 9FB8F2C0086 for ; Fri, 23 Nov 2012 07:38:02 +1100 (EST) Comment: DKIM? See http://www.dkim.org DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=gcc.gnu.org; s=default; x=1354221484; h=Comment: DomainKey-Signature:Received:Received:Received:Received:Received: Received:Received:Date:From:To:Subject:Message-ID:MIME-Version: Content-Type:Content-Disposition:User-Agent:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=TnoVwgg1fB7BTpL8twGi189e6ho=; b=eu9ShsazPodzjGOcC08FR4jn3Gozp+BdSS0+Gr3ZST8j4V9MTTkP/ObczVh7xO fgQrqU2rGM1UfyqdtWcR+aEiiroILOkxAr+D5cHtz780qQKZ8IRuAOK4tgnjCRLM grgui14hQJGPVZK5zvNhfXPbA4Ov4pWj1HmOH4lh9vcFE= Comment: DomainKeys? See http://antispam.yahoo.com/domainkeys DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=default; d=gcc.gnu.org; h=Received:Received:X-SWARE-Spam-Status:X-Spam-Check-By:Received:Received:Received:Received:Received:Date:From:To:Subject:Message-ID:MIME-Version:Content-Type:Content-Disposition:User-Agent:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=hw7DGfFWoXfPDNh1XFne4qyKoh8N0HkdF9LUCNvxF+PfN7BECrcyC3Ay3D5rAY pgQr9GC3+IE2FJJsWuW1pXPIJZNhzJyg0esgCV3tGHbvh16MzwdoEZE/QKHa4eyM ZKFDh9NrH1NkLTaf5Jo49WOoEM+Kjzlsleu7SVT5xbeNg=; Received: (qmail 3288 invoked by alias); 22 Nov 2012 20:37:57 -0000 Received: (qmail 3196 invoked by uid 22791); 22 Nov 2012 20:37:56 -0000 X-SWARE-Spam-Status: No, hits=-4.1 required=5.0 tests=AWL, BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, FREEMAIL_FROM, KHOP_RCVD_TRUST, RCVD_IN_DNSWL_LOW, RCVD_IN_HOSTKARMA_YE, TW_BT, TW_DB X-Spam-Check-By: sourceware.org Received: from mail-ie0-f175.google.com (HELO mail-ie0-f175.google.com) (209.85.223.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 22 Nov 2012 20:37:51 +0000 Received: by mail-ie0-f175.google.com with SMTP id qd14so7272839ieb.20 for ; Thu, 22 Nov 2012 12:37:50 -0800 (PST) Received: by 10.50.36.200 with SMTP id s8mr1670408igj.23.1353616670649; Thu, 22 Nov 2012 12:37:50 -0800 (PST) Received: from gnu-tools-1.localdomain (76-220-57-190.lightspeed.sntcca.sbcglobal.net. [76.220.57.190]) by mx.google.com with ESMTPS id ex10sm3032366igc.15.2012.11.22.12.37.49 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 22 Nov 2012 12:37:50 -0800 (PST) Received: by gnu-tools-1.localdomain (Postfix, from userid 1000) id B25681A0637; Thu, 22 Nov 2012 12:37:47 -0800 (PST) Date: Thu, 22 Nov 2012 12:37:47 -0800 From: "H.J. Lu" To: gcc-patches@gcc.gnu.org Subject: [PATCH] Add --with-build-config=bootstrap-asan support Message-ID: <20121122203747.GA4264@gmail.com> MIME-Version: 1.0 Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org Delivered-To: mailing list gcc-patches@gcc.gnu.org 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 * 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 * 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!