From: Kito Cheng <kito.cheng@gmail.com>
To: Romain Naour <romain.naour@gmail.com>
Cc: Jeff Law <jeffreyalaw@gmail.com>,
gcc-patches@gcc.gnu.org, kito.cheng@sifive.com,
juzhe.zhong@rivai.ai
Subject: Re: [PATCH] RISC-V: fix build issue with gcc 4.9.x
Date: Wed, 3 May 2023 08:37:21 +0800 [thread overview]
Message-ID: <CA+yXCZDrr-pHAhMZLrQM3xL0qYp7Xcf4+Aohuf-trZ7OkViuRg@mail.gmail.com> (raw)
In-Reply-To: <ea3ee2e1-c294-1388-b5e6-a3472fca0811@gmail.com>
> >>> Pushed to trunk, thanks for catching that, that's definitely should
> >>> use log2 no matter C++03 or C++11,
> >>> but I think GCC allows the usage of C++11 according to
> >>> https://gcc.gnu.org/install/prerequisites.html :P
> >> Yes, we should be able to use C++11. I'd like to get that to C++17 at
> >> some point, but I think the biggest problem is the desire to support
> >> bootstrapping on something like centos7/rhel7.
> >
> > At least we have auto and range based for loop, I am satisfied with
> > that enough.
>
> Indeed, gcc 4.9 already support C++11 but for some reason std::log2 fail with
> it. Probably because gcc 4.9 is the last gcc release with C++03 used by default.
> I wasn't able to reproduce the build issue (without my patch) with gcc 10 or 11.
Anyway I think your fix is reasonable since we include math.h not cmath.h here,
so use without std:: is rightway, but don't know why it is build-able
with newer GCC,
I guess that might be included by some other header indirectly.
> I'm fine with new prerequisites for the next gcc release, I checked the release
> note about that. I noticed that all toolchains I've built with gcc 13.1 for
> other cpu target where successful with the same setup (docker image).
>
> Thanks!
>
> Best regards,
> Romain
>
> >
> >
> >>
> >> jeff
>
next prev parent reply other threads:[~2023-05-03 0:37 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-05-02 12:21 Romain Naour
2023-05-02 14:31 ` Kito Cheng
2023-05-02 15:44 ` Jeff Law
2023-05-02 15:51 ` Kito Cheng
2023-05-02 20:46 ` Romain Naour
2023-05-03 0:37 ` Kito Cheng [this message]
2023-05-03 0:47 ` Andrew Pinski
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=CA+yXCZDrr-pHAhMZLrQM3xL0qYp7Xcf4+Aohuf-trZ7OkViuRg@mail.gmail.com \
--to=kito.cheng@gmail.com \
--cc=gcc-patches@gcc.gnu.org \
--cc=jeffreyalaw@gmail.com \
--cc=juzhe.zhong@rivai.ai \
--cc=kito.cheng@sifive.com \
--cc=romain.naour@gmail.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).