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>
This commit is contained in:
Arnd Bergmann 2019-04-15 10:35:51 +02:00 коммит произвёл Martin Schwidefsky
Родитель 98587c2d89
Коммит c263a4e990
2 изменённых файлов: 18 добавлений и 6 удалений

Просмотреть файл

@ -241,6 +241,7 @@ choice
config MARCH_Z900 config MARCH_Z900
bool "IBM zSeries model z800 and z900" bool "IBM zSeries model z800 and z900"
depends on !CC_IS_CLANG
select HAVE_MARCH_Z900_FEATURES select HAVE_MARCH_Z900_FEATURES
help help
Select this to enable optimizations for model z800/z900 (2064 and Select this to enable optimizations for model z800/z900 (2064 and
@ -249,6 +250,7 @@ config MARCH_Z900
config MARCH_Z990 config MARCH_Z990
bool "IBM zSeries model z890 and z990" bool "IBM zSeries model z890 and z990"
depends on !CC_IS_CLANG
select HAVE_MARCH_Z990_FEATURES select HAVE_MARCH_Z990_FEATURES
help help
Select this to enable optimizations for model z890/z990 (2084 and Select this to enable optimizations for model z890/z990 (2084 and
@ -257,6 +259,7 @@ config MARCH_Z990
config MARCH_Z9_109 config MARCH_Z9_109
bool "IBM System z9" bool "IBM System z9"
depends on !CC_IS_CLANG
select HAVE_MARCH_Z9_109_FEATURES select HAVE_MARCH_Z9_109_FEATURES
help help
Select this to enable optimizations for IBM System z9 (2094 and Select this to enable optimizations for IBM System z9 (2094 and
@ -348,12 +351,15 @@ config TUNE_DEFAULT
config TUNE_Z900 config TUNE_Z900
bool "IBM zSeries model z800 and z900" bool "IBM zSeries model z800 and z900"
depends on !CC_IS_CLANG
config TUNE_Z990 config TUNE_Z990
bool "IBM zSeries model z890 and z990" bool "IBM zSeries model z890 and z990"
depends on !CC_IS_CLANG
config TUNE_Z9_109 config TUNE_Z9_109
bool "IBM System z9" bool "IBM System z9"
depends on !CC_IS_CLANG
config TUNE_Z10 config TUNE_Z10
bool "IBM System z10" bool "IBM System z10"

Просмотреть файл

@ -12,18 +12,24 @@ KBUILD_AFLAGS := $(KBUILD_AFLAGS_DECOMPRESSOR)
KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR) KBUILD_CFLAGS := $(KBUILD_CFLAGS_DECOMPRESSOR)
# #
# Use -march=z900 for als.c to be able to print an error # Use minimum architecture for als.c to be able to print an error
# message if the kernel is started on a machine which is too old # message if the kernel is started on a machine which is too old
# #
ifneq ($(CC_FLAGS_MARCH),-march=z900) ifndef CONFIG_CC_IS_CLANG
CC_FLAGS_MARCH_MINIMUM := -march=z900
else
CC_FLAGS_MARCH_MINIMUM := -march=z10
endif
ifneq ($(CC_FLAGS_MARCH),$(CC_FLAGS_MARCH_MINIMUM))
AFLAGS_REMOVE_head.o += $(CC_FLAGS_MARCH) AFLAGS_REMOVE_head.o += $(CC_FLAGS_MARCH)
AFLAGS_head.o += -march=z900 AFLAGS_head.o += $(CC_FLAGS_MARCH_MINIMUM)
AFLAGS_REMOVE_mem.o += $(CC_FLAGS_MARCH) AFLAGS_REMOVE_mem.o += $(CC_FLAGS_MARCH)
AFLAGS_mem.o += -march=z900 AFLAGS_mem.o += $(CC_FLAGS_MARCH_MINIMUM)
CFLAGS_REMOVE_als.o += $(CC_FLAGS_MARCH) CFLAGS_REMOVE_als.o += $(CC_FLAGS_MARCH)
CFLAGS_als.o += -march=z900 CFLAGS_als.o += $(CC_FLAGS_MARCH_MINIMUM)
CFLAGS_REMOVE_sclp_early_core.o += $(CC_FLAGS_MARCH) CFLAGS_REMOVE_sclp_early_core.o += $(CC_FLAGS_MARCH)
CFLAGS_sclp_early_core.o += -march=z900 CFLAGS_sclp_early_core.o += $(CC_FLAGS_MARCH_MINIMUM)
endif endif
CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char CFLAGS_sclp_early_core.o += -I$(srctree)/drivers/s390/char