Commit 27556568 authored by Nathan Chancellor's avatar Nathan Chancellor Committed by Greg Kroah-Hartman

efi/libstub: Disable some warnings for x86{,_64}

[ Upstream commit 3db5e0ba ]

When building the kernel with Clang, some disabled warnings appear
because this Makefile overrides KBUILD_CFLAGS for x86{,_64}. Add them to
this list so that the build is clean again.

-Wpointer-sign was disabled for the whole kernel before the beginning of Git history.

-Waddress-of-packed-member was disabled for the whole kernel and for
the early boot code in these commits:

  bfb38988 ("kbuild: clang: Disable 'address-of-packed-member' warning")
  20c6c189 ("x86/boot: Disable the address-of-packed-member compiler warning").

-Wgnu was disabled for the whole kernel and for the early boot code in
these commits:

  61163efa ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang")
  6c3b56b1 ("x86/boot: Disable Clang warnings about GNU extensions").

 [ mingo: Made the changelog more readable. ]
Tested-by: default avatarSedat Dilek <>
Signed-off-by: Nathan Chancellor's avatarNathan Chancellor <>
Signed-off-by: default avatarArd Biesheuvel <>
Reviewed-by: default avatarSedat Dilek <>
Cc: Andy Lutomirski <>
Cc: Arend van Spriel <>
Cc: Bhupesh Sharma <>
Cc: Borislav Petkov <>
Cc: Dave Hansen <>
Cc: Eric Snowberg <>
Cc: Hans de Goede <>
Cc: Joe Perches <>
Cc: Jon Hunter <>
Cc: Julien Thierry <>
Cc: Linus Torvalds <>
Cc: Marc Zyngier <>
Cc: Matt Fleming <>
Cc: Peter Zijlstra <>
Cc: Sai Praneeth Prakhya <>
Cc: Thomas Gleixner <>
Cc: YiFei Zhu <>
Link: default avatarIngo Molnar <>
Signed-off-by: default avatarSasha Levin <>
parent 1da48f58
......@@ -9,7 +9,10 @@ cflags-$(CONFIG_X86_32) := -march=i386
cflags-$(CONFIG_X86_64) := -mcmodel=small
cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \
-fPIC -fno-strict-aliasing -mno-red-zone \
-mno-mmx -mno-sse -fshort-wchar
-mno-mmx -mno-sse -fshort-wchar \
-Wno-pointer-sign \
$(call cc-disable-warning, address-of-packed-member) \
$(call cc-disable-warning, gnu)
# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly
# disable the stackleak plugin
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment