Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp414653pxm; Wed, 2 Mar 2022 00:45:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJzLIP9ORX3naRwnV35aOZSy9ZRbZgQn1LIMEFC0GlbQyAYTI8NT0IdG649gdZe57OxtNvvR X-Received: by 2002:a17:90a:8d85:b0:1b8:a215:e3e4 with SMTP id d5-20020a17090a8d8500b001b8a215e3e4mr25462348pjo.175.1646210717414; Wed, 02 Mar 2022 00:45:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646210717; cv=none; d=google.com; s=arc-20160816; b=oPVDubZ8aBO/ICOyH6rekxlsxbi6kuLhLda28zzW4WKlLb38K8CX0M09LmaBuiSI8o UxRn8J8tljzYFR7MOfKcU0zShaeD92pZm6DJSL9vjA+tac6ukyJZ00feTxiZBUoMyhV6 yryxoB2B4uUQQwnCx8EGb0lZR9Kiphb79mPlKCARG8onwrlYZPFGYjA0c2nD5sOL0yHb AYm22zFp+x/Z/0uCD4P0MnL3JTOUxdlBOftekXrq5hUET6KR4C4vwTqDfcc5ycOhvHKs ZyrQMU1+D/QA2GlK5p1ZlTX02GObqDCFm72ifUWOvvFJp+m2d6At6ltpMVUmNCbajA2G m35A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ubIOHtZsAcRLZ1cmYG3XdKtQoWfYnAT4JlBbkEAtFGE=; b=KUaYEfbcwVkP+JJY/d86leWVlMEv5ZAlPAxfK0NolCQM4fQ5oOGTaAS8TZSgWKot7V 53wpGXTKHo8t1mju2nviyaiQlNb3GmS7w0hwkKbbWp+AWGU5COoSbV1jRjBUK9S/FlOW gv39eMWaTgWi5pOKKDn5p1tJfCXX9pvFdRICJtP4fQBQQnMDuoTK7ckfRMPi4UQnQyrO ZI1PGUlZPrUSRt1m7ocuv1vrBnFFL+VlfqXRDpd1gmYnNUeekyz/OhVlNwW08rDPDrbT iNcmsEc4npSEVpILMhyWE0vXrS8v79d+Oo+wlydt+Or6zpE8zi89c+D6AVgN4CvEjezU sz0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uejxuz68; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id y15-20020a634b0f000000b003741f961936si14691302pga.832.2022.03.02.00.45.02; Wed, 02 Mar 2022 00:45:17 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=uejxuz68; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236323AbiCARBe (ORCPT + 99 others); Tue, 1 Mar 2022 12:01:34 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:58038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235293AbiCARBd (ORCPT ); Tue, 1 Mar 2022 12:01:33 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1BAC21AD82; Tue, 1 Mar 2022 09:00:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 9E9FA60FCD; Tue, 1 Mar 2022 17:00:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 33A3DC340EE; Tue, 1 Mar 2022 17:00:47 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646154051; bh=h907ipPkeeK8P2nHj6SjBPg75fPHts99jpm7hU3oTe4=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=uejxuz68JNN+P/Ws/LbTy+IcncnwZTwo3NQso7ZdH7w978wfAVW3186wDBd9SzsvQ kNm3lkRQv5WwuJB/zW5sCTRZw66PNcdHW0Y8xqQzw6dI5HVsJZofimyKsKGnA23U26 pm1v1ubbzy45uxc1q1rpOavS/mjiXtwgBo5eyrEsQLMhAHhiNWjvnMUZHulkbiDtey zoovisI+XRC+c3rMe9bDqCkk4dhfLZA9Sz+xxGcMKgexowZ1PBAjwmUFgxDEf7BIU3 +QI1xlshWc56KtdACRoQy2cp54d1DnemenhEjTrXbUzW6dj/1IqTUJWR7wl21ymGDK /6i415XEZ/Tqg== Date: Tue, 1 Mar 2022 10:00:45 -0700 From: Nathan Chancellor To: Arnd Bergmann Cc: Masahiro Yamada , Arnd Bergmann , Linus Torvalds , Marco Elver , Jani Nikula , David Sterba , Alex Shi , Nick Desaulniers , Miguel Ojeda , Mark Rutland , linux-kbuild@vger.kernel.org, llvm@lists.linux.dev, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH 3/3] Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS Message-ID: References: <20220301145233.3689119-1-arnd@kernel.org> <20220301145233.3689119-3-arnd@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220301145233.3689119-3-arnd@kernel.org> X-Spam-Status: No, score=-7.5 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 01, 2022 at 03:52:33PM +0100, Arnd Bergmann wrote: > From: Arnd Bergmann > > As we change the C language standard for the kernel from gnu89 to > gnu11, it makes sense to also update the version for user space > compilation. > > Some users have older native compilers than what they use for > kernel builds, so I considered using gnu99 as the default version > for wider compatibility with gcc-4.6 and earlier. > > However, testing with older compilers showed that we already require > HOSTCC version 5.1 as well because a lot of host tools include > linux/compiler.h that uses __has_attribute(): > > CC tools/objtool/exec-cmd.o > In file included from tools/include/linux/compiler_types.h:36:0, > from tools/include/linux/compiler.h:5, > from exec-cmd.c:2: > tools/include/linux/compiler-gcc.h:19:5: error: "__has_attribute" is not defined [-Werror=undef] For what it's worth, I think this is a bug: https://lore.kernel.org/r/c1b1a299-c60d-28a4-07ab-1ecd211d6da9@i-love.sakura.ne.jp/ https://lore.kernel.org/r/20220102120201.594408-1-xu.xin16@zte.com.cn/ I never got clear feedback on resolving it from the first thread and nobody bothered to pick up the second patch. > Signed-off-by: Arnd Bergmann Nobody has yelled that loud though, so this is probably fine. Reviewed-by: Nathan Chancellor > --- > Makefile | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/Makefile b/Makefile > index 37ef6a555dcd..7c9be7f1ccd4 100644 > --- a/Makefile > +++ b/Makefile > @@ -432,7 +432,7 @@ HOSTCXX = g++ > endif > > export KBUILD_USERCFLAGS := -Wall -Wmissing-prototypes -Wstrict-prototypes \ > - -O2 -fomit-frame-pointer -std=gnu89 \ > + -O2 -fomit-frame-pointer -std=gnu11 \ > -Wdeclaration-after-statement > export KBUILD_USERLDFLAGS := > > -- > 2.29.2 > >