From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 1833 invoked by alias); 21 May 2015 15:08:16 -0000 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 Received: (qmail 1820 invoked by uid 89); 21 May 2015 15:08:15 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-1.7 required=5.0 tests=AWL,BAYES_50,KAM_LAZY_DOMAIN_SECURITY,SPF_HELO_PASS,T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Thu, 21 May 2015 15:08:04 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (Postfix) with ESMTPS id EFFBBB5E6D for ; Thu, 21 May 2015 15:08:02 +0000 (UTC) Received: from [10.10.116.39] ([10.10.116.39]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t4LF8158005464; Thu, 21 May 2015 11:08:02 -0400 Message-ID: <555DF4CD.5010105@redhat.com> Date: Thu, 21 May 2015 15:11:00 -0000 From: Jason Merrill User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: Alexandre Oliva CC: gcc-patches List Subject: Re: RFA: PATCH to use -std=c++98 in stage 1 of bootstrap References: <555CC048.8070209@redhat.com> In-Reply-To: Content-Type: multipart/mixed; boundary="------------010506000102010507090600" X-SW-Source: 2015-05/txt/msg01980.txt.bz2 This is a multi-part message in MIME format. --------------010506000102010507090600 Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Content-length: 391 On 05/20/2015 06:11 PM, Alexandre Oliva wrote: > The only serious problem with the patch is that it changes Makefile.in, > but not the corresponding part of Makefile.tpl from which it is > generated. Ok with that change. > > Now, if you'd also update the comments just before it, that still > suggest we build only C in stage1, that would be appreciated. Sure, here's what I'm applying. --------------010506000102010507090600 Content-Type: text/x-patch; name="s1-98.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="s1-98.patch" Content-length: 4652 commit 09fbb5f79eae1e95ce64b0f746e9085567e86fbf Author: Jason Merrill Date: Mon May 18 23:58:41 2015 -0400 * configure.ac: Add -std=c++98 to stage1_cxxflags. * Makefile.tpl (STAGE1_CXXFLAGS): And substitute it. * Makefile.in, configure: Regenerate. diff --git a/Makefile.in b/Makefile.in index c221a0b..7ae2a40 100644 --- a/Makefile.in +++ b/Makefile.in @@ -482,13 +482,12 @@ STAGEfeedback_TFLAGS = $(STAGE_TFLAGS) STAGEfeedback_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS) -# Only build the C compiler for stage1, because that is the only one that -# we can guarantee will build with the native compiler, and also it is the -# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), -# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them -# overrideable (for a bootstrap build stage1 also builds gcc.info). +# By default, C and C++ are the only stage1 languages, because they are the +# only ones we require to build with the bootstrap compiler, and also the +# only ones useful for building stage2. STAGE1_CFLAGS = @stage1_cflags@ +STAGE1_CXXFLAGS = @stage1_cxxflags@ STAGE1_CHECKING = @stage1_checking@ STAGE1_LANGUAGES = @stage1_languages@ # * We force-disable intermodule optimizations, even if @@ -677,7 +676,9 @@ 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 -# Flags to pass down to all sub-makes. +# Flags to pass down to all sub-makes. STAGE*FLAGS, +# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them +# overrideable (for a bootstrap build stage1 also builds gcc.info). BASE_FLAGS_TO_PASS = \ "DESTDIR=$(DESTDIR)" \ "RPATH_ENVVAR=$(RPATH_ENVVAR)" \ diff --git a/Makefile.tpl b/Makefile.tpl index ec53b59..914196f 100644 --- a/Makefile.tpl +++ b/Makefile.tpl @@ -435,13 +435,12 @@ STAGE[+id+]_TFLAGS = $(STAGE_TFLAGS) STAGE[+id+]_CONFIGURE_FLAGS = $(STAGE_CONFIGURE_FLAGS) [+ ENDFOR bootstrap-stage +] -# Only build the C compiler for stage1, because that is the only one that -# we can guarantee will build with the native compiler, and also it is the -# only thing useful for building stage2. STAGE1_CFLAGS (via CFLAGS), -# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them -# overrideable (for a bootstrap build stage1 also builds gcc.info). +# By default, C and C++ are the only stage1 languages, because they are the +# only ones we require to build with the bootstrap compiler, and also the +# only ones useful for building stage2. STAGE1_CFLAGS = @stage1_cflags@ +STAGE1_CXXFLAGS = @stage1_cxxflags@ STAGE1_CHECKING = @stage1_checking@ STAGE1_LANGUAGES = @stage1_languages@ # * We force-disable intermodule optimizations, even if @@ -579,7 +578,9 @@ 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 -# Flags to pass down to all sub-makes. +# Flags to pass down to all sub-makes. STAGE*FLAGS, +# MAKEINFO and MAKEINFOFLAGS are explicitly passed here to make them +# overrideable (for a bootstrap build stage1 also builds gcc.info). BASE_FLAGS_TO_PASS =[+ FOR flags_to_pass +][+ IF optional +] \ "`echo '[+flag+]=$([+flag+])' | sed -e s'/[^=][^=]*=$$/XFOO=/'`"[+ ELSE optional +] \ "[+flag+]=$([+flag+])"[+ ENDIF optional+][+ ENDFOR flags_to_pass +][+ FOR bootstrap-stage +] \ diff --git a/configure b/configure index d804329..07aba3e 100755 --- a/configure +++ b/configure @@ -559,6 +559,7 @@ compare_exclusions host_shared stage2_werror_flag stage1_checking +stage1_cxxflags stage1_cflags MAINT MAINTAINER_MODE_FALSE @@ -14755,6 +14756,13 @@ case $build in *) stage1_cflags="-g -J" ;; esac ;; esac +stage1_cxxflags='$(STAGE1_CFLAGS)' +if test "$GCC" = yes; then + # Build stage 1 in C++98 mode to ensure that a C++98 compiler can still + # start the bootstrap. + stage1_cxxflags="$stage1_cxxflags -std=c++98" +fi + diff --git a/configure.ac b/configure.ac index 4da04b7..5808eda 100644 --- a/configure.ac +++ b/configure.ac @@ -3476,8 +3476,15 @@ case $build in *) stage1_cflags="-g -J" ;; esac ;; esac +stage1_cxxflags='$(STAGE1_CFLAGS)' +if test "$GCC" = yes; then + # Build stage 1 in C++98 mode to ensure that a C++98 compiler can still + # start the bootstrap. + stage1_cxxflags="$stage1_cxxflags -std=c++98" +fi AC_SUBST(stage1_cflags) +AC_SUBST(stage1_cxxflags) # Enable --enable-checking in stage1 of the compiler. AC_ARG_ENABLE(stage1-checking, --------------010506000102010507090600--