mirror of
https://github.com/ibm-s390-linux/s390-tools.git
synced 2026-08-05 02:14:52 +00:00
common.mak: Remove NO_PIE_LDFLAGS
Commitc5a91199e3("zipl: Always build and link without PIE.") introduced -fno-pie (for compilation) and -no-pie (for linking) for zipl. At the time the linker was still used directly before commit5e46632767("zipl: Use the compiler for linking instead of ld") eventually switched to calling the compiler for the linking step. During that adaption -static was introduced to the linker flags. -no-pie was carried over as well. However -static implies -no-pie and it is therefore not required. For GCC see also man 1 gcc (-static) [1]. Whilst not explicitly documented, Clang shows the same behaviour. Clang also complains when -static and -no-pie are specified in the linker step at the same time with the following warning: clang: warning: argument unused during compilation: '-no-pie' [-Wunused-command-line-argument] Since -no-pie is not required, remove it and get rid of the warning. [1] https://gcc.gnu.org/onlinedocs/gcc/Link-Options.html#index-static Reviewed-by: Marc Hartmayer <mhartmay@linux.ibm.com> Signed-off-by: Jan Höppner <hoeppner@linux.ibm.com>
This commit is contained in:
@@ -341,7 +341,6 @@ export INSTALL CFLAGS CXXFLAGS \
|
||||
LDFLAGS CPPFLAGS ALL_CFLAGS ALL_CXXFLAGS ALL_LDFLAGS ALL_CPPFLAGS
|
||||
|
||||
NO_PIE_CFLAGS := -fno-pie
|
||||
NO_PIE_LDFLAGS := -no-pie
|
||||
|
||||
# Overwrite implicit makefile rules for having nice compile output
|
||||
%.o: %.c
|
||||
|
||||
@@ -74,7 +74,7 @@ stage3b.elf: head.o $(ZIPL_OBJS)
|
||||
|
||||
.SECONDARY: $(FILES:.bin=.lds)
|
||||
%.elf: %.lds %.o
|
||||
$(LINK) $(NO_PIE_LDFLAGS) $(NO_WARN_RWX_SEGMENTS_LDFLAGS) -Wl,-T,$< -Wl,--build-id=none -m64 -static -nostdlib $(filter %.o, $^) -o $@
|
||||
$(LINK) $(NO_WARN_RWX_SEGMENTS_LDFLAGS) -Wl,-T,$< -Wl,--build-id=none -m64 -static -nostdlib $(filter %.o, $^) -o $@
|
||||
@chmod a-x $@
|
||||
|
||||
%.bin.debug: %.elf
|
||||
|
||||
@@ -93,7 +93,7 @@ stage3.exec: head.o stage3.o kdump3.o libc.o ebcdic.o ebcdic_conv.o sclp.o \
|
||||
sclp_stage3.o kdump.o entry.o stage3.lds
|
||||
|
||||
%.exec: %.o
|
||||
$(LINK) -Wl,-T,$(filter %.lds,$^) $(NO_PIE_LDFLAGS) $(NO_WARN_RWX_SEGMENTS_LDFLAGS) -Wl,--build-id=none -m64 -static -nostdlib $(filter %.o, $^) -o $@
|
||||
$(LINK) -Wl,-T,$(filter %.lds,$^) $(NO_WARN_RWX_SEGMENTS_LDFLAGS) -Wl,--build-id=none -m64 -static -nostdlib $(filter %.o, $^) -o $@
|
||||
@chmod a-x $@
|
||||
|
||||
%.bin.debug: %.exec
|
||||
|
||||
Reference in New Issue
Block a user