We use different toolchain directories for different ARM archs, so we should set the default arch of gcc to reflect this.
This enables EABI support for armv4 CPUs. Signed-off-by: Jochen Friedrich <[email protected]> --- rules.mk | 18 ++++++------------ toolchain/gcc/common.mk | 4 ++++ 2 files changed, 10 insertions(+), 12 deletions(-) Changes since V1: - fold ARM arch check into one place - generalize arch check as suggested by Jo-Philipp Wich diff --git a/rules.mk b/rules.mk index b69769a..b778a2e 100644 --- a/rules.mk +++ b/rules.mk @@ -54,21 +54,15 @@ endif HOST_FPIC:=-fPIC ARCH_SUFFIX:= +GCC_ARCH:= + +ifneq ($(filter -march=armv%,$(TARGET_OPTIMIZATION)),) + ARCH_SUFFIX:=_$(patsubst -march=arm%,%,$(filter -march=armv%,$(TARGET_OPTIMIZATION))) + GCC_ARCH:=$(patsubst -march=%,%,$(filter -march=armv%,$(TARGET_OPTIMIZATION))) +endif ifneq ($(findstring -mips32r2,$(TARGET_OPTIMIZATION)),) ARCH_SUFFIX:=_r2 endif -ifneq ($(findstring -march=armv4,$(TARGET_OPTIMIZATION)),) - ARCH_SUFFIX:=_v4 -endif -ifneq ($(findstring -march=armv4t,$(TARGET_OPTIMIZATION)),) - ARCH_SUFFIX:=_v4t -endif -ifneq ($(findstring -march=armv5t,$(TARGET_OPTIMIZATION)),) - ARCH_SUFFIX:=_v5t -endif -ifneq ($(findstring -march=armv5te,$(TARGET_OPTIMIZATION)),) - ARCH_SUFFIX:=_v5te -endif ifdef CONFIG_HAS_SPE_FPU TARGET_SUFFIX:=$(TARGET_SUFFIX)spe endif diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk index 0f22e41..888cf7a 100644 --- a/toolchain/gcc/common.mk +++ b/toolchain/gcc/common.mk @@ -167,6 +167,10 @@ ifdef CONFIG_powerpc TARGET_CFLAGS := $(patsubst -Os,-O2,$(TARGET_CFLAGS)) endif +ifneq ($(GCC_ARCH),) + GCC_CONFIGURE+= --with-arch=$(GCC_ARCH) +endif + GCC_MAKE:= \ export SHELL="$(BASH)"; \ $(MAKE) $(TOOLCHAIN_JOBS) \ -- 1.7.2.3 _______________________________________________ openwrt-devel mailing list [email protected] https://lists.openwrt.org/mailman/listinfo/openwrt-devel
