Zebreus has uploaded this change for review.

View Change

util/crossgcc: Support building gcc for riscv32

Adds a target for building gcc for the riscv32-elf target
architecture to the Makefile and buildgcc. riscv32 support
is needed for porting coreboot to some smaller RISC-V SoCs
like the BL808.

Change-Id: Ice89e3af86a42d47b3b24022dd6a5a70ab3b6504
Signed-off-by: Lennart Eichhorn <lennarteichhorn@googlemail.com>
---
M util/crossgcc/Makefile
M util/crossgcc/buildgcc
2 files changed, 11 insertions(+), 5 deletions(-)

git pull ssh://review.coreboot.org:29418/coreboot refs/changes/17/80317/1
diff --git a/util/crossgcc/Makefile b/util/crossgcc/Makefile
index 06ec91c..db1916b 100644
--- a/util/crossgcc/Makefile
+++ b/util/crossgcc/Makefile
@@ -10,8 +10,8 @@

all:
$(MAKE) build-i386 build-x64 build-arm \
- build-riscv build-aarch64 build-ppc64 build-nds32le \
- build_clang build_iasl build_nasm
+ build-riscv build-riscv32 build-aarch64 build-ppc64 \
+ build-nds32le build_clang build_iasl build_nasm

###########################################################
### targets to do buildgcc builds
@@ -47,6 +47,9 @@
build-riscv:
@$(MAKE) build_gcc BUILD_PLATFORM=riscv-elf

+build-riscv32:
+ @$(MAKE) build_gcc BUILD_PLATFORM=riscv32-elf
+
build-ppc64:
@$(MAKE) build_gcc BUILD_PLATFORM=powerpc64-linux-gnu

@@ -69,6 +72,6 @@
.PHONY: all build_gcc build_iasl build_clang build_nasm \
clean distclean clean_tempfiles \
build-i386 build-x64 build-arm build-aarch64 \
- build-riscv build-ppc64 build-nds32le
+ build-riscv build-riscv32 build-ppc64 build-nds32le

.NOTPARALLEL:
diff --git a/util/crossgcc/buildgcc b/util/crossgcc/buildgcc
index b294da5..529df98 100755
--- a/util/crossgcc/buildgcc
+++ b/util/crossgcc/buildgcc
@@ -593,8 +593,8 @@
printf " [-l|--languages <languages>] comma separated list of target languages\n"
printf " (defaults to $DEFAULT_LANGUAGES)\n"
printf "Platforms for GCC:\n"
- printf " x86_64 i386-elf i386-mingw32 riscv-elf arm aarch64\n"
- printf " powerpc64le-linux-gnu nds32le-elf\n\n"
+ printf " x86_64 i386-elf i386-mingw32 riscv-elf riscv32-elf arm\n"
+ printf " aarch64 powerpc64le-linux-gnu nds32le-elf\n\n"
}

printversion() {
@@ -1000,6 +1000,9 @@
TARGET_BINUTILS_OPTIONS="$TARGET_BINUTILS_OPTIONS --with-isa-spec=20191213";;
powerpc64*-linux*) ;;
i386*) TARGETARCH=i386-elf;;
+ riscv32-elf) TARGETARCH=riscv32-elf
+ GCC_OPTIONS="$GCC_OPTIONS --with-isa-spec=20191213"
+ BINUTILS_OPTIONS="$BINUTILS_OPTIONS --with-isa-spec=20191213";;
arm*) TARGETARCH=arm-eabi;;
aarch64*) TARGETARCH=aarch64-elf;;
nds32le-elf) ;;

To view, visit change 80317. To unsubscribe, or for help writing mail filters, visit settings.

Gerrit-Project: coreboot
Gerrit-Branch: main
Gerrit-Change-Id: Ice89e3af86a42d47b3b24022dd6a5a70ab3b6504
Gerrit-Change-Number: 80317
Gerrit-PatchSet: 1
Gerrit-Owner: Zebreus <lennarteichhorn@googlemail.com>
Gerrit-MessageType: newchange