Skip to contentSkip to conversation

Support nds32 pre-build toolchain

PATCH New Andes 1 participant 5 messages Jan 15, 2019

lore
Share & tools
lore

Andes

author
#0 lore raw

cover Support nds32 pre-build toolchain

From: Rick Chen <[email protected]>

1. Support nds32 pre-build toolcahin for buildman.
2. Fix some bugs about fpu and toolchain issues.

Rick Chen (4):
.travis.yml: Support nds32 prebuilt toolchain
nds32: Remove gcc unused option
nds32: Generate SW fpu instruction.
nds32: Fix boot fail issue when build with elf-mculib.

 .travis.yml          | 9 +++++++++
 arch/nds32/config.mk | 6 +++---
 2 files changed, 12 insertions(+), 3 deletions(-)
Signature · 1 line
2.7.4
author
#1 lore raw

PATCH 1/4 .travis.yml: Support nds32 prebuilt toolchain

From: Rick Chen <[email protected]>

Download nds32 prebuild toolchain from github which is base on gcc 8.0.1 version for regression.

Cc Greentime Hu <[email protected]>
---
 .travis.yml | 9 +++++++++
 1 file changed, 9 insertions(+)
.travis.yml +9 -0
index 321fd79..4b7c696 100644
@@ -78,6 +78,11 @@ before_script:
        wget https://github.com/foss-for-synopsys-dwc-arc-processors/toolchain/releases/download/arc-2018.09-release/arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz &&
        tar -C /tmp -xf arc_gnu_2018.09_prebuilt_uclibc_le_archs_linux_install.tar.gz;
     fi
+  - if [[ "${TOOLCHAIN}" == "nds32" ]]; then
+       wget https://github.com/vincentzwc/prebuilt-nds32-toolchain/releases/download/20180521/nds32le-linux-glibc-v3-upstream.tar.gz &&
+       tar -C /tmp -xf nds32le-linux-glibc-v3-upstream.tar.gz &&
+       echo -e "\n[toolchain-prefix]\nnds32 = /tmp/nds32le-linux-glibc-v3-upstream/bin/nds32le-linux-" >> ~/.buildman;
+    fi
   - if [[ "${TOOLCHAIN}" == *xtensa* ]]; then
        wget https://github.com/foss-xtensa/toolchain/releases/download/2018.02/x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
        tar -C /tmp -xf x86_64-2018.02-${TOOLCHAIN}.tar.gz &&
@@ -311,6 +316,10 @@ matrix:
       env:
         - BUILDMAN="riscv"
           TOOLCHAIN="riscv"
+    - name: "buildman nds32"
+      env:
+        - BUILDMAN="nds32"
+          TOOLCHAIN="nds32"
 
     # QA jobs for code analytics
     # static code analysis with cppcheck (we can add --enable=all later)
Signature · 1 line
2.7.4
author
#2 lore raw

PATCH 2/4 nds32: Remove gcc unused option

In reply to Andes

From: Rick Chen <[email protected]>

-G0 is an old option, not support now,
So remove it.
It can help to fix compile error when
build with nds32 pre-build toolchain.

Cc Greentime Hu <[email protected]>
---
 arch/nds32/config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nds32/config.mk +1 -1
index 12cec36..a0f14ae 100644
@@ -17,6 +17,6 @@ LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/nds32.lds
 
 PLATFORM_RELFLAGS	+= -fno-common -mrelax
 PLATFORM_RELFLAGS	+= -gdwarf-2
-PLATFORM_CPPFLAGS	+= -D__nds32__ -G0 -ffixed-10 -fpie
+PLATFORM_CPPFLAGS	+= -D__nds32__ -ffixed-10 -fpie
 
 LDFLAGS_u-boot		= --gc-sections --relax -pie
Signature · 1 line
2.7.4
author
#3 lore raw

PATCH 3/4 nds32: Generate SW fpu instruction.

In reply to Andes

From: Rick Chen <[email protected]>

Force it to generate SW fup instruction.
It help to avoid bugs when running on no-HW-fpu board, but compile with v3f which support HW fpu instruction.

Cc Greentime Hu <[email protected]>
---
 arch/nds32/config.mk | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/nds32/config.mk +2 -2
index a0f14ae..4e10de0 100644
@@ -15,8 +15,8 @@ endif
 CONFIG_STANDALONE_LOAD_ADDR = 0x300000
 LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/nds32.lds
 
-PLATFORM_RELFLAGS	+= -fno-common -mrelax
+PLATFORM_RELFLAGS	+= -fno-common -mrelax -mno-ext-fpu-dp -mfloat-abi=soft
 PLATFORM_RELFLAGS	+= -gdwarf-2
 PLATFORM_CPPFLAGS	+= -D__nds32__ -ffixed-10 -fpie
 
-LDFLAGS_u-boot		= --gc-sections --relax -pie
+LDFLAGS_u-boot		= --gc-sections --relax -pie --mabi=AABI
Signature · 1 line
2.7.4
author
#4 lore raw

PATCH 4/4 nds32: Fix boot fail issue when build with elf-mculib.

In reply to Andes

From: Rick Chen <[email protected]>

Add -mcmodel=large can let elf-mculib have the same default behavior just like linux-glibc. And it help to pass U-Boot booting sequence.

Cc Greentime Hu <[email protected]>
---
 arch/nds32/config.mk | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
arch/nds32/config.mk +1 -1
index 4e10de0..a1c3371 100644
@@ -17,6 +17,6 @@ LDFLAGS_STANDALONE	+= -T $(srctree)/examples/standalone/nds32.lds
 
 PLATFORM_RELFLAGS	+= -fno-common -mrelax -mno-ext-fpu-dp -mfloat-abi=soft
 PLATFORM_RELFLAGS	+= -gdwarf-2
-PLATFORM_CPPFLAGS	+= -D__nds32__ -ffixed-10 -fpie
+PLATFORM_CPPFLAGS	+= -D__nds32__ -ffixed-10 -fpie -mcmodel=large
 
 LDFLAGS_u-boot		= --gc-sections --relax -pie --mabi=AABI
Signature · 1 line
2.7.4