From d75e29c9b23d0edf47dadba365f592e5f7f957a7 Mon Sep 17 00:00:00 2001 From: Ben Wolsieffer Date: Sun, 29 Sep 2024 22:14:54 +0200 Subject: [PATCH] arch/arm: add support for FDPIC Linux on ARM supports FDPIC binaries intended for use on no-MMU systems. This patch enables support for building a toolchain that produces FDPIC binaries, only for ARMv7-M platforms, for which FDPIC binaries are relevant. The target name for a FDPIC toolchain must be arm--uclinuxfdpiceabi, which doesn't follow the standard format and requires a special case. Signed-off-by: Ben Wolsieffer Signed-off-by: Waldemar Brodkorb Signed-off-by: Dario Binacchi Signed-off-by: Thomas Petazzoni --- arch/Config.in.arm | 1 + package/Makefile.in | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/arch/Config.in.arm b/arch/Config.in.arm index b44a164e03..219215d122 100644 --- a/arch/Config.in.arm +++ b/arch/Config.in.arm @@ -89,6 +89,7 @@ config BR2_ARM_CPU_ARMV7A config BR2_ARM_CPU_ARMV7M bool + select BR2_ARCH_HAS_FDPIC_SUPPORT config BR2_ARM_CPU_ARMV8A bool diff --git a/package/Makefile.in b/package/Makefile.in index 808b71a93e..829636900b 100644 --- a/package/Makefile.in +++ b/package/Makefile.in @@ -39,7 +39,13 @@ $(error BR2_TOOLCHAIN_BUILDROOT_VENDOR cannot be 'unknown'. \ endif # Compute GNU_TARGET_NAME +# FDPIC on ARM requires a special target name: it has no OS field and must +# use the suffix -uclinuxfdpiceabi. +ifeq ($(BR2_arm)$(BR2_armeb):$(BR2_BINFMT_FDPIC),y:y) +GNU_TARGET_NAME = $(ARCH)-$(TARGET_VENDOR)-uclinuxfdpiceabi +else GNU_TARGET_NAME = $(ARCH)-$(TARGET_VENDOR)-$(TARGET_OS)-$(LIBC)$(ABI) +endif # FLAT binary format needs uclinux, except RISC-V which needs the # regular linux name.