]> git.baikalelectronics.ru Git - kernel.git/commit
Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS
authorArnd Bergmann <arnd@arndb.de>
Tue, 8 Mar 2022 21:56:15 +0000 (22:56 +0100)
committerMasahiro Yamada <masahiroy@kernel.org>
Sun, 13 Mar 2022 08:31:44 +0000 (17:31 +0900)
commitc8a4b81e405fe99dc8c47f303d9c69df8f2d4c9c
treee0c9caab2596def1e000712ff205a8392067b3ea
parent51a5ca1d8313d247687a1beffd895eaa68c0946f
Kbuild: use -std=gnu11 for KBUILD_USERCFLAGS

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 <arnd@arndb.de>
Reviewed-by: Nathan Chancellor <nathan@kernel.org>
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Tested-by: Sedat Dilek <sedat.dilek@gmail.com>
Signed-off-by: Masahiro Yamada <masahiroy@kernel.org>
Makefile