Skip to content

Commit 20c6c18

Browse files
Matthias KaehlckeIngo Molnar
authored andcommitted
x86/boot: Disable the address-of-packed-member compiler warning
The clang warning 'address-of-packed-member' is disabled for the general kernel code, also disable it for the x86 boot code. This suppresses a bunch of warnings like this when building with clang: ./arch/x86/include/asm/processor.h:535:30: warning: taking address of packed member 'sp0' of class or structure 'x86_hw_tss' may result in an unaligned pointer value [-Waddress-of-packed-member] return this_cpu_read_stable(cpu_tss.x86_tss.sp0); ^~~~~~~~~~~~~~~~~~~ ./arch/x86/include/asm/percpu.h:391:59: note: expanded from macro 'this_cpu_read_stable' #define this_cpu_read_stable(var) percpu_stable_op("mov", var) ^~~ ./arch/x86/include/asm/percpu.h:228:16: note: expanded from macro 'percpu_stable_op' : "p" (&(var))); ^~~ Signed-off-by: Matthias Kaehlcke <[email protected]> Cc: Doug Anderson <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Masahiro Yamada <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/[email protected] Signed-off-by: Ingo Molnar <[email protected]>
1 parent 4ecf719 commit 20c6c18

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

arch/x86/boot/compressed/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ KBUILD_CFLAGS += $(cflags-y)
3434
KBUILD_CFLAGS += -mno-mmx -mno-sse
3535
KBUILD_CFLAGS += $(call cc-option,-ffreestanding)
3636
KBUILD_CFLAGS += $(call cc-option,-fno-stack-protector)
37+
KBUILD_CFLAGS += $(call cc-disable-warning, address-of-packed-member)
3738

3839
KBUILD_AFLAGS := $(KBUILD_CFLAGS) -D__ASSEMBLY__
3940
GCOV_PROFILE := n

0 commit comments

Comments
 (0)