Makefile: Move -no-pie from CFLAGS into LDFLAGS
PATCH 1/1 Makefile: Move -no-pie from CFLAGS into LDFLAGS
"-no-pie" is an option for linking, not for compiling, so we must put this into the lDFLAGS, not into CFLAGS. Without this change, the linking currently fails on Ubuntu 22.04 when compiling on a s390x host.
--- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
Makefile +2 -2
@@ -80,7 +80,7 @@ COMMON_CFLAGS += $(if $(U32_LONG_FMT),-D__U32_LONG_FMT__,) ifeq ($(CONFIG_EFI),y) COMMON_CFLAGS += $(EFI_CFLAGS) else -COMMON_CFLAGS += $(fno_pic) $(no_pie) +COMMON_CFLAGS += $(fno_pic) endif COMMON_CFLAGS += $(wclobbered) COMMON_CFLAGS += $(wunused_but_set_parameter)
@@ -92,7 +92,7 @@ CFLAGS += -Woverride-init -Wmissing-prototypes -Wstrict-prototypes autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -LDFLAGS += -nostdlib -z noexecstack +LDFLAGS += -nostdlib $(no_pie) -z noexecstack $(libcflat): $(cflatobjs) $(AR) rcs $@ $^
Signature · 1 line
2.39.3
Quoted 2 lines · Thomas Huth
"-no-pie" is an option for linking, not for compiling, so we must put this into the lDFLAGS, not into CFLAGS. Without this change, the linking
^ L
Quoted 34 lines
currently fails on Ubuntu 22.04 when compiling on a s390x host.
Reported-by Janosch Frank <[email protected]>Fixes e489c25e ("Rework the common LDFLAGS to become more useful again")Signed-off-by Thomas Huth <[email protected]>--- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)Makefile +2
-2@@ -80,7 +80,7 @@ COMMON_CFLAGS += $(if $(U32_LONG_FMT),-D__U32_LONG_FMT__,) ifeq ($(CONFIG_EFI),y) COMMON_CFLAGS += $(EFI_CFLAGS) else -COMMON_CFLAGS += $(fno_pic) $(no_pie) +COMMON_CFLAGS += $(fno_pic) endif COMMON_CFLAGS += $(wclobbered) COMMON_CFLAGS += $(wunused_but_set_parameter)@@ -92,7 +92,7 @@ CFLAGS += -Woverride-init -Wmissing-prototypes -Wstrict-prototypes autodepend-flags = -MMD -MF $(dir $*).$(notdir $*).d -LDFLAGS += -nostdlib -z noexecstack +LDFLAGS += -nostdlib $(no_pie) -z noexecstack $(libcflat): $(cflatobjs) $(AR) rcs $@ $^Signature · 1 line
2.39.3
Otherwise,
Thanks,
drew
Quoted 7 lines · Thomas Huth
"-no-pie" is an option for linking, not for compiling, so we must put this into the lDFLAGS, not into CFLAGS. Without this change, the linking currently fails on Ubuntu 22.04 when compiling on a s390x host.
Reported-by Janosch Frank <[email protected]>Fixes e489c25e ("Rework the common LDFLAGS to become more useful again")Signed-off-by Thomas Huth <[email protected]>
Just tested it on my system, this fixes the compile problem.
Quoted 10 lines · Janosch Frank
Quoted 7 lines · Thomas Huth
"-no-pie" is an option for linking, not for compiling, so we must put this into the lDFLAGS, not into CFLAGS. Without this change, the linking currently fails on Ubuntu 22.04 when compiling on a s390x host.
Reported-by Janosch Frank <[email protected]>Fixes e489c25e ("Rework the common LDFLAGS to become more useful again")Signed-off-by Thomas Huth <[email protected]>Just tested it on my system, this fixes the compile problem.
Great, thanks for checking, so I pushed it now to the repo.
Thomas