s390-tools/s390-tools-sles15sp5-03-zipl-boot-use-no-warn-rwx-segments-linker-flag.patch
Nikolay Gueorguiev 121bd3e056 Accepting request 1067101 from home:ngueorguiev:branches:Base:System
- Apllied the following patches (bsc#1208527, bsc#1206173) 
  * s390-tools-sles15sp5-01-zipl-boot-discard-.eh_frame-and-.interp-input-sectio.patch
  * s390-tools-sles15sp5-02-zipl-boot-declare-that-no-executable-stack-is-requir.patch
  * s390-tools-sles15sp5-03-zipl-boot-use-no-warn-rwx-segments-linker-flag.patch
  * s390-tools-sles15sp5-04-zipl-boot-disable-build-id.patch
  * s390-tools-sles15sp5-05-zipl-boot-simplify-objcopy-commands.patch
  * s390-tools-sles15sp5-06-zipl-move-STAGE2_MAX_SIZE-and-STAGE1B_LOAD_ADDR-to-l.patch
  * s390-tools-sles15sp5-07-zipl-boot-use-linker-scripts-for-all-bootloaders.patch
  * s390-tools-sles15sp5-08-genprotimg-boot-declare-that-no-executable-stack-is-.patch
  * s390-tools-sles15sp5-09-genprotimg-boot-use-no-warn-rwx-segments-linker-flag.patch
  * s390-tools-sles15sp5-10-genprotimg-boot-disable-build-id.patch
  * s390-tools-sles15sp5-11-genprotimg-boot-Makefile-simplify-objcopy-command.patch
  * s390-tools-sles15sp5-12-genprotimg-boot-improve-linker-scripts.patch
  * s390-tools-sles15sp5-13-genprotimg-boot-stage3b-add-size-check-to-the-linker.patch
  * s390-tools-sles15sp5-14-genprotimg-boot-stage3b_reloc.bin-add-linker-script.patch
  * s390-tools-sles15sp5-15-zipl-Embed-loader-data-directly-into-boot-object.patch

OBS-URL: https://build.opensuse.org/request/show/1067101
OBS-URL: https://build.opensuse.org/package/show/Base:System/s390-tools?expand=0&rev=157
2023-02-22 08:12:19 +00:00

40 lines
1.1 KiB
Diff

---
common.mak | 14 ++++++++++++++
zipl/boot/Makefile | 2 +-
2 files changed, 15 insertions(+), 1 deletion(-)
--- a/common.mak
+++ b/common.mak
@@ -146,6 +146,20 @@ then \
fi
#
+# Test for linker option
+#
+# $1: Linker option
+#
+# Returns the linker option if available and nothing otherwise
+#
+define test_linker_flag
+$(shell printf "int main(void) {return 0;}\n" | \
+ ( $(CC) "-Wl,$1" -o /dev/null -x c - ) >/dev/null 2>&1 && printf -- '-Wl,%s' "$1")
+endef
+
+NO_WARN_RWX_SEGMENTS_LDFLAGS := $(call test_linker_flag,"--no-warn-rwx-segments")
+
+#
# Support alternate install root
#
# INSTALLDIR: Finally install s390-tools to INSTALLDIR. This can be used
--- a/zipl/boot/Makefile
+++ b/zipl/boot/Makefile
@@ -75,7 +75,7 @@ stage3.exec: head.o stage3.o kdump3.o li
2) SFLAGS="-Wl,-T,stage2.lds";; \
3) SFLAGS="-Wl,-T,stage3.lds";; \
esac; \
- $(LINK) $$SFLAGS $(NO_PIE_LDFLAGS) -m64 -static -nostdlib $(filter %.o, $^) -o $@
+ $(LINK) $$SFLAGS $(NO_PIE_LDFLAGS) $(NO_WARN_RWX_SEGMENTS_LDFLAGS) -m64 -static -nostdlib $(filter %.o, $^) -o $@
%.bin: %.exec
$(OBJCOPY) -O binary \