From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 32A0CC433F5 for ; Mon, 11 Oct 2021 15:11:25 +0000 (UTC) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3D84C60FD7 for ; Mon, 11 Oct 2021 15:11:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 3D84C60FD7 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id A5DC1836F3; Mon, 11 Oct 2021 17:11:21 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (1024-bit key; unprotected) header.d=konsulko.com header.i=@konsulko.com header.b="pilYLRof"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 925B5831C9; Mon, 11 Oct 2021 17:11:19 +0200 (CEST) Received: from mail-qv1-xf2a.google.com (mail-qv1-xf2a.google.com [IPv6:2607:f8b0:4864:20::f2a]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 8DF9A836FA for ; Mon, 11 Oct 2021 17:11:13 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=konsulko.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=trini@konsulko.com Received: by mail-qv1-xf2a.google.com with SMTP id k19so5443812qvm.13 for ; Mon, 11 Oct 2021 08:11:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=konsulko.com; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=0qdBPvPIuVN7rDre4b92vhA2KmsT5Z9xvdGKHdW7GP0=; b=pilYLRofUtrlUZLEaMCkZoMs96sA9J4tk3IUNU4RRj21zyWlkDLsFziSNnjOztsMae iqCK/U6qt1M3w+AGfM3S5q83JMz2cDfUQnsFfibBD6ooZ798WZ4/ANv4efm3ZxjjoyYm rm11cJpMa7sUpSKUBe+coNKKSm6Vnn7JWytZw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=0qdBPvPIuVN7rDre4b92vhA2KmsT5Z9xvdGKHdW7GP0=; b=hGAl+PKjuFKArQyA/9UuI2KFZ2lao13b+IGqUzsj8QxiXW50BmuurwM1b7k6AzCUFH YRHu4QFt5S7AgcaFf0B6w00JqRm0m8VnD3/KivAF9+/qXorXRNFFZ+n8xyo+vRsXA3UV /stZnsFtlIcTujbelQ8bK2SIrGCEKryEOtcxUJWgkg81E7q1Qbl4KFYzxjSE7ju+LjJ1 b7eriz8ZPQr8dPaoDKrPe1akTUcUDpRHZZGUgMqX4b3ozIwYBRS48fLnwMfl8uM/J/sd F5oBhxamfxYk3UwcrNa7y8GyF1+vOlBzE+pTJPj8Zkysd00ASjY98L9XlTyvXVHuY0do N59Q== X-Gm-Message-State: AOAM5313GFJetBz1UC6jkLG1z5t//YvUDFeJWinIDTSMc1zLepPVugPO Sxwd41J6R50ACldpbhsENu6aGg== X-Google-Smtp-Source: ABdhPJw0XpR75OpIV75UvkqeUxf9NxY7KnbpUfR62mWn5SDAy/1gnYE0hbQFN6lf7C3nCveLqsigIg== X-Received: by 2002:a05:6214:1370:: with SMTP id c16mr24420420qvw.36.1633965072220; Mon, 11 Oct 2021 08:11:12 -0700 (PDT) Received: from bill-the-cat (2603-6081-7b01-cbda-7461-ba79-88cf-55cd.res6.spectrum.com. [2603:6081:7b01:cbda:7461:ba79:88cf:55cd]) by smtp.gmail.com with ESMTPSA id y6sm4305834qkj.26.2021.10.11.08.11.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 08:11:11 -0700 (PDT) Date: Mon, 11 Oct 2021 11:11:10 -0400 From: Tom Rini To: Bin Meng Cc: U-Boot Mailing List Subject: Re: [PATCH] tools: Stop re-defining -std= when building tools Message-ID: <20211011151110.GH7964@bill-the-cat> References: <20211010192332.3929646-1-trini@konsulko.com> <20211011124409.GT7964@bill-the-cat> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="RDx6jqUKKzuYlRoE" Content-Disposition: inline In-Reply-To: <20211011124409.GT7964@bill-the-cat> X-Clacks-Overhead: GNU Terry Pratchett X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.2 at phobos.denx.de X-Virus-Status: Clean --RDx6jqUKKzuYlRoE Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable 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 wrote: > > > > > > While we intentionally set -std=3Dgnu11 for building host tools, and = have > > > for quite some time, we never dropped -std=3Dgnu99 from tools/Makefil= e. > > > This resulted in passing -std=3Dgnu11 ... -std=3Dgnu99 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 > > > --- > > > 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 +=3D -include $(srctree)/include= /compiler.h \ > > > -I$(srctree)/tools \ > > > -DUSE_HOSTCC \ > > > -D__KERNEL_STRICT_NAMES \ > > > - -D_GNU_SOURCE \ > > > - -std=3Dgnu99 > > > + -D_GNU_SOURCE > >=20 > > It looks like std=3Dgnu11 is only added for Linux host. > >=20 > > KBUILD_HOSTCFLAGS +=3D $(CSTD_FLAG) > >=20 > > Should we still keep it for other hosts? >=20 > Good question. Looking at the Linux kernel, we're of course vastly > diverged again at this point, but it always passes -std=3Dgnu89 (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=3Dgnu11 and report back. The build completed: https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3D3024&view=3Dre= sults and the interesting parts are: https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3D3024&view=3Dlo= gs&j=3D35e64860-b659-5ca1-bdf9-6e9833a3e679&t=3D17b0785b-bff7-569f-a47c-ec4= f4762bca5 https://dev.azure.com/u-boot/u-boot/_build/results?buildId=3D3024&view=3Dlo= gs&j=3D54366476-fdb5-57fd-e8dc-672a8abc134d&t=3D4b05ba05-ad38-52b6-35d9-bb8= 255f5e2ea In sum, we can use -std=3Dgnu11 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=3D2991&view=3Dre= sults Posting v2 in a moment. --=20 Tom --RDx6jqUKKzuYlRoE Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQGzBAABCgAdFiEEGjx/cOCPqxcHgJu/FHw5/5Y0tywFAmFkVAcACgkQFHw5/5Y0 tyyyiAv9GSnj6D3MtCpYmP7jJu2PZuFektfYIKVKB5d/9MvOY2GOHNziaSe9yKyT uPLI4R9Ar9/WR9l/GleO0rIYu9B1FH/VDBUkaxdgD41FHYHmnyQ76qe7bKvJozQe zsv9XZRHt8yxCIAvs6Mb68X/xjt0kvHeksZo5R9EJWAid891eKCBR2L5mUiIPqaY ylR8L2zOQcjpYITds9tROxYQXBKH8I8lTCfb2LzTS62Ixmid7UkjfgrCngT0fHzm +IpQVVzNk7ewWuvjCZ4snPQialsczvjhQ178tUk3c9viAN/GRySRAITIyYIn8/Hk 55KCr/hIA0SwpogUX/+TxG+E7ie7ix6exrF8fMzphdoLj8zcq78R4Yd2HZCEdL/U ClPRmgIeVgOna8nfj0I7NbKWIuhxnnM4aWBEUsuyCj1DqzGzr6LOlKo/l5kReHn/ 9x17IZif/FVWK04BJV/xn+ceDJ1AUJ40JvBUrOrfJWwvwSwUM9T2Kvd6pSgNpeu8 EvhWdXG2 =tHlj -----END PGP SIGNATURE----- --RDx6jqUKKzuYlRoE--