Skip to content

Commit fccb175

Browse files
committed
s390/boot: Compile all files with the same march flag
Only a couple of files of the decompressor are compiled with the minimum architecture level. This is problematic for potential function calls between compile units, especially if a target function is within a compile until compiled for a higher architecture level, since that may lead to an unexpected operation exception. Therefore compile all files of the decompressor for the same (minimum) architecture level. Reviewed-by: Sven Schnelle <[email protected]> Signed-off-by: Heiko Carstens <[email protected]>
1 parent ebcc369 commit fccb175

File tree

1 file changed

+5
-14
lines changed

1 file changed

+5
-14
lines changed

arch/s390/boot/Makefile

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -11,25 +11,16 @@ KASAN_SANITIZE := n
1111
KCSAN_SANITIZE := n
1212
KMSAN_SANITIZE := n
1313

14-
KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
15-
KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
16-
1714
#
18-
# Use minimum architecture for als.c to be able to print an error
15+
# Use minimum architecture level so it is possible to print an error
1916
# message if the kernel is started on a machine which is too old
2017
#
2118
CC_FLAGS_MARCH_MINIMUM := -march=z10
2219

23-
ifneq ($(CC_FLAGS_MARCH),$(CC_FLAGS_MARCH_MINIMUM))
24-
AFLAGS_REMOVE_head.o += $(CC_FLAGS_MARCH)
25-
AFLAGS_head.o += $(CC_FLAGS_MARCH_MINIMUM)
26-
AFLAGS_REMOVE_mem.o += $(CC_FLAGS_MARCH)
27-
AFLAGS_mem.o += $(CC_FLAGS_MARCH_MINIMUM)
28-
CFLAGS_REMOVE_als.o += $(CC_FLAGS_MARCH)
29-
CFLAGS_als.o += $(CC_FLAGS_MARCH_MINIMUM)
30-
CFLAGS_REMOVE_sclp_early_core.o += $(CC_FLAGS_MARCH)
31-
CFLAGS_sclp_early_core.o += $(CC_FLAGS_MARCH_MINIMUM)
32-
endif
20+
KBUILD_AFLAGS := $(filter-out $(CC_FLAGS_MARCH),$(KBUILD_AFLAGS_DECOMPRESSOR))
21+
KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_MARCH),$(KBUILD_CFLAGS_DECOMPRESSOR))
22+
KBUILD_AFLAGS += $(CC_FLAGS_MARCH_MINIMUM)
23+
KBUILD_CFLAGS += $(CC_FLAGS_MARCH_MINIMUM)
3324

3425
CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char
3526

0 commit comments

Comments
 (0)