From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 2676 invoked by alias); 29 Nov 2012 19:26:55 -0000 Received: (qmail 2630 invoked by uid 22791); 29 Nov 2012 19:26:53 -0000 X-SWARE-Spam-Status: No, hits=-3.8 required=5.0 tests=AWL,BAYES_00,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,KHOP_RCVD_TRUST,KHOP_THREADED,RCVD_IN_DNSWL_LOW,RCVD_IN_HOSTKARMA_YE X-Spam-Check-By: sourceware.org Received: from mail-qc0-f175.google.com (HELO mail-qc0-f175.google.com) (209.85.216.175) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 29 Nov 2012 19:26:47 +0000 Received: by mail-qc0-f175.google.com with SMTP id j3so11508011qcs.20 for ; Thu, 29 Nov 2012 11:26:46 -0800 (PST) MIME-Version: 1.0 Received: by 10.49.25.102 with SMTP id b6mr14715040qeg.27.1354217205152; Thu, 29 Nov 2012 11:26:45 -0800 (PST) Received: by 10.49.12.210 with HTTP; Thu, 29 Nov 2012 11:26:44 -0800 (PST) In-Reply-To: <20121129190602.GB2315@tucnak.redhat.com> References: <20121122203747.GA4264@gmail.com> <50B79D18.6050601@net-b.de> <50B7A866.4050804@oracle.com> <20121129190602.GB2315@tucnak.redhat.com> Date: Thu, 29 Nov 2012 20:12:00 -0000 Message-ID: Subject: Re: [PATCH] Add --with-build-config=bootstrap-asan support From: "H.J. Lu" To: Jakub Jelinek Cc: Paolo Carlini , Tobias Burnus , gcc-patches@gcc.gnu.org Content-Type: text/plain; charset=ISO-8859-1 X-IsSubscribed: yes Mailing-List: contact gcc-patches-help@gcc.gnu.org; run by ezmlm Precedence: bulk List-Id: List-Archive: List-Post: List-Help: Sender: gcc-patches-owner@gcc.gnu.org X-SW-Source: 2012-11/txt/msg02496.txt.bz2 On Thu, Nov 29, 2012 at 11:06 AM, Jakub Jelinek wrote: > On Thu, Nov 29, 2012 at 07:24:38PM +0100, Paolo Carlini wrote: >> On 11/29/2012 06:36 PM, Tobias Burnus wrote: >> >H.J. Lu wrote: >> >>This patch adds --with-build-config=bootstrap-asan support. Tested on >> >>Linux/x86-64. OK to install? >> > >> >I think that patch has broken bootstrap for me. If I do a normal >> >bootstrap, Stage1 fails with: >> > >> >libtool: compile: unrecognized option `-D_GNU_SOURCE' >> >libtool: compile: Try `libtool --help' for more information. >> >make[4]: *** [interception_linux.lo] Error 1 >> >make[4]: Leaving directory `/home/burnus/gcc/build/x86_64-unknown-linux-gnu/libsanitizer/interception' >> Likewise here. Would it be possible to revert the offending commit, >> in the meanwhile? > > Yes, H.J., please revert the patch, I thought you have tested it alone Done. > without any further patches. For the -I patch, I really would prefer if > libsanitizer just had a dependency on libstdc++ at toplevel > (configure-target-sanitizer depending on all-target-libstdc++-v3), > then you can (and similarly for host variants if we need host sanitizer at > all). Then you should be able to use scripts/testsuite_flags > --build-includes just fine. > >From Makefile.tpl: @if target-libstdc++-v3 # CXX_FOR_TARGET is tricky to get right for target libs that require a # functional C++ compiler. When we recurse, if we expand # CXX_FOR_TARGET before configuring libstdc++-v3, we won't get # libstdc++ include flags from the script. Instead, we get an # -funconfigured-* word, so that we'll get errors if this invalid C++ # command line is used for anything, but also so that we can use the # word to decide whether or not to pass on this CXX_FOR_TARGET. If we # don't pass it on, sub-make will use the default definition, that # re-expands it at the time of use, so we'll get it right when we need # it. One potential exception is the expansion of CXX_FOR_TARGET # passed down as part of CXX within TARGET_FLAGS, but this wouldn't # really work, for C++ host programs can't depend on the current-stage # C++ target library. CXX_FOR_TARGET_FLAG_TO_PASS = \ $(shell if echo "$(CXX_FOR_TARGET)" | grep " -funconfigured-" > /dev/null; then :; else echo '"CXX_FOR_TARGET=$(CXX_FOR_TARGET)"'; fi) @endif target-libstdc++-v3 bootstrap library in C++ has raw_cxx=true and CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/gcc/g++ -B$$r/$(HOST_SUBDIR)/gcc/ -nostdinc++ `if test -f $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags; then $(SHELL) $$r/$(TARGET_SUBDIR)/libstdc++-v3/scripts/testsuite_flags --build-includes; else echo -funconfigured-libstdc++-v3 ; fi` -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs RAW_CXX_FOR_TARGET=$(STAGE_CC_WRAPPER) $$r/$(HOST_SUBDIR)/gcc/xgcc -shared-libgcc -B$$r/$(HOST_SUBDIR)/gcc -nostdinc++ -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src -L$$r/$(TARGET_SUBDIR)/libstdc++-v3/src/.libs That is why we need to explicit -I for libstdc++ header files. If we remove raw_cxx=true from bootstrap C++ library, which include libstdc++ and libjava, they won't compile for multitib. scripts/testsuite_flags can not be used to compile bootstrap library in C++. -- H.J.