On 2011-02-15 6:36 PM, Jochen Friedrich wrote:
> 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 <joc...@scram.de>
> ---
>  toolchain/gcc/common.mk |   18 ++++++++++++++++++
>  1 files changed, 18 insertions(+), 0 deletions(-)
> 
> diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
> index 0f22e41..4d4e1e4 100644
> --- a/toolchain/gcc/common.mk
> +++ b/toolchain/gcc/common.mk
> @@ -167,6 +167,24 @@ ifdef CONFIG_powerpc
>    TARGET_CFLAGS := $(patsubst -Os,-O2,$(TARGET_CFLAGS))
>  endif
>  
> +GCC_ARCH:=
> +ifneq ($(findstring -march=armv4,$(TARGET_OPTIMIZATION)),)
> +  GCC_ARCH:=armv4
> +endif
> +ifneq ($(findstring -march=armv4t,$(TARGET_OPTIMIZATION)),)
> +  GCC_ARCH:=armv4t
> +endif
> +ifneq ($(findstring -march=armv5t,$(TARGET_OPTIMIZATION)),)
> +  GCC_ARCH:=armv5t
> +endif
> +ifneq ($(findstring -march=armv5te,$(TARGET_OPTIMIZATION)),)
> +  GCC_ARCH:=armv5te
> +endif
> +
> +ifneq ($(GCC_ARCH),)
> +  GCC_CONFIGURE+= --with-arch=$(GCC_ARCH)
> +endif
> +
How about this instead?
GCC_ARCH:=$(patsubst -march=%,%,$(filter -march=arm%,$(TARGET_OPTIMIZATION)))
That way we won't have to list every single possible ARM arch type.
Maybe we could even remove the 'arm' part from the filter to use this
on other architectures as well.

- Felix
_______________________________________________
openwrt-devel mailing list
openwrt-devel@lists.openwrt.org
https://lists.openwrt.org/mailman/listinfo/openwrt-devel

Reply via email to