"-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 <frankja@xxxxxxxxxxxxx> Fixes: e489c25e ("Rework the common LDFLAGS to become more useful again") Signed-off-by: Thomas Huth <thuth@xxxxxxxxxx> --- Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 8809a8b6..e7998a40 100644 --- a/Makefile +++ b/Makefile @@ -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 $@ $^ -- 2.39.3