Philipp Rudo | 840798a | 2017-08-28 15:32:36 +0200 | [diff] [blame] | 1 | # SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | OBJECT_FILES_NON_STANDARD := y |
| 4 | |
| 5 | purgatory-y := head.o purgatory.o string.o sha256.o mem.o |
| 6 | |
| 7 | targets += $(purgatory-y) purgatory.ro kexec-purgatory.c |
| 8 | PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y)) |
| 9 | |
Philipp Rudo | c315e69 | 2018-06-26 18:24:52 +0200 | [diff] [blame] | 10 | $(obj)/sha256.o: $(srctree)/lib/sha256.c FORCE |
Philipp Rudo | 840798a | 2017-08-28 15:32:36 +0200 | [diff] [blame] | 11 | $(call if_changed_rule,cc_o_c) |
| 12 | |
Philipp Rudo | c315e69 | 2018-06-26 18:24:52 +0200 | [diff] [blame] | 13 | $(obj)/mem.o: $(srctree)/arch/s390/lib/mem.S FORCE |
Philipp Rudo | 840798a | 2017-08-28 15:32:36 +0200 | [diff] [blame] | 14 | $(call if_changed_rule,as_o_S) |
| 15 | |
Philipp Rudo | c315e69 | 2018-06-26 18:24:52 +0200 | [diff] [blame] | 16 | $(obj)/string.o: $(srctree)/arch/s390/lib/string.c FORCE |
Philipp Rudo | 840798a | 2017-08-28 15:32:36 +0200 | [diff] [blame] | 17 | $(call if_changed_rule,cc_o_c) |
| 18 | |
| 19 | LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib |
| 20 | LDFLAGS_purgatory.ro += -z nodefaultlib |
| 21 | KBUILD_CFLAGS := -fno-strict-aliasing -Wall -Wstrict-prototypes |
| 22 | KBUILD_CFLAGS += -Wno-pointer-sign -Wno-sign-compare |
| 23 | KBUILD_CFLAGS += -fno-zero-initialized-in-bss -fno-builtin -ffreestanding |
Philipp Rudo | 287d607 | 2018-06-27 12:03:43 +0200 | [diff] [blame] | 24 | KBUILD_CFLAGS += -c -MD -Os -m64 -msoft-float -fno-common |
Philipp Rudo | 840798a | 2017-08-28 15:32:36 +0200 | [diff] [blame] | 25 | KBUILD_CFLAGS += $(call cc-option,-fno-PIE) |
Philipp Rudo | ad03b82 | 2018-06-26 12:24:30 +0200 | [diff] [blame] | 26 | KBUILD_AFLAGS := $(filter-out -DCC_USING_EXPOLINE,$(KBUILD_AFLAGS)) |
Philipp Rudo | 840798a | 2017-08-28 15:32:36 +0200 | [diff] [blame] | 27 | |
| 28 | $(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE |
| 29 | $(call if_changed,ld) |
| 30 | |
Philipp Rudo | 840798a | 2017-08-28 15:32:36 +0200 | [diff] [blame] | 31 | quiet_cmd_bin2c = BIN2C $@ |
Masahiro Yamada | c417fbc | 2018-06-26 01:40:23 +0900 | [diff] [blame] | 32 | cmd_bin2c = $(objtree)/scripts/bin2c kexec_purgatory < $< > $@ |
Philipp Rudo | 840798a | 2017-08-28 15:32:36 +0200 | [diff] [blame] | 33 | |
| 34 | $(obj)/kexec-purgatory.c: $(obj)/purgatory.ro FORCE |
| 35 | $(call if_changed,bin2c) |
| 36 | |
| 37 | obj-$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) += kexec-purgatory.o |