From 287d6070acbb2529e24462faffca46663885dddc Mon Sep 17 00:00:00 2001 From: Philipp Rudo Date: Wed, 27 Jun 2018 12:03:43 +0200 Subject: s390/purgatory: Remove duplicate variable definitions Currently there are some variables in the purgatory (e.g. kernel_entry) which are defined twice, once in assembler- and once in c-code. The reason for this is that these variables are set during purgatory load, where sanity checks on the corresponding Elf_Sym's are made, while they are used in assembler-code. Thus adding a second definition in c-code is a handy workaround to guarantee correct Elf_Sym's are created. When the purgatory is compiled with -fcommon (default for gcc on s390) this is no problem because both symbols are merged by the linker. However this is not required by ISO C and when the purgatory is built with -fno-common the linker fails with errors like arch/s390/purgatory/purgatory.o:(.bss+0x18): multiple definition of `kernel_entry' arch/s390/purgatory/head.o:/.../arch/s390/purgatory/head.S:230: first defined here Thus remove the duplicate definitions and add the required size and type information to the assembler definition. Also add -fno-common to the command line options to prevent similar hacks in the future. Signed-off-by: Philipp Rudo Acked-by: Heiko Carstens Signed-off-by: Martin Schwidefsky --- arch/s390/purgatory/Makefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'arch/s390/purgatory/Makefile') diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile index abfa8c7a6d9a..8d61218a71aa 100644 --- a/arch/s390/purgatory/Makefile +++ b/arch/s390/purgatory/Makefile @@ -21,7 +21,7 @@ LDFLAGS_purgatory.ro += -z nodefaultlib KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding -KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float +KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common KBUILD_CFLAGS += $(call cc-option,-fno-PIE) KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS)) -- cgit v1.2.3