2017-08-28 20:32:36 +07:00
|
|
|
# SPDX-License-Identifier: GPL-2.0
|
|
|
|
|
|
|
|
OBJECT_FILES_NON_STANDARD := y
|
|
|
|
|
|
|
|
purgatory-y := head.o purgatory.o string.o sha256.o mem.o
|
|
|
|
|
2019-03-06 00:08:36 +07:00
|
|
|
targets += $(purgatory-y) purgatory.lds purgatory purgatory.ro
|
2017-08-28 20:32:36 +07:00
|
|
|
PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y))
|
|
|
|
|
2018-06-26 23:24:52 +07:00
|
|
|
$(obj)/sha256.o: $(srctree)/lib/sha256.c FORCE
|
2017-08-28 20:32:36 +07:00
|
|
|
$(call if_changed_rule,cc_o_c)
|
|
|
|
|
2018-06-26 23:24:52 +07:00
|
|
|
$(obj)/mem.o: $(srctree)/arch/s390/lib/mem.S FORCE
|
2017-08-28 20:32:36 +07:00
|
|
|
$(call if_changed_rule,as_o_S)
|
|
|
|
|
2018-06-26 23:24:52 +07:00
|
|
|
$(obj)/string.o: $(srctree)/arch/s390/lib/string.c FORCE
|
2017-08-28 20:32:36 +07:00
|
|
|
$(call if_changed_rule,cc_o_c)
|
|
|
|
|
|
|
|
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
|
2018-06-27 17:03:43 +07:00
|
|
|
KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common
|
2017-08-28 20:32:36 +07:00
|
|
|
KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
|
2018-06-26 17:24:30 +07:00
|
|
|
KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS))
|
2017-08-28 20:32:36 +07:00
|
|
|
|
2019-03-05 23:18:13 +07:00
|
|
|
LDFLAGS_purgatory := -r --no-undefined -nostdlib -z nodefaultlib -T
|
|
|
|
$(obj)/purgatory: $(obj)/purgatory.lds $(PURGATORY_OBJS) FORCE
|
2017-08-28 20:32:36 +07:00
|
|
|
$(call if_changed,ld)
|
|
|
|
|
2019-03-05 23:18:13 +07:00
|
|
|
OBJCOPYFLAGS_purgatory.ro := -O elf64-s390
|
|
|
|
OBJCOPYFLAGS_purgatory.ro += --remove-section='*debug*'
|
|
|
|
OBJCOPYFLAGS_purgatory.ro += --remove-section='.comment'
|
|
|
|
OBJCOPYFLAGS_purgatory.ro += --remove-section='.note.*'
|
|
|
|
$(obj)/purgatory.ro: $(obj)/purgatory FORCE
|
|
|
|
$(call if_changed,objcopy)
|
|
|
|
|
2019-03-06 00:08:36 +07:00
|
|
|
$(obj)/kexec-purgatory.o: $(obj)/kexec-purgatory.S $(obj)/purgatory.ro FORCE
|
|
|
|
$(call if_changed_rule,as_o_S)
|
2017-08-28 20:32:36 +07:00
|
|
|
|
|
|
|
obj-$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) += kexec-purgatory.o
|