Skip to contentSkip to conversation

arm64: Silence gcc warnings about arch ABI drift

PATCH In review Dave Martin 3 participants 5 messages Jun 3, 2019 – Jun 4, 2019 arm64

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 arm64: Silence gcc warnings about arch ABI drift

From: Linus Torvalds <[email protected]>

Since GCC 9, the compiler warns about evolution of the platform-specific ABI, in particular relating for the marshaling of certain structures involving bitfields.

The kernel is a standalone binary, and of course nobody would be so stupid as to expose structs containing bitfields as function arguments in ABI. (Passing a pointer to such a struct, however inadvisable, should be unaffected by this change. perf and various drivers rely on that.)

So these warnings do more harm than good: turn them off.

We may miss warnings about future ABI drift, but that's too bad. Future ABI breaks of this class will have to be debugged and fixed the traditional way unless the compiler evolves finer-grained diagnostics.

---
 arch/arm64/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/Makefile +1 -0
index b025304..8fbd583 100644
@@ -51,6 +51,7 @@ endif
 
 KBUILD_CFLAGS	+= -mgeneral-regs-only $(lseinstr) $(brokengasinst)
 KBUILD_CFLAGS	+= -fno-asynchronous-unwind-tables
+KBUILD_CFLAGS	+= -Wno-psabi
 KBUILD_AFLAGS	+= $(lseinstr) $(brokengasinst)
 
 KBUILD_CFLAGS	+= $(call cc-option,-mabi=lp64)
Signature · 7 lines
2.1.4


_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel
#2 lore raw
Quoted 5 lines · Linus Torvalds
Quoted 2 lines · Dave Martin

From: Linus Torvalds <[email protected]>

That's the wrong author. I have no idea about the -Wno-psabi flag.

Errr. I have no idea what happened there.

My best guess is a typo'd git commit command, but it still leaves me scratching my head.

Mind if I steal the patch from you and pretend it's mine?

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

#4 lore raw
Quoted 3 lines · Christoph Hellwig

I'd be curious where we expose structs containing bitfields as pass by value arguments in the kernel. That generally doesn't seem like a great idea.

This was firing on struct printf_spec for example, which is local to lib/vsnprintf.c.

I haven't dug into the background of why that struct is encoded this way, or whether pass-by-value semantics are really important for it. Maybe it could be changed.

Bitfields in ABI would be the worse problem, but this particular warning is only related to pass-by-value cases. I haven't exhaustively gone through everything, but I've not seen a case of bitfields passed by value in the ABI.

Cheers
---Dave

_______________________________________________
linux-arm-kernel mailing list
[email protected]
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel