From: Richard Biener <richard.guenther@gmail.com>
To: Jason Merrill <jason@redhat.com>
Cc: GCC Patches <gcc-patches@gcc.gnu.org>
Subject: Re: [PATCH RFC] bootstrap: Update requirement to C++11.
Date: Sat, 16 May 2020 08:50:11 +0200 [thread overview]
Message-ID: <368BEA43-46F9-4A26-9C33-72B3EAB20667@gmail.com> (raw)
In-Reply-To: <0b5d1d53-ce32-c202-f3af-e2f43d200109@redhat.com>
On May 15, 2020 11:53:42 PM GMT+02:00, Jason Merrill <jason@redhat.com> wrote:
>On 5/15/20 2:21 PM, Richard Biener wrote:
>> On May 15, 2020 7:30:38 PM GMT+02:00, Jason Merrill
><jason@redhat.com> wrote:
>>> On Fri, May 15, 2020 at 3:15 AM Richard Biener
>>> <richard.guenther@gmail.com>
>>> wrote:
>>>
>>>>> +# When bootstrapping with GCC, build stage 1 in C++11 mode to
>>> ensure
>>>> that a
>>>>> +# C++11 compiler can still start the bootstrap.
>>>>> if test "$enable_bootstrap:$GXX" = "yes:yes"; then
>>>>> + CXX="$CXX -std=gnu++11"
>>>>
>>>> So I just spotted this - since we're requiring a ISO C++11 compiler
>shouldn't
>>>> we build stage1 with -std=c++11 rather than gnu++11 (whatever the
>detailed
>>>> differences are here)? Also not sure what level of -pedantic we'd
>need to
>>>> avoid GNU extensions even with -std=c++11. Of course there are (I
>hope)
>>>> a lot less GNU extensions for C++ than there were for C and
>hopefully
>>>> no extra in gnu++11 compared to gnu++98 which we checked
>previously.
>
>Building stage 1 with -std=c++11 -pedantic-errors works with 8.3.1, but
>
>fails pretty badly with 4.8.5,
>
>>> When we first moved to C++ I tried using -std=c++98, but there were
>too
>>> many places where we were assuming that if we're building with GCC,
>we can
>>> use GNU C extensions.
>>>
>>> I'll see if that's still a problem for -std=c++11.
>
>It doesn't seem to be, so I've made that change.
>
>>>> There also does not seem to be a configure check which may present
>>>> users with a more useful error message than later cryptic fail of
>build?
>>>> I suppose we cannot simply check __cplusplus for this, can we? Do
>>>> other common host compilers need additional options to enable
>C++11?
>>>
>>> Good point, I'll add that.
>
>This patch uses a test from the autoconf archive to add any needed
>flags. Tested with GCC 4.8.5 and clang 3.4.2 (with the above stage 1
>-std=c++11 disabled).
>
>>>> Should we try to second guess such flags via configury? For
>example
>>>> GCC 4.8 defaults to -std=gnu++98 and the above only seems to apply
>>>> to the bootstrap case so GCC 4.8 cannot be used to build cross
>>> compilers
>>>> without adjusting CC and CXX?
>>>
>>> Older GCC is still GCC and will get the flag automatically.
>>
>> But yes:yes suggests that when building a cross compiler this doesn't
>apply?
>
>True, but the new test should cover that case.
>
>OK for trunk?
OK if there are no further comments over the weekend.
Thanks,
Richard.
next prev parent reply other threads:[~2020-05-16 6:50 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-05-14 21:05 Jason Merrill
2020-05-14 21:09 ` Jakub Jelinek
2020-05-15 7:14 ` Richard Biener
2020-05-15 8:30 ` Richard Sandiford
2020-05-15 9:26 ` Richard Biener
2020-05-15 9:58 ` Richard Sandiford
2020-05-15 10:15 ` Richard Biener
2020-05-15 14:08 ` Richard Sandiford
2020-05-16 1:47 ` Martin Sebor
2020-05-16 2:45 ` Re: Jason Merrill
2020-05-16 10:43 ` [PATCH] Describe coding conventions surrounding "auto" Richard Sandiford
2020-05-18 16:37 ` Martin Sebor
2020-05-18 18:02 ` Richard Sandiford
2020-05-18 18:42 ` Jason Merrill
2020-05-18 22:51 ` Martin Sebor
2020-05-19 9:26 ` Richard Sandiford
2020-05-19 9:36 ` Nicholas Krause
2020-05-15 17:36 ` [PATCH RFC] bootstrap: Update requirement to C++11 Jason Merrill
2020-05-15 17:30 ` Jason Merrill
2020-05-15 18:21 ` Richard Biener
2020-05-15 21:53 ` Jason Merrill
2020-05-16 6:50 ` Richard Biener [this message]
2020-06-05 16:00 ` Christophe Lyon
2020-06-05 16:39 ` Jason Merrill
2020-06-05 17:58 ` Jason Merrill
2020-06-07 16:56 ` Christophe Lyon
2020-06-08 2:10 ` Jason Merrill
2020-06-08 10:34 ` Martin Jambor
2020-06-08 19:03 ` Jason Merrill
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=368BEA43-46F9-4A26-9C33-72B3EAB20667@gmail.com \
--to=richard.guenther@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jason@redhat.com \
/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).