From 4e8d8d2345ea121b1e9d228603ece1142c9bb82f Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Sun, 29 Sep 2024 22:14:56 +0200 Subject: [PATCH] linux: pass -mno-fdpic if FDPIC is enabled If the FDPIC ABI is enabled by default in the toolchain, it must be explicitly disabled when building the kernel. Signed-off-by: Ben Wolsieffer Signed-off-by: Waldemar Brodkorb Signed-off-by: Dario Binacchi Signed-off-by: Thomas Petazzoni --- linux/linux.mk | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/linux/linux.mk b/linux/linux.mk index 0a213d17b5..126e92e84c 100644 --- a/linux/linux.mk +++ b/linux/linux.mk @@ -163,6 +163,7 @@ endif LINUX_MAKE_FLAGS = \ HOSTCC="$(HOSTCC) $(subst -I/,-isystem /,$(subst -I /,-isystem /,$(HOST_CFLAGS))) $(HOST_LDFLAGS)" \ ARCH=$(KERNEL_ARCH) \ + KCFLAGS="$(LINUX_CFLAGS)" \ INSTALL_MOD_PATH=$(TARGET_DIR) \ CROSS_COMPILE="$(TARGET_CROSS)" \ WERROR=0 \ @@ -184,7 +185,12 @@ endif # sanitize the arguments passed from user space in registers. # https://gcc.gnu.org/bugzilla/show_bug.cgi?id=82435 ifeq ($(BR2_TOOLCHAIN_GCC_AT_LEAST_8),y) -LINUX_MAKE_ENV += KCFLAGS=-Wno-attribute-alias +LINUX_CFLAGS += -Wno-attribute-alias +endif + +# Disable FDPIC if enabled by default in toolchain +ifeq ($(BR2_BINFMT_FDPIC),y) +LINUX_CFLAGS += -mno-fdpic endif ifeq ($(BR2_LINUX_KERNEL_DTB_OVERLAY_SUPPORT),y)