xtensa: don't produce FDPIC output with fdpic toolchain
authorMax Filippov <jcmvbkbc@gmail.com>
Thu, 11 Jan 2024 04:20:00 +0000 (20:20 -0800)
committerMax Filippov <jcmvbkbc@gmail.com>
Fri, 12 Jan 2024 02:58:47 +0000 (18:58 -0800)
The kernel doesn't use features of the FDPIC toolchain, disable FDPIC
code generation when using such toolchain and select ordinary ELF linker
emulation.

Signed-off-by: Max Filippov <jcmvbkbc@gmail.com>
arch/xtensa/Makefile

index bfd8e433ed621e89366ddaabb80bb9d0672d2b89..4c14a02179eba5726c65fbcd94517c32596e25ad 100644 (file)
@@ -35,15 +35,19 @@ KBUILD_CFLAGS += -ffreestanding -D__linux__
 KBUILD_CFLAGS += -pipe -mlongcalls -mtext-section-literals
 KBUILD_CFLAGS += $(call cc-option,-mforce-no-pic,)
 KBUILD_CFLAGS += $(call cc-option,-mno-serialize-volatile,)
+KBUILD_CFLAGS += $(call cc-option,-mno-fdpic,)
 ifneq ($(CONFIG_KERNEL_ABI_CALL0),)
 KBUILD_CFLAGS += -mabi=call0
 KBUILD_AFLAGS += -mabi=call0
 endif
 
 KBUILD_AFLAGS += -mlongcalls -mtext-section-literals
+KBUILD_AFLAGS += $(call cc-option,-mno-fdpic,)
+
+KBUILD_LDFLAGS += -m elf32xtensa
 
 ifneq ($(CONFIG_LD_NO_RELAX),)
-KBUILD_LDFLAGS := --no-relax
+KBUILD_LDFLAGS += --no-relax
 endif
 
 CHECKFLAGS += -D$(if $(CONFIG_CPU_BIG_ENDIAN),__XTENSA_EB__,__XTENSA_EL__)