On Fri, Nov 13, 2026 at 01:01:01PM +0100, Thomas Huth wrote: > The settings for position-independant code are currently quite a mess: > It depends on the target whether we need the flags or rather should even > disable PIC / PIE, but currently the settings are spread between the > main Makefile (-fno-pic is the default, unless CONFIG_EFI has been set) > and the target specific Makefiles. > This leads to some weird situations where we have -fno-pic in the CFLAGS, > but link with -pie in the LDFLAGS since we still want to get a relocation > table, but then again need to add a "-z notext" to the linker flags to > avoid warnings about relocation entries in the text segment. > Let's face it: Always adding -fno-pic / -no-pie in the main Makefile is > a bad idea. Move the settings to the target specific Makefiles instead > where we know what we really want, and then we can finally drop the > "-z notext" settings, too. > > Signed-off-by: Thomas Huth <[email protected]> > --- > Makefile | 6 +----- > arm/Makefile.arm | 2 ++ > arm/Makefile.arm64 | 3 +-- > powerpc/Makefile | 5 ++++- > riscv/Makefile | 1 + > s390x/Makefile | 3 +++ > x86/Makefile.common | 5 +++++ > 7 files changed, 17 insertions(+), 8 deletions(-) >
Acked-by: Andrew Jones <[email protected]>
