From: Nathan Chancellor <nathan@kernel.org>
To: Arnd Bergmann <arnd@kernel.org>
Cc: Masahiro Yamada <masahiroy@kernel.org>,
Arnd Bergmann <arnd@arndb.de>,
Linus Torvalds <torvalds@linux-foundation.org>,
Marco Elver <elver@google.com>,
Jani Nikula <jani.nikula@intel.com>,
David Sterba <dsterba@suse.com>, Alex Shi <alexs@kernel.org>,
Nick Desaulniers <ndesaulniers@google.com>,
Miguel Ojeda <ojeda@kernel.org>,
Mark Rutland <mark.rutland@arm.com>,
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
Date: Tue, 1 Mar 2022 10:00:45 -0700 [thread overview]
Message-ID: <Yh5RPeqikTtoUS80@dev-arch.archlinux-ax161> (raw)
In-Reply-To: <20220301145233.3689119-3-arnd@kernel.org>
On Tue, Mar 01, 2022 at 03:52:33PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann <arnd@arndb.de>
>
> 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 <arnd@arndb.de>
Nobody has yelled that loud though, so this is probably fine.
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
> ---
> 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
>
>
next prev parent reply other threads:[~2022-03-01 17:00 UTC|newest]
Thread overview: 28+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-03-01 14:52 [PATCH 1/3] [v3] Kbuild: move to -std=gnu11 Arnd Bergmann
2022-03-01 14:52 ` [PATCH 2/3] treewide: use -Wdeclaration-after-statement Arnd Bergmann
2022-03-01 16:54 ` Nathan Chancellor
2022-03-01 19:57 ` Nick Desaulniers
2022-03-01 20:06 ` Nick Desaulniers
2022-03-01 20:20 ` Linus Torvalds
2022-03-01 20:28 ` Nick Desaulniers
2022-03-03 0:44 ` Masahiro Yamada
2022-03-04 11:29 ` Sedat Dilek
2022-03-06 10:03 ` Sedat Dilek
2022-03-01 14:52 ` [PATCH 3/3] Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS Arnd Bergmann
2022-03-01 17:00 ` Nathan Chancellor [this message]
2022-03-01 19:56 ` Nick Desaulniers
2022-03-02 22:14 ` Sedat Dilek
2022-03-02 22:54 ` Nick Desaulniers
2022-03-03 6:26 ` Sedat Dilek
2022-03-03 17:37 ` Nathan Chancellor
2022-03-04 6:47 ` Sedat Dilek
2022-03-04 7:18 ` Sedat Dilek
2022-03-04 11:12 ` Sedat Dilek
2022-03-06 10:04 ` Sedat Dilek
2022-03-01 16:53 ` [PATCH 1/3] [v3] Kbuild: move to -std=gnu11 Nathan Chancellor
2022-03-04 5:03 ` Masahiro Yamada
2022-03-04 11:24 ` Sedat Dilek
2022-03-06 10:01 ` Sedat Dilek
2022-03-04 11:37 ` Sedat Dilek
2022-03-04 16:25 ` Sedat Dilek
2022-03-06 15:31 ` Sedat Dilek
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=Yh5RPeqikTtoUS80@dev-arch.archlinux-ax161 \
--to=nathan@kernel.org \
--cc=alexs@kernel.org \
--cc=arnd@arndb.de \
--cc=arnd@kernel.org \
--cc=dsterba@suse.com \
--cc=elver@google.com \
--cc=jani.nikula@intel.com \
--cc=linux-doc@vger.kernel.org \
--cc=linux-kbuild@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=mark.rutland@arm.com \
--cc=masahiroy@kernel.org \
--cc=ndesaulniers@google.com \
--cc=ojeda@kernel.org \
--cc=torvalds@linux-foundation.org \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.