Skip to content

Commit 6c6a300

Browse files
committed
Merge #13543: depends: Add RISC-V support
974f0bf depends: Mention RISC-V known compilation issue with gcc-7.3.x (Wladimir J. van der Laan) 0d1f38c depends: update zmq config.guess/config.sub for riscv support (fanquake) 409481c depends: latest config.sub (fanquake) d7005e9 depends: latest config.guess (fanquake) 359e2e3 depends: Add RISC-V support (Wladimir J. van der Laan) Pull request description: This adds support for riscv32 and riscv64 builds to the depends system. The change consists of documentation and build system changes. The most significant change is an update of `config.sub` and `config.guess` inside zeromq patch, as the current version does not recognize the `riscv*` host tuples (there's no new version of ZeroMQ yet with newer ones). Good thing: RISC-V 64-bit toolchain packages can be installed out of the box on Ubuntu 18.04+. I would also like to add RISC-V 64-bit executables to gitian, but this will not be possible until #12511 . Tree-SHA512: 358ed72ee9e4ae44e7d305c09a4ff5ce5460eeb7ed915eb25d39c8f43b61e7b347f51bf0ae5d83ddb4ce8876dea7703c926b3baa3cccb4932b3bc17160d801bb
2 parents b641f60 + 974f0bf commit 6c6a300

File tree

7 files changed

+775
-754
lines changed

7 files changed

+775
-754
lines changed

depends/.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,3 +8,5 @@ i686*
88
mips*
99
arm*
1010
aarch64*
11+
riscv32*
12+
riscv64*

depends/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ $(host_prefix)/share/config.site: check-packages
167167
check-packages: check-sources
168168

169169
clean-all: clean
170-
@rm -rf $(SOURCES_PATH) x86_64* i686* mips* arm* aarch64*
170+
@rm -rf $(SOURCES_PATH) x86_64* i686* mips* arm* aarch64* riscv32* riscv64*
171171

172172
clean:
173173
@rm -rf $(WORK_PATH) $(BASE_CACHE) $(BUILD)

depends/README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,8 @@ Common `host-platform-triplets` for cross compilation are:
2525
- `x86_64-apple-darwin11` for macOS
2626
- `arm-linux-gnueabihf` for Linux ARM 32 bit
2727
- `aarch64-linux-gnu` for Linux ARM 64 bit
28+
- `riscv32-linux-gnu` for Linux RISC-V 32 bit
29+
- `riscv64-linux-gnu` for Linux RISC-V 64 bit
2830

2931
No other options are needed, the paths are automatically configured.
3032

@@ -43,6 +45,12 @@ For linux (including i386, ARM) cross compilation:
4345

4446
sudo apt-get install curl g++-aarch64-linux-gnu g++-4.8-aarch64-linux-gnu gcc-4.8-aarch64-linux-gnu binutils-aarch64-linux-gnu g++-arm-linux-gnueabihf g++-4.8-arm-linux-gnueabihf gcc-4.8-arm-linux-gnueabihf binutils-arm-linux-gnueabihf g++-4.8-multilib gcc-4.8-multilib binutils-gold bsdmainutils
4547

48+
For linux RISC-V 64-bit cross compilation (there are no packages for 32-bit):
49+
50+
sudo apt-get install curl g++-riscv64-linux-gnu binutils-riscv64-linux-gnu
51+
52+
RISC-V known issue: gcc-7.3.0 and gcc-7.3.1 result in a broken `test_bitcoin` executable (see https://github.com/bitcoin/bitcoin/pull/13543),
53+
this is apparently fixed in gcc-8.1.0.
4654

4755
Dependency Options:
4856
The following can be set when running make: make FOO=bar

depends/config.guess

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# Attempt to guess a canonical system name.
33
# Copyright 1992-2018 Free Software Foundation, Inc.
44

5-
timestamp='2018-01-26'
5+
timestamp='2018-07-06'
66

77
# This file is free software; you can redistribute it and/or modify it
88
# under the terms of the GNU General Public License as published by
@@ -101,12 +101,12 @@ trap "exitcode=\$?; (rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null) && e
101101
trap "rm -f \$tmpfiles 2>/dev/null; rmdir \$tmp 2>/dev/null; exit 1" 1 2 13 15 ;
102102
: ${TMPDIR=/tmp} ;
103103
{ tmp=`(umask 077 && mktemp -d "$TMPDIR/cgXXXXXX") 2>/dev/null` && test -n "$tmp" && test -d "$tmp" ; } ||
104-
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp) ; } ||
105-
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp) && echo "Warning: creating insecure temp directory" >&2 ; } ||
104+
{ test -n "$RANDOM" && tmp=$TMPDIR/cg$$-$RANDOM && (umask 077 && mkdir $tmp 2>/dev/null) ; } ||
105+
{ tmp=$TMPDIR/cg-$$ && (umask 077 && mkdir $tmp 2>/dev/null) && echo "Warning: creating insecure temp directory" >&2 ; } ||
106106
{ echo "$me: cannot create a temporary directory in $TMPDIR" >&2 ; exit 1 ; } ;
107107
dummy=$tmp/dummy ;
108108
tmpfiles="$dummy.c $dummy.o $dummy.rel $dummy" ;
109-
case $CC_FOR_BUILD,$HOST_CC,$CC in
109+
case ${CC_FOR_BUILD-},${HOST_CC-},${CC-} in
110110
,,) echo "int x;" > "$dummy.c" ;
111111
for c in cc gcc c89 c99 ; do
112112
if ($c -c -o "$dummy.o" "$dummy.c") >/dev/null 2>&1 ; then
@@ -237,7 +237,7 @@ case "$UNAME_MACHINE:$UNAME_SYSTEM:$UNAME_RELEASE:$UNAME_VERSION" in
237237
# Since CPU_TYPE-MANUFACTURER-KERNEL-OPERATING_SYSTEM:
238238
# contains redundant information, the shorter form:
239239
# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM is used.
240-
echo "$machine-${os}${release}${abi}"
240+
echo "$machine-${os}${release}${abi-}"
241241
exit ;;
242242
*:Bitrig:*:*)
243243
UNAME_MACHINE_ARCH=`arch | sed 's/Bitrig.//'`
@@ -894,8 +894,8 @@ EOF
894894
# other systems with GNU libc and userland
895895
echo "$UNAME_MACHINE-unknown-`echo "$UNAME_SYSTEM" | sed 's,^[^/]*/,,' | tr "[:upper:]" "[:lower:]"``echo "$UNAME_RELEASE"|sed -e 's/[-(].*//'`-$LIBC"
896896
exit ;;
897-
i*86:Minix:*:*)
898-
echo "$UNAME_MACHINE"-pc-minix
897+
*:Minix:*:*)
898+
echo "$UNAME_MACHINE"-unknown-minix
899899
exit ;;
900900
aarch64:Linux:*:*)
901901
echo "$UNAME_MACHINE"-unknown-linux-"$LIBC"
@@ -1469,7 +1469,7 @@ EOF
14691469
exit 1
14701470

14711471
# Local variables:
1472-
# eval: (add-hook 'write-file-functions 'time-stamp)
1472+
# eval: (add-hook 'before-save-hook 'time-stamp)
14731473
# time-stamp-start: "timestamp='"
14741474
# time-stamp-format: "%:y-%02m-%02d"
14751475
# time-stamp-end: "'"

0 commit comments

Comments
 (0)