]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob
dca17c7b667fcd75a0827591b055e26da1927fb1
[thirdparty/kernel/stable-queue.git] /
1 From 42e0e95474fc6076b5cd68cab8fa0340a1797a72 Mon Sep 17 00:00:00 2001
2 From: Linus Torvalds <torvalds@linux-foundation.org>
3 Date: Wed, 28 Aug 2019 10:56:48 +0200
4 Subject: x86/build: Add -Wnoaddress-of-packed-member to REALMODE_CFLAGS, to silence GCC9 build warning
5 MIME-Version: 1.0
6 Content-Type: text/plain; charset=UTF-8
7 Content-Transfer-Encoding: 8bit
8
9 From: Linus Torvalds <torvalds@linux-foundation.org>
10
11 commit 42e0e95474fc6076b5cd68cab8fa0340a1797a72 upstream.
12
13 One of the very few warnings I have in the current build comes from
14 arch/x86/boot/edd.c, where I get the following with a gcc9 build:
15
16 arch/x86/boot/edd.c: In function ‘query_edd’:
17 arch/x86/boot/edd.c:148:11: warning: taking address of packed member of ‘struct boot_params’ may result in an unaligned pointer value [-Waddress-of-packed-member]
18 148 | mbrptr = boot_params.edd_mbr_sig_buffer;
19 | ^~~~~~~~~~~
20
21 This warning triggers because we throw away all the CFLAGS and then make
22 a new set for REALMODE_CFLAGS, so the -Wno-address-of-packed-member we
23 added in the following commit is not present:
24
25 6f303d60534c ("gcc-9: silence 'address-of-packed-member' warning")
26
27 The simplest solution for now is to adjust the warning for this version
28 of CFLAGS as well, but it would definitely make sense to examine whether
29 REALMODE_CFLAGS could be derived from CFLAGS, so that it picks up changes
30 in the compiler flags environment automatically.
31
32 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
33 Acked-by: Borislav Petkov <bp@alien8.de>
34 Cc: Peter Zijlstra <peterz@infradead.org>
35 Cc: Thomas Gleixner <tglx@linutronix.de>
36 Signed-off-by: Ingo Molnar <mingo@kernel.org>
37 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
38
39 ---
40 arch/x86/Makefile | 1 +
41 1 file changed, 1 insertion(+)
42
43 --- a/arch/x86/Makefile
44 +++ b/arch/x86/Makefile
45 @@ -38,6 +38,7 @@ REALMODE_CFLAGS := $(M16_CFLAGS) -g -Os
46
47 REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -ffreestanding)
48 REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -fno-stack-protector)
49 +REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), -Wno-address-of-packed-member)
50 REALMODE_CFLAGS += $(call __cc-option, $(CC), $(REALMODE_CFLAGS), $(cc_stack_align4))
51 export REALMODE_CFLAGS
52