zipl: Use the compiler for linking instead of ld

Instead of directly calling ld, it is recommended to call the compiler
to do the linking. Do that and adapt the linker flags accordingly.

This also fixes build issues with newer binutils as -no-pie has never
been a valid option for ld itself.

See:
https://sourceware.org/bugzilla/show_bug.cgi?id=27050
https://bugs.launchpad.net/ubuntu/+source/s390-tools/+bug/1907789

LD has no user anymore and is removed.

Closes: https://github.com/ibm-s390-tools/s390-tools/pull/106
Reported-by: Lukas Märdian <lukas.maerdian@canonical.com>
Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com>
Reviewed-by: Stefan Haberland <sth@linux.ibm.com>
Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
Jan Höppner
2022-02-28 11:24:19 +01:00
parent 1bd64f5b0f
commit 5e46632767
2 changed files with 1 additions and 2 deletions

View File

@@ -60,7 +60,6 @@ endef
$(eval $(call cmd_define, AS," AS ",$(CROSS_COMPILE)as))
$(eval $(call cmd_define, LINK," LINK ",$(CROSS_COMPILE)gcc))
$(eval $(call cmd_define, LD," LD ",$(CROSS_COMPILE)ld))
$(eval $(call cmd_define, CC," CC ",$(CROSS_COMPILE)gcc))
$(eval $(call cmd_define, HOSTCC," HOSTCC ",gcc))
$(eval $(call cmd_define, LINKXX," LINKXX ",$(CROSS_COMPILE)g++))

View File

@@ -110,7 +110,7 @@ stage3.bin: stage3.exec
$< $@
data.o: $(FILES)
$(LD) $(NO_PIE_LDFLAGS) -r -b binary -o data.o $(FILES)
$(LINK) $(NO_PIE_LDFLAGS) -static -nostdlib -Wl,--relocatable -Wl,--format,binary -o data.o $(FILES)
data.h: data.o
rm -f data.h