summaryrefslogtreecommitdiff
path: root/arch/s390/purgatory/Makefile
diff options
context:
space:
mode:
authorBjorn Andersson <bjorn.andersson@linaro.org>2018-05-09 22:00:19 +0300
committerBjorn Andersson <bjorn.andersson@linaro.org>2018-05-09 22:00:19 +0300
commitcc1c8445eba5b78f5b719c47572473d7a7caa038 (patch)
tree3954bcaa641ee362bf06b7aa9197d30a90eb4ca3 /arch/s390/purgatory/Makefile
parentab460a2e72dabecfdabd45eb7e3ee2d73fc876d4 (diff)
parent75bc37fefc4471e718ba8e651aa74673d4e0a9eb (diff)
downloadlinux-cc1c8445eba5b78f5b719c47572473d7a7caa038.tar.xz
Merge tag 'v4.17-rc4' into rpmsg-next
Pick up fixes from rproc-v4.17-1 Signed-off-by: Bjorn Andersson <bjorn.andersson@linaro.org>
Diffstat (limited to 'arch/s390/purgatory/Makefile')
-rw-r--r--arch/s390/purgatory/Makefile37
1 files changed, 37 insertions, 0 deletions
diff --git a/arch/s390/purgatory/Makefile b/arch/s390/purgatory/Makefile
new file mode 100644
index 000000000000..e9525bc1b4a6
--- /dev/null
+++ b/arch/s390/purgatory/Makefile
@@ -0,0 +1,37 @@
+# SPDX-License-Identifier: GPL-2.0
+
+OBJECT_FILES_NON_STANDARD := y
+
+purgatory-y := head.o purgatory.o string.o sha256.o mem.o
+
+targets += $(purgatory-y) purgatory.ro kexec-purgatory.c
+PURGATORY_OBJS = $(addprefix $(obj)/,$(purgatory-y))
+
+$(obj)/sha256.o: $(srctree)/lib/sha256.c
+ $(call if_changed_rule,cc_o_c)
+
+$(obj)/mem.o: $(srctree)/arch/s390/lib/mem.S
+ $(call if_changed_rule,as_o_S)
+
+$(obj)/string.o: $(srctree)/arch/s390/lib/string.c
+ $(call if_changed_rule,cc_o_c)
+
+LDFLAGS_purgatory.ro := -e purgatory_start -r --no-undefined -nostdlib
+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
+KBUILD_CFLAGS += $(call cc-option,-fno-PIE)
+
+$(obj)/purgatory.ro: $(PURGATORY_OBJS) FORCE
+ $(call if_changed,ld)
+
+CMD_BIN2C = $(objtree)/scripts/basic/bin2c
+quiet_cmd_bin2c = BIN2C $@
+ cmd_bin2c = $(CMD_BIN2C) kexec_purgatory < $< > $@
+
+$(obj)/kexec-purgatory.c: $(obj)/purgatory.ro FORCE
+ $(call if_changed,bin2c)
+
+obj-$(CONFIG_ARCH_HAS_KEXEC_PURGATORY) += kexec-purgatory.o