From: Tom Rini <trini@konsulko.com>
To: Bin Meng <bmeng.cn@gmail.com>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>
Subject: Re: [PATCH] tools: Stop re-defining -std= when building tools
Date: Mon, 11 Oct 2021 11:11:10 -0400 [thread overview]
Message-ID: <20211011151110.GH7964@bill-the-cat> (raw)
In-Reply-To: <20211011124409.GT7964@bill-the-cat>
[-- Attachment #1: Type: text/plain, Size: 2556 bytes --]
On Mon, Oct 11, 2021 at 08:44:09AM -0400, Tom Rini wrote:
> On Mon, Oct 11, 2021 at 11:21:49AM +0800, Bin Meng wrote:
> > On Mon, Oct 11, 2021 at 3:23 AM Tom Rini <trini@konsulko.com> wrote:
> > >
> > > While we intentionally set -std=gnu11 for building host tools, and have
> > > for quite some time, we never dropped -std=gnu99 from tools/Makefile.
> > > This resulted in passing -std=gnu11 ... -std=gnu99 when building, and
> > > gnu99 would win. This in turn would result now in warnings such as:
> > > tools/mkeficapsule.c:25:15: warning: redefinition of typedef 'u32' is a C11 feature [-Wtypedef-redefinition]
> > > typedef __u32 u32;
> > > ^
> > >
> > > Signed-off-by: Tom Rini <trini@konsulko.com>
> > > ---
> > > tools/Makefile | 3 +--
> > > 1 file changed, 1 insertion(+), 2 deletions(-)
> > >
> > > diff --git a/tools/Makefile b/tools/Makefile
> > > index 999fd4653166..b45219e2c30c 100644
> > > --- a/tools/Makefile
> > > +++ b/tools/Makefile
> > > @@ -295,8 +295,7 @@ HOST_EXTRACFLAGS += -include $(srctree)/include/compiler.h \
> > > -I$(srctree)/tools \
> > > -DUSE_HOSTCC \
> > > -D__KERNEL_STRICT_NAMES \
> > > - -D_GNU_SOURCE \
> > > - -std=gnu99
> > > + -D_GNU_SOURCE
> >
> > It looks like std=gnu11 is only added for Linux host.
> >
> > KBUILD_HOSTCFLAGS += $(CSTD_FLAG)
> >
> > Should we still keep it for other hosts?
>
> Good question. Looking at the Linux kernel, we're of course vastly
> diverged again at this point, but it always passes -std=gnu89 (because
> hey, we demand a newer minimum than the kernel) unless it's a tool/test
> that spells out something else. Given that Azure builds macOS and
> cygwin for us, I'll see what happens when we tell everyone to use
> -std=gnu11 and report back.
The build completed:
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3024&view=results
and the interesting parts are:
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3024&view=logs&j=35e64860-b659-5ca1-bdf9-6e9833a3e679&t=17b0785b-bff7-569f-a47c-ec4f4762bca5
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3024&view=logs&j=54366476-fdb5-57fd-e8dc-672a8abc134d&t=4b05ba05-ad38-52b6-35d9-bb8255f5e2ea
In sum, we can use -std=gnu11 everywhere. There's warnings on these
hosts, but that's been true before this change:
https://dev.azure.com/u-boot/u-boot/_build/results?buildId=2991&view=results
Posting v2 in a moment.
--
Tom
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]
prev parent reply other threads:[~2021-10-11 15:11 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-10 19:23 [PATCH] tools: Stop re-defining -std= when building tools Tom Rini
2021-10-11 3:21 ` Bin Meng
2021-10-11 12:44 ` Tom Rini
2021-10-11 15:11 ` Tom Rini [this message]
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=20211011151110.GH7964@bill-the-cat \
--to=trini@konsulko.com \
--cc=bmeng.cn@gmail.com \
--cc=u-boot@lists.denx.de \
/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