[OpenWrt-Devel] [PATCH 1/2 v2] toolchain: add support of ARCv2 architecture

Alexey Brodkin Alexey.Brodkin at synopsys.com
Mon Jan 18 12:51:57 EST 2016


This change adds support of ARC ISAv2 processors in
OpenWRT toolchain.

In general gcc for ARC may compile code for both ISA versions
simultaneously but libgcc will be built only for default
architecture that's why it's necessary to specify --with-cpu
on gcc configuration.

As for uClibc we need to use different configurations for
different ARC ISAs.

Signed-off-by: Alexey Brodkin <abrodkin at synopsys.com>
Cc: Felix Fietkau <nbd at openwrt.org>
Cc: Jo-Philipp Wich <jow at openwrt.org>
Cc: Jonas Gorski <jogo at openwrt.org>
---

Changes v1 -> v2:
 * Toolchain changes were moved to a separate patch

 toolchain/gcc/common.mk       |  1 +
 toolchain/uClibc/common.mk    |  3 ++-
 toolchain/uClibc/config/archs | 10 ++++++++++
 3 files changed, 13 insertions(+), 1 deletion(-)
 create mode 100644 toolchain/uClibc/config/archs

diff --git a/toolchain/gcc/common.mk b/toolchain/gcc/common.mk
index 648cd2d..458215f 100644
--- a/toolchain/gcc/common.mk
+++ b/toolchain/gcc/common.mk
@@ -133,6 +133,7 @@ GCC_CONFIGURE:= \
 		$(call qstrip,$(CONFIG_EXTRA_GCC_CONFIG_OPTIONS)) \
 		$(if $(CONFIG_mips64)$(CONFIG_mips64el),--with-arch=mips64 \
 			--with-abi=$(call qstrip,$(CONFIG_MIPS64_ABI))) \
+		$(if $(CONFIG_arc),--with-cpu=$(CONFIG_CPU_TYPE)) \
 		--with-gmp=$(TOPDIR)/staging_dir/host \
 		--with-mpfr=$(TOPDIR)/staging_dir/host \
 		--with-mpc=$(TOPDIR)/staging_dir/host \
diff --git a/toolchain/uClibc/common.mk b/toolchain/uClibc/common.mk
index ad6ff02..2828156 100644
--- a/toolchain/uClibc/common.mk
+++ b/toolchain/uClibc/common.mk
@@ -41,8 +41,9 @@ GEN_CONFIG=$(SCRIPT_DIR)/kconfig.pl -n \
 	$(if $(CONFIG_UCLIBC_ENABLE_DEBUG),$(if $(wildcard $(CONFIG_DIR)/debug),'+' $(CONFIG_DIR)/debug)) \
 	$(CONFIG_DIR)/$(ARCH)$(strip \
 		$(if $(wildcard $(CONFIG_DIR)/$(ARCH).$(BOARD)),.$(BOARD), \
+			$(if $(filter archs,$(subst ",,$(CONFIG_CPU_TYPE))),hs, \
 			$(if $(CONFIG_MIPS64_ABI),.$(subst ",,$(CONFIG_MIPS64_ABI)), \
-			$(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500)))))
+			$(if $(CONFIG_HAS_SPE_FPU),$(if $(wildcard $(CONFIG_DIR)/$(ARCH).e500),.e500))))))
 
 CPU_CFLAGS = \
 	-funsigned-char -fno-builtin -fno-asm \
diff --git a/toolchain/uClibc/config/archs b/toolchain/uClibc/config/archs
new file mode 100644
index 0000000..961628e
--- /dev/null
+++ b/toolchain/uClibc/config/archs
@@ -0,0 +1,10 @@
+ARCH_ANY_ENDIAN=y
+ARCH_LITTLE_ENDIAN=y
+ARCH_WANTS_LITTLE_ENDIAN=y
+TARGET_ARCH="arc"
+TARGET_arc=y
+# CONFIG_ARC_CPU_700 is not set
+CONFIG_ARC_CPU_HS=y
+CONFIG_ARC_PAGE_SIZE_8K=y
+# CONFIG_ARC_PAGE_SIZE_16K is not set
+# CONFIG_ARC_PAGE_SIZE_4K is not set
-- 
2.5.0
_______________________________________________
openwrt-devel mailing list
openwrt-devel at lists.openwrt.org
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-devel



More information about the openwrt-devel mailing list