Received: by 2002:a05:6a10:9afc:0:0:0:0 with SMTP id t28csp3938966pxm; Tue, 1 Mar 2022 08:11:36 -0800 (PST) X-Google-Smtp-Source: ABdhPJzRWmIONd9BtRm+s9mKlHST6jZhLy6zQdAbQLcAE1SJutNBiFKjipmPEQCljTiPvZD7adB+ X-Received: by 2002:a50:ec95:0:b0:413:4d34:642d with SMTP id e21-20020a50ec95000000b004134d34642dmr25816504edr.3.1646151096683; Tue, 01 Mar 2022 08:11:36 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646151096; cv=none; d=google.com; s=arc-20160816; b=DIXFpeLxcCGkfbsC68VOgMnC2pmSRepSly0IhozGkII6g+nKDmwP8x4jE1nQHTpLw5 kBDn0CVAIWR5addK42hlk2/7xxgDuutTNFz/4lXY4C51z+kIvw5bNbxT/wqTCmDpicSO 6VZ1kX5nPWCGT31Lspaqp1LhIYAZY42BsG1YP7pUGIl5/V1dYVJdDne3Dtoj0G/DY+vs 9xq61vjF6ZO+E4HyUYpnr3xb76s0kI650iARwtewOu+y8Z3Rtn4VgsV1nyXHJTmBh8/w idmVNvZ6765gkBU4d5omJjCYfeC0IXB2VIFEROfLJ2Cwge1vXIdQBoOJQE3cgQ+ZHJ29 nX3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=S9dYm06FsGQzmBX+VX511e7rKvM8+2wwptQYrjL0gD8=; b=WU3qbQwiGphNtBsWsPayLeQlpvYfxI/sppNujs2wRpXbivo6hmAtvSJeYKSwyJyDXE oe5F/MEQBotsZPu36CD+e1eEdKPeu5z+Yk4rJnE37kPy6SszYy4wGLhTWYRGTnJvrEBr jD5w+6xWEXqS4M3DNNCfWBmcmKwy/sHy0LExE5kJEukUVwUxw3NWcbzSLaQMGJs7UsQg 5fXgChXWcyQz8oCf/OxbPI3LwT5SZVZUkJtqqIiir80SWIgch766FGg43RH1NRouiRer WUnexBzdD8z1u7brOUYQcmTzoMo5ZXXrslcEwH2FdUmHw3JTKhBXUCrz8XFMKazWI+qY 3K1A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=oj5yynka; 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 w3-20020a170906480300b006d090f61f60si7903173ejq.519.2022.03.01.08.11.13; Tue, 01 Mar 2022 08:11:36 -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=oj5yynka; 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 S235460AbiCAOxp (ORCPT + 99 others); Tue, 1 Mar 2022 09:53:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45026 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235433AbiCAOxf (ORCPT ); Tue, 1 Mar 2022 09:53:35 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F26EF483BC; Tue, 1 Mar 2022 06:52: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 76EC36159D; Tue, 1 Mar 2022 14:52:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EC19EC340F2; Tue, 1 Mar 2022 14:52:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1646146371; bh=LfiWmfs6qErICD+TfIJqX84uNv2I/FQMxqCURJD4QRk=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=oj5yynkamny/AtSQRD5xLhnAE4W3TodX8euUSgx+w4IDEx9hwirHYK/YzcWwlAiKe Mg3CZZjAlee0DdCyh69ulex4StSRHfMowWaXSiygI/D7T3pAtRjY/7TduakOK2tRp0 ruh5tHf11STcPDIDu7/jTpRxTT5Ep9eXIh3KpArhOdIc5KNHgjEgBMUVOZccPOHz8d SKWzudpfx2tkaCKiX3qXiLE+5BEHg+bZoUdHwM9tmQhSEHDsr0peusS2SV76uDkNwp mOBX1cTcDDulQKZqtFCr+w47Nq6KtbMZwHVWg9lzZJrJ/gDP0JG4lL2HDvHsc8Pxnx 14M0Azozwf7pw== From: Arnd Bergmann To: Masahiro Yamada Cc: 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: [PATCH 3/3] Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS Date: Tue, 1 Mar 2022 15:52:33 +0100 Message-Id: <20220301145233.3689119-3-arnd@kernel.org> X-Mailer: git-send-email 2.29.2 In-Reply-To: <20220301145233.3689119-1-arnd@kernel.org> References: <20220301145233.3689119-1-arnd@kernel.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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 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] Signed-off-by: Arnd Bergmann --- 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