[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20180601165550.90053-3-ndesaulniers@google.com>
Date: Fri, 1 Jun 2018 09:55:49 -0700
From: Nick Desaulniers <ndesaulniers@...gle.com>
To: akpm@...ux-foundation.org, ard.biesheuvel@...aro.org,
aryabinin@...tuozzo.com, akataria@...are.com,
boris.ostrovsky@...cle.com, brijesh.singh@....com,
caoj.fnst@...fujitsu.com, gregkh@...uxfoundation.org,
hpa@...or.com, jan.kiszka@...mens.com,
jarkko.sakkinen@...ux.intel.com, jgross@...e.com,
jpoimboe@...hat.com, kirill.shutemov@...ux.intel.com,
mingo@...hat.com, mjg59@...gle.com, mka@...omium.org,
ndesaulniers@...gle.com, pombredanne@...b.com, rostedt@...dmis.org,
tglx@...utronix.de, thomas.lendacky@....com, tweek@...gle.com
Cc: linux-efi@...r.kernel.org, linux-kernel@...r.kernel.org,
x86@...nel.org, virtualization@...ts.linux-foundation.org
Subject: [PATCH 2/3] x86/build: use -std=gnu89 for proper extern inline semantics
The top level Makefile explicitly sets the C standard used in the kernel
to gnu89. By overriding KBUILD_CFLAGS, the C standard used for this
subdir is now implicit based on compiler and compiler version. GCC
changes this implicit default from gnu89 to gnu11 in v5.1.
This implies that depending on compiler version, parts of the kernel are
being linked together from object files that were compiled with
different C standard compiler flags.
This is problematic for symbols declared as extern inline, as the
semantics have switched since gnu89. See also:
http://blahg.josefsipek.net/?p=529
Signed-off-by: Nick Desaulniers <ndesaulniers@...gle.com>
Tested-by: Sedat Dilek <sedat.dilek@...il.com>
---
arch/x86/boot/compressed/Makefile | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/x86/boot/compressed/Makefile b/arch/x86/boot/compressed/Makefile
index fa42f895fdde..1a04c7e9add1 100644
--- a/arch/x86/boot/compressed/Makefile
+++ b/arch/x86/boot/compressed/Makefile
@@ -26,7 +26,7 @@ KCOV_INSTRUMENT := n
targets := vmlinux vmlinux.bin vmlinux.bin.gz vmlinux.bin.bz2 vmlinux.bin.lzma \
vmlinux.bin.xz vmlinux.bin.lzo vmlinux.bin.lz4
-KBUILD_CFLAGS := -m$(BITS) -O2
+KBUILD_CFLAGS := -m$(BITS) -O2 -std=gnu89
KBUILD_CFLAGS += -fno-strict-aliasing $(call cc-option, -fPIE, -fPIC)
KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
cflags-$(CONFIG_X86_32) := -march=i386
--
2.17.0.921.gf22659ad46-goog
Powered by blists - more mailing lists