Skip to content

Commit 3db5e0b

Browse files
nathanchanceIngo Molnar
authored andcommitted
efi/libstub: Disable some warnings for x86{,_64}
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: bfb3898 ("kbuild: clang: Disable 'address-of-packed-member' warning") 20c6c18 ("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: 61163ef ("kbuild: LLVMLinux: Add Kbuild support for building kernel with Clang") 6c3b56b ("x86/boot: Disable Clang warnings about GNU extensions"). [ mingo: Made the changelog more readable. ] Tested-by: Sedat Dilek <sedat.dilek@gmail.com> Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Reviewed-by: Sedat Dilek <sedat.dilek@gmail.com> Cc: Andy Lutomirski <luto@kernel.org> Cc: Arend van Spriel <arend.vanspriel@broadcom.com> Cc: Bhupesh Sharma <bhsharma@redhat.com> Cc: Borislav Petkov <bp@alien8.de> Cc: Dave Hansen <dave.hansen@intel.com> Cc: Eric Snowberg <eric.snowberg@oracle.com> Cc: Hans de Goede <hdegoede@redhat.com> Cc: Joe Perches <joe@perches.com> Cc: Jon Hunter <jonathanh@nvidia.com> Cc: Julien Thierry <julien.thierry@arm.com> Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Marc Zyngier <marc.zyngier@arm.com> Cc: Matt Fleming <matt@codeblueprint.co.uk> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Sai Praneeth Prakhya <sai.praneeth.prakhya@intel.com> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: YiFei Zhu <zhuyifei1999@gmail.com> Cc: linux-efi@vger.kernel.org Link: http://lkml.kernel.org/r/20181129171230.18699-8-ard.biesheuvel@linaro.org Link: ClangBuiltLinux#112 Signed-off-by: Ingo Molnar <mingo@kernel.org>
1 parent 47c33a0 commit 3db5e0b

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

drivers/firmware/efi/libstub/Makefile

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,10 @@ cflags-$(CONFIG_X86_32) := -march=i386
99
cflags-$(CONFIG_X86_64) := -mcmodel=small
1010
cflags-$(CONFIG_X86) += -m$(BITS) -D__KERNEL__ -O2 \
1111
-fPIC -fno-strict-aliasing -mno-red-zone \
12-
-mno-mmx -mno-sse -fshort-wchar
12+
-mno-mmx -mno-sse -fshort-wchar \
13+
-Wno-pointer-sign \
14+
$(call cc-disable-warning, address-of-packed-member) \
15+
$(call cc-disable-warning, gnu)
1316

1417
# arm64 uses the full KBUILD_CFLAGS so it's necessary to explicitly
1518
# disable the stackleak plugin

0 commit comments

Comments
 (0)