Skip to contentSkip to conversation

make compiling X86 syscall tables safe for W=1

PATCH New Valdis Kletnieks 2 participants 2 messages Aug 1, 2016 – Aug 10, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 make compiling X86 syscall tables safe for W=1

Building an X86_64 kernel with W=1 throws a total of 9,948 lines of warnings of this form for both 32bit and 64bit syscall tables. Given that the entire rest of the build for my config only generates 8,375 lines of output, this is a big reduction in the warnings generated.

./arch/x86/include/generated/asm/syscalls_32.h:885:21: warning: initialized field overwritten [-Woverride-init]
__SYSCALL_I386(379, compat_sys_pwritev2, )

                     ^
arch/x86/entry/syscall_32.c:13:46: note: in definition of macro '__SYSCALL_I386'
 #define __SYSCALL_I386(nr, sym, qual) [nr] = sym,
                                              ^~~
./arch/x86/include/generated/asm/syscalls_32.h:885:21: note: (near initialization for 'ia32_sys_call_table[379]')
 __SYSCALL_I386(379, compat_sys_pwritev2, )
                     ^

arch/x86/entry/syscall_32.c:13:46: note: in definition of macro '__SYSCALL_I386'
#define __SYSCALL_I386(nr, sym, qual) [nr] = sym,

Since we intentionally build the syscall tables this way, ignore that one warning in the two files.

---

arch/x86/entry/Makefile +2 -0
index fe91c25092da..77f28ce9c646 100644
@@ -5,6 +5,8 @@
 OBJECT_FILES_NON_STANDARD_entry_$(BITS).o   := y
 OBJECT_FILES_NON_STANDARD_entry_64_compat.o := y
 
+CFLAGS_syscall_64.o		+= -Wno-override-init
+CFLAGS_syscall_32.o		+= -Wno-override-init
 obj-y				:= entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
 obj-y				+= common.o
 
#1 lore raw

[tip:x86/urgent] x86/build: Reduce the W=1 warnings noise when compiling x86 syscall tables

x86/build: Reduce the W=1 warnings noise when compiling x86 syscall tables
Commit-ID:  5e44258d168b2bdee51d9e2e1f1f4726ff9775cd
Gitweb:     http://git.kernel.org/tip/5e44258d168b2bdee51d9e2e1f1f4726ff9775cd
Author:     Valdis Kletnieks <[email protected]>
AuthorDate: Sun, 31 Jul 2016 23:24:50 -0400
Committer:  Ingo Molnar <[email protected]>
CommitDate: Wed, 10 Aug 2016 16:05:16 +0200

x86/build: Reduce the W=1 warnings noise when compiling x86 syscall tables

Building an X86_64 kernel with W=1 throws a total of 9,948 lines of warnings of this form for both 32-bit and 64-bit syscall tables. Given that the entire rest of the build for my config only generates 8,375 lines of output, this is a big reduction in the warnings generated.

The warnings follow this pattern:

./arch/x86/include/generated/asm/syscalls_32.h:885:21: warning: initialized field overwritten [-Woverride-init]
__SYSCALL_I386(379, compat_sys_pwritev2, )

                     ^
  arch/x86/entry/syscall_32.c:13:46: note: in definition of macro '__SYSCALL_I386'
   #define __SYSCALL_I386(nr, sym, qual) [nr] = sym,
                                              ^~~
  ./arch/x86/include/generated/asm/syscalls_32.h:885:21: note: (near initialization for 'ia32_sys_call_table[379]')
   __SYSCALL_I386(379, compat_sys_pwritev2, )
                     ^

arch/x86/entry/syscall_32.c:13:46: note: in definition of macro '__SYSCALL_I386'
#define __SYSCALL_I386(nr, sym, qual) [nr] = sym,

Since we intentionally build the syscall tables this way, ignore that one warning in the two files.

Cc Andy Lutomirski <[email protected]>
Cc Borislav Petkov <[email protected]>
Cc Brian Gerst <[email protected]>
Cc Denys Vlasenko <[email protected]>
Cc H. Peter Anvin <[email protected]>
Cc Josh Poimboeuf <[email protected]>
Cc Linus Torvalds <[email protected]>
Cc Peter Zijlstra <[email protected]>
Cc Thomas Gleixner <[email protected]>
---
 arch/x86/entry/Makefile | 2 ++
 1 file changed, 2 insertions(+)
arch/x86/entry/Makefile +2 -0
index fe91c25..77f28ce 100644
@@ -5,6 +5,8 @@
 OBJECT_FILES_NON_STANDARD_entry_$(BITS).o   := y
 OBJECT_FILES_NON_STANDARD_entry_64_compat.o := y
 
+CFLAGS_syscall_64.o		+= -Wno-override-init
+CFLAGS_syscall_32.o		+= -Wno-override-init
 obj-y				:= entry_$(BITS).o thunk_$(BITS).o syscall_$(BITS).o
 obj-y				+= common.o