From patchwork Tue Dec 11 19:27:14 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: 205295 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 25B192C0086 for ; Wed, 12 Dec 2012 06:27:29 +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=1355858850; h=Comment: DomainKey-Signature:Received:Received:Received:Received: MIME-Version:Received:Received:In-Reply-To:References:Date: Message-ID:Subject:From:To:Cc:Content-Type:Mailing-List: Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post: List-Help:Sender:Delivered-To; bh=LYQvSDg3gAcEbpBpp7LYGeUrwqE=; b=DHNCA5OILF41i5ksfvUQ7mboO68CSNG/JkPZvJFqJLjKrhnziH5ZRdRcQySRAf 3iHLoWxKuMqTLwLZyr3zyQc6YAsOMBgJiebErtJwqKldi8Tga4LqLkpqz1eLeGU8 JFj3GAiAdK+6J9mAQIzWFisX64ai3P6PiJDvOxQKiiQbw= 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:MIME-Version:Received:Received:In-Reply-To:References:Date:Message-ID:Subject:From:To:Cc:Content-Type:X-IsSubscribed:Mailing-List:Precedence:List-Id:List-Unsubscribe:List-Archive:List-Post:List-Help:Sender:Delivered-To; b=Hx+7j05CDnClt6bIFst3SAWZfa4cvnSv4sSXFp+5P+dLDAhV8KUZwJCA5QoBeR utMptUhNqnzx6x1WQng2kB/nvBaTejVFlnYjzIN0Iw9ogPS1uaJcnCaEjEzXZ6Re jjT0+PAbFQOA2a979qaOeZKgcJJnwd1HjUBgxy8+vKR8c=; Received: (qmail 30202 invoked by alias); 11 Dec 2012 19:27:25 -0000 Received: (qmail 30190 invoked by uid 22791); 11 Dec 2012 19:27:24 -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-qa0-f47.google.com (HELO mail-qa0-f47.google.com) (209.85.216.47) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Tue, 11 Dec 2012 19:27:16 +0000 Received: by mail-qa0-f47.google.com with SMTP id a19so3380831qad.20 for ; Tue, 11 Dec 2012 11:27:15 -0800 (PST) MIME-Version: 1.0 Received: by 10.49.25.102 with SMTP id b6mr41261330qeg.27.1355254034395; Tue, 11 Dec 2012 11:27:14 -0800 (PST) Received: by 10.49.12.210 with HTTP; Tue, 11 Dec 2012 11:27:14 -0800 (PST) In-Reply-To: <50C744EC.6080109@gnu.org> References: <50C744EC.6080109@gnu.org> Date: Tue, 11 Dec 2012 11:27:14 -0800 Message-ID: Subject: Re: PING^2: [PATCH] PR sanitizer/55533: Can't bootstrap libsanitizer From: "H.J. Lu" To: Paolo Bonzini Cc: DJ Delorie , neroden@gcc.gnu.org, Alexandre Oliva , Ralf Wildenhues , gcc-patches@gcc.gnu.org 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 On Tue, Dec 11, 2012 at 6:36 AM, Paolo Bonzini wrote: > > As a followup please check if AM_MAKEFLAGS is needed at all. > >>>> diff --git a/libsanitizer/Makefile.in b/libsanitizer/Makefile.in >>>> index 21c2711..53e0be9 100644 >>>> --- a/libsanitizer/Makefile.in >>>> +++ b/libsanitizer/Makefile.in > > Please do not include regenerated files in the patch. > >>>> diff --git a/libsanitizer/asan/Makefile.am b/libsanitizer/asan/Makefile.am >>>> index 3da1db3..45fb3b3 100644 >>>> --- a/libsanitizer/asan/Makefile.am >>>> +++ b/libsanitizer/asan/Makefile.am >>>> @@ -5,6 +5,10 @@ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) >>>> >>>> DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -DASAN_HAS_EXCEPTIONS=1 -DASAN_FLEXIBLE_MAPPING_AND_OFFSET=0 -DASAN_NEEDS_SEGV=1 >>>> AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -Wno-c99-extensions >>>> +## We require libstdc++-v3 to be in the same build tree. >>>> +AM_CXXFLAGS += -I../../libstdc++-v3/include \ >>>> + -I../../libstdc++-v3/include/$(target_noncanonical) \ >>>> + -I$(srcdir)/../../libstdc++-v3/libsupc++ > > As a followup, please bring back the possibility to build libsanitizer > standalone, also wrapping the chooice of flags to link to libstdc++-v3 > in a new config/libstdc++-raw-cxx.m4 file. Done. > Bonus points for using this macro elsewhere in the tree. That will be a separate patch. >>>> ACLOCAL_AMFLAGS = -I $(top_srcdir) -I $(top_srcdir)/config >>>> >>>> toolexeclib_LTLIBRARIES = libasan.la >>>> @@ -64,8 +68,6 @@ AM_MAKEFLAGS = \ >>>> "includedir=$(includedir)" \ >>>> "AR=$(AR)" \ >>>> "AS=$(AS)" \ >>>> - "CC=$(CC)" \ >>>> - "CXX=$(CXX)" \ >>>> "LD=$(LD)" \ >>>> "LIBCFLAGS=$(LIBCFLAGS)" \ >>>> "NM=$(NM)" \ > > Same as above, and same for other .am files. > > >>>> diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac >>>> index 2d62ec4..9c73904 100644 >>>> --- a/libsanitizer/configure.ac >>>> +++ b/libsanitizer/configure.ac >>>> @@ -19,6 +19,7 @@ AC_MSG_RESULT($version_specific_libs) >>>> # Do not delete or change the following two lines. For why, see >>>> # http://gcc.gnu.org/ml/libstdc++/2003-07/msg00451.html >>>> AC_CANONICAL_SYSTEM >>>> +ACX_NONCANONICAL_TARGET > > Note that if you create a new macro, ACX_NONCANONICAL_TARGET should be > AC_REQUIREd there. > Here is the updated patch. OK to install? Thanks. diff --git a/config/libstdc++-raw-cxx.m4 b/config/libstdc++-raw-cxx.m4 new file mode 100644 index 0000000..453153c --- /dev/null +++ b/config/libstdc++-raw-cxx.m4 @@ -0,0 +1,26 @@ +# This file is part of GCC. +# +# GCC is free software; you can redistribute it and/or modify it under +# the terms of the GNU General Public License as published by the Free +# Software Foundation; either version 3, or (at your option) any later +# version. +# +# GCC is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# for more details. +# +# You should have received a copy of the GNU General Public License +# along with GCC; see the file COPYING3. If not see +# . + +# Define compiler flags, LIBSTDCXX_RAW_CXX_CXXFLAGS, for libstdc++-v3 +# header files to compile libraries in C++ with raw_cxx=true. +AC_DEFUN([GCC_LIBSTDCXX_RAW_CXX_CXXFLAGS], [ + AC_REQUIRE([ACX_NONCANONICAL_TARGET]) + LIBSTDCXX_RAW_CXX_CXXFLAGS="\ + -I\$(top_builddir)/../libstdc++-v3/include \ + -I\$(top_builddir)/../libstdc++-v3/include/\$(target_noncanonical) \ + -I\$(top_srcdir)/../libstdc++-v3/libsupc++" + AC_SUBST(LIBSTDCXX_RAW_CXX_CXXFLAGS) +]) diff --git a/libsanitizer/Makefile.am b/libsanitizer/Makefile.am index 9a06839..308d438 100644 --- a/libsanitizer/Makefile.am +++ b/libsanitizer/Makefile.am @@ -41,8 +41,6 @@ AM_MAKEFLAGS = \ "includedir=$(includedir)" \ "AR=$(AR)" \ "AS=$(AS)" \ - "CC=$(CC)" \ - "CXX=$(CXX)" \ "LD=$(LD)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "NM=$(NM)" \ diff --git a/libsanitizer/asan/Makefile.am b/libsanitizer/asan/Makefile.am index 7656f9f..59327a0 100644 --- a/libsanitizer/asan/Makefile.am +++ b/libsanitizer/asan/Makefile.am @@ -8,6 +8,7 @@ if USING_MAC_INTERPOSE DEFS += -DMAC_INTERPOSE_FUNCTIONS -DMISSING_BLOCKS_SUPPORT endif AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -Wno-c99-extensions +AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) ACLOCAL_AMFLAGS = -I $(top_srcdir) -I $(top_srcdir)/config toolexeclib_LTLIBRARIES = libasan.la @@ -73,8 +74,6 @@ AM_MAKEFLAGS = \ "includedir=$(includedir)" \ "AR=$(AR)" \ "AS=$(AS)" \ - "CC=$(CC)" \ - "CXX=$(CXX)" \ "LD=$(LD)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "NM=$(NM)" \ diff --git a/libsanitizer/configure.ac b/libsanitizer/configure.ac index 30614e5..4090e6c 100644 --- a/libsanitizer/configure.ac +++ b/libsanitizer/configure.ac @@ -21,6 +21,7 @@ AC_MSG_RESULT($version_specific_libs) AC_CANONICAL_SYSTEM target_alias=${target_alias-$host_alias} AC_SUBST(target_alias) +GCC_LIBSTDCXX_RAW_CXX_CXXFLAGS AM_INIT_AUTOMAKE(foreign) AM_ENABLE_MULTILIB(, ..) diff --git a/libsanitizer/interception/Makefile.am b/libsanitizer/interception/Makefile.am index a815dcf..6ae59b5 100644 --- a/libsanitizer/interception/Makefile.am +++ b/libsanitizer/interception/Makefile.am @@ -5,6 +5,7 @@ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -Wno-c99-extensions +AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) ACLOCAL_AMFLAGS = -I m4 noinst_LTLIBRARIES = libinterception.la @@ -47,8 +48,6 @@ AM_MAKEFLAGS = \ "includedir=$(includedir)" \ "AR=$(AR)" \ "AS=$(AS)" \ - "CC=$(CC)" \ - "CXX=$(CXX)" \ "LD=$(LD)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "NM=$(NM)" \ diff --git a/libsanitizer/sanitizer_common/Makefile.am b/libsanitizer/sanitizer_common/Makefile.am index 2968c05..708b2a4 100644 --- a/libsanitizer/sanitizer_common/Makefile.am +++ b/libsanitizer/sanitizer_common/Makefile.am @@ -5,6 +5,7 @@ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros -Wno-c99-extensions +AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) ACLOCAL_AMFLAGS = -I m4 noinst_LTLIBRARIES = libsanitizer_common.la @@ -59,8 +60,6 @@ AM_MAKEFLAGS = \ "includedir=$(includedir)" \ "AR=$(AR)" \ "AS=$(AS)" \ - "CC=$(CC)" \ - "CXX=$(CXX)" \ "LD=$(LD)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "NM=$(NM)" \ diff --git a/libsanitizer/tsan/Makefile.am b/libsanitizer/tsan/Makefile.am index a391986..867c152 100644 --- a/libsanitizer/tsan/Makefile.am +++ b/libsanitizer/tsan/Makefile.am @@ -5,6 +5,7 @@ gcc_version := $(shell cat $(top_srcdir)/../gcc/BASE-VER) DEFS = -D_GNU_SOURCE -D_DEBUG -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS AM_CXXFLAGS = -Wall -W -Wno-unused-parameter -Wwrite-strings -pedantic -Wno-long-long -fPIC -fno-builtin -fno-exceptions -fomit-frame-pointer -funwind-tables -fvisibility=hidden -Wno-variadic-macros +AM_CXXFLAGS += $(LIBSTDCXX_RAW_CXX_CXXFLAGS) ACLOCAL_AMFLAGS = -I m4 toolexeclib_LTLIBRARIES = libtsan.la @@ -67,8 +68,6 @@ AM_MAKEFLAGS = \ "includedir=$(includedir)" \ "AR=$(AR)" \ "AS=$(AS)" \ - "CC=$(CC)" \ - "CXX=$(CXX)" \ "LD=$(LD)" \ "LIBCFLAGS=$(LIBCFLAGS)" \ "NM=$(NM)" \