aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-04-15 04:35:51 -0400
committerMartin Schwidefsky <schwidefsky@de.ibm.com>2019-05-03 11:17:58 -0400
commitc263a4e990b7296b074e33aa077239a0a28a818e (patch)
tree75bdcba515026deb596bbcae1c35357f3c07adba
parent98587c2d894c34c9af5cd84ca169e1cd493aa692 (diff)
s390: only build for new CPUs with clang
llvm does does not understand -march=z9-109 and older target specifiers, so disable the respective Kconfig settings and the logic to make the boot code work on old systems when building with clang. Part of the early boot code is normally compiled with -march=z900 for maximum compatibility. This also has to get changed with clang to the oldest supported ISA, which is -march=z10 here. Signed-off-by: Arnd Bergmann <arnd@arndb.de> Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com> Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
-rw-r--r--arch/s390/Kconfig6
-rw-r--r--arch/s390/boot/Makefile18
2 files changed, 18 insertions, 6 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig
index 8c15392ee985..380d13df4411 100644
--- a/arch/s390/Kconfig
+++ b/arch/s390/Kconfig
@@ -241,6 +241,7 @@ choice
241 241
242config MARCH_Z900 242config MARCH_Z900
243 bool "IBM zSeries model z800 and z900" 243 bool "IBM zSeries model z800 and z900"
244 depends on !CC_IS_CLANG
244 select HAVE_MARCH_Z900_FEATURES 245 select HAVE_MARCH_Z900_FEATURES
245 help 246 help
246 Select this to enable optimizations for model z800/z900 (2064 and 247 Select this to enable optimizations for model z800/z900 (2064 and
@@ -249,6 +250,7 @@ config MARCH_Z900
249 250
250config MARCH_Z990 251config MARCH_Z990
251 bool "IBM zSeries model z890 and z990" 252 bool "IBM zSeries model z890 and z990"
253 depends on !CC_IS_CLANG
252 select HAVE_MARCH_Z990_FEATURES 254 select HAVE_MARCH_Z990_FEATURES
253 help 255 help
254 Select this to enable optimizations for model z890/z990 (2084 and 256 Select this to enable optimizations for model z890/z990 (2084 and
@@ -257,6 +259,7 @@ config MARCH_Z990
257 259
258config MARCH_Z9_109 260config MARCH_Z9_109
259 bool "IBM System z9" 261 bool "IBM System z9"
262 depends on !CC_IS_CLANG
260 select HAVE_MARCH_Z9_109_FEATURES 263 select HAVE_MARCH_Z9_109_FEATURES
261 help 264 help
262 Select this to enable optimizations for IBM System z9 (2094 and 265 Select this to enable optimizations for IBM System z9 (2094 and
@@ -348,12 +351,15 @@ config TUNE_DEFAULT
348 351
349config TUNE_Z900 352config TUNE_Z900
350 bool "IBM zSeries model z800 and z900" 353 bool "IBM zSeries model z800 and z900"
354 depends on !CC_IS_CLANG
351 355
352config TUNE_Z990 356config TUNE_Z990
353 bool "IBM zSeries model z890 and z990" 357 bool "IBM zSeries model z890 and z990"
358 depends on !CC_IS_CLANG
354 359
355config TUNE_Z9_109 360config TUNE_Z9_109
356 bool "IBM System z9" 361 bool "IBM System z9"
362 depends on !CC_IS_CLANG
357 363
358config TUNE_Z10 364config TUNE_Z10
359 bool "IBM System z10" 365 bool "IBM System z10"
diff --git a/arch/s390/boot/Makefile b/arch/s390/boot/Makefile
index cb40317dc3f7..c51496bbac19 100644
--- a/arch/s390/boot/Makefile
+++ b/arch/s390/boot/Makefile
@@ -12,18 +12,24 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
12KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR) 12KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
13 13
14# 14#
15# Use -march=z900 for als.c to be able to print an error 15# Use minimum architecture for als.c to be able to print an error
16# message if the kernel is started on a machine which is too old 16# message if the kernel is started on a machine which is too old
17# 17#
18ifneq ($(CC_FLAGS_MARCH),-march=z900) 18ifndef CONFIG_CC_IS_CLANG
19CC_FLAGS_MARCH_MINIMUM := -march=z900
20else
21CC_FLAGS_MARCH_MINIMUM := -march=z10
22endif
23
24ifneq ($(CC_FLAGS_MARCH),$(CC_FLAGS_MARCH_MINIMUM))
19AFLAGS_REMOVE_head.o += $(CC_FLAGS_MARCH) 25AFLAGS_REMOVE_head.o += $(CC_FLAGS_MARCH)
20AFLAGS_head.o += -march=z900 26AFLAGS_head.o += $(CC_FLAGS_MARCH_MINIMUM)
21AFLAGS_REMOVE_mem.o += $(CC_FLAGS_MARCH) 27AFLAGS_REMOVE_mem.o += $(CC_FLAGS_MARCH)
22AFLAGS_mem.o += -march=z900 28AFLAGS_mem.o += $(CC_FLAGS_MARCH_MINIMUM)
23CFLAGS_REMOVE_als.o += $(CC_FLAGS_MARCH) 29CFLAGS_REMOVE_als.o += $(CC_FLAGS_MARCH)
24CFLAGS_als.o += -march=z900 30CFLAGS_als.o += $(CC_FLAGS_MARCH_MINIMUM)
25CFLAGS_REMOVE_sclp_early_core.o += $(CC_FLAGS_MARCH) 31CFLAGS_REMOVE_sclp_early_core.o += $(CC_FLAGS_MARCH)
26CFLAGS_sclp_early_core.o += -march=z900 32CFLAGS_sclp_early_core.o += $(CC_FLAGS_MARCH_MINIMUM)
27endif 33endif
28 34
29CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char 35CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char