]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
s390/boot: Compile all files with the same march flag
authorHeiko Carstens <hca@linux.ibm.com>
Wed, 4 Sep 2024 09:39:27 +0000 (11:39 +0200)
committerHeiko Carstens <hca@linux.ibm.com>
Sat, 7 Sep 2024 15:12:42 +0000 (17:12 +0200)
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 <svens@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
arch/s390/boot/Makefile

index df01e7be1560f885f4e6da92f80ca28db027029b..1ee63054e085f11b7c5226b5931957bee857ed2b 100644 (file)
@@ -11,25 +11,16 @@ KASAN_SANITIZE := n
 KCSAN_SANITIZE := n
 KMSAN_SANITIZE := n
 
-KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
-KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
-
 #
-# Use minimum architecture for als.c to be able to print an error
+# Use minimum architecture level so it is possible to print an error
 # message if the kernel is started on a machine which is too old
 #
 CC_FLAGS_MARCH_MINIMUM := -march=z10
 
-ifneq ($(CC_FLAGS_MARCH),$(CC_FLAGS_MARCH_MINIMUM))
-AFLAGS_REMOVE_head.o           += $(CC_FLAGS_MARCH)
-AFLAGS_head.o                  += $(CC_FLAGS_MARCH_MINIMUM)
-AFLAGS_REMOVE_mem.o            += $(CC_FLAGS_MARCH)
-AFLAGS_mem.o                   += $(CC_FLAGS_MARCH_MINIMUM)
-CFLAGS_REMOVE_als.o            += $(CC_FLAGS_MARCH)
-CFLAGS_als.o                   += $(CC_FLAGS_MARCH_MINIMUM)
-CFLAGS_REMOVE_sclp_early_core.o        += $(CC_FLAGS_MARCH)
-CFLAGS_sclp_early_core.o       += $(CC_FLAGS_MARCH_MINIMUM)
-endif
+KBUILD_AFLAGS := $(filter-out $(CC_FLAGS_MARCH),$(KBUILD_AFLAGS_DECOMPRESSOR))
+KBUILD_CFLAGS := $(filter-out $(CC_FLAGS_MARCH),$(KBUILD_CFLAGS_DECOMPRESSOR))
+KBUILD_AFLAGS += $(CC_FLAGS_MARCH_MINIMUM)
+KBUILD_CFLAGS += $(CC_FLAGS_MARCH_MINIMUM)
 
 CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char