Skip to contentSkip to conversation

parisc: use -fno-strict-aliasing for decompressor

PATCH In review Arnd Bergmann 2 participants 3 messages May 8, 2020 PA-RISC architecture

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 parisc: use -fno-strict-aliasing for decompressor

An experimental patch series of mine reworks how warnings are processed in Kbuild. A side effect is a new warning about a harmless aliasing rule violation in an inline function:

In file included from
include/linux/rhashtable-types.h:15:0,
from include/linux/ipc.h:7,
from include/uapi/linux/sem.h:5,
from include/linux/sem.h:5,
from include/linux/sched.h:15,
from include/linux/uaccess.h:6,
from arch/parisc/boot/compressed/misc.c:7:
include/linux/workqueue.h: In function 'work_static':
include/linux/workqueue.h:212:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
return *work_data_bits(work) & WORK_STRUCT_STATIC;

Make the decompressor use -fno-strict-aliasing like the rest of the kernel for consistency, and to ensure this warning never makes it into a release.

---
 arch/parisc/boot/compressed/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/parisc/boot/compressed/Makefile +1 -0
index 1e5879c6a752..dff453687530 100644
@@ -16,6 +16,7 @@ targets += real2.S firmware.c
 
 KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER
 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
+KBUILD_CFLAGS += -fno-strict-aliasing
 KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -fno-builtin-printf
 KBUILD_CFLAGS += -fno-PIE -mno-space-regs -mdisable-fpregs -Os
 ifndef CONFIG_64BIT
Signature · 1 line
2.26.0
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 17 lines · Arnd Bergmann

An experimental patch series of mine reworks how warnings are processed in Kbuild. A side effect is a new warning about a harmless aliasing rule violation in an inline function:

In file included from
include/linux/rhashtable-types.h:15:0,
from include/linux/ipc.h:7,
from include/uapi/linux/sem.h:5,
from include/linux/sem.h:5,
from include/linux/sched.h:15,
from include/linux/uaccess.h:6,
from arch/parisc/boot/compressed/misc.c:7:
include/linux/workqueue.h: In function 'work_static':
include/linux/workqueue.h:212:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
return *work_data_bits(work) & WORK_STRUCT_STATIC;

Quoted 6 lines

Make the decompressor use -fno-strict-aliasing like the rest of the kernel for consistency, and to ensure this warning never makes it into a release.

Arnd, will you take it through your trees when you push your experimental patches, or do you want me to take it through the parisc tree?

Helge

Quoted 17 lines
---
 arch/parisc/boot/compressed/Makefile | 1 +
 1 file changed, 1 insertion(+)
arch/parisc/boot/compressed/Makefile +1 -0
index 1e5879c6a752..dff453687530 100644
@@ -16,6 +16,7 @@ targets += real2.S firmware.c
 
 KBUILD_CFLAGS := -D__KERNEL__ -O2 -DBOOTLOADER
 KBUILD_CFLAGS += -DDISABLE_BRANCH_PROFILING
+KBUILD_CFLAGS += -fno-strict-aliasing
 KBUILD_CFLAGS += $(cflags-y) -fno-delete-null-pointer-checks -fno-builtin-printf
 KBUILD_CFLAGS += -fno-PIE -mno-space-regs -mdisable-fpregs -Os
 ifndef CONFIG_64BIT
#2 lore raw
Quoted 22 lines · Helge Deller
Quoted 21 lines · Arnd Bergmann

An experimental patch series of mine reworks how warnings are processed in Kbuild. A side effect is a new warning about a harmless aliasing rule violation in an inline function:

In file included from
include/linux/rhashtable-types.h:15:0,
from include/linux/ipc.h:7,
from include/uapi/linux/sem.h:5,
from include/linux/sem.h:5,
from include/linux/sched.h:15,
from include/linux/uaccess.h:6,
from arch/parisc/boot/compressed/misc.c:7:
include/linux/workqueue.h: In function 'work_static':
include/linux/workqueue.h:212:2: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
return *work_data_bits(work) & WORK_STRUCT_STATIC;

Make the decompressor use -fno-strict-aliasing like the rest of the kernel for consistency, and to ensure this warning never makes it into a release.

Quoted 7 lines
Quoted 2 lines

Arnd, will you take it through your trees when you push your experimental patches, or do you want me to take it through the parisc tree?

Please take it through your tree. It will take me a while to finish my series, and having one less change will make it easier to review.

Arnd