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 <Ben.Wolsieffer@hefring.com>
Signed-off-by: Waldemar Brodkorb <wbx@openadk.org>
Signed-off-by: Dario Binacchi <dario.binacchi@amarulasolutions.com>
Signed-off-by: Thomas Petazzoni <thomas.petazzoni@bootlin.com>
This commit is contained in:
Ben Wolsieffer
2024-09-29 22:14:56 +02:00
committed by Thomas Petazzoni
parent ceff8dbaa5
commit 4e8d8d2345

View File

@@ -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)