Package Details: riscv-gnu-toolchain-bin 2022.03.25-2

Git Clone URL: https://aur.archlinux.org/riscv-gnu-toolchain-bin.git (read-only, click to copy)
Package Base: riscv-gnu-toolchain-bin
Description: GNU toolchain for RISC-V, including GCC. Precompiled riscv64-unknown-elf-gcc, riscv32-unknown-elf-gcc, riscv64-unknown-linux-gnu-gcc, and riscv32-unknown-linux-gnu-gcc.
Upstream URL: https://github.com/riscv-collab/riscv-gnu-toolchain
Keywords: riscv32 riscv32-unknown-elf-gcc riscv32-unknown-linux-gnu-gcc riscv64 riscv64-unknown-elf-gcc riscv64-unknown-linux-gnu-gcc
Licenses: GPL2
Provides: riscv-gnu-toolchain-bin, riscv32-unknown-elf-addr2line, riscv32-unknown-elf-ar, riscv32-unknown-elf-as, riscv32-unknown-elf-c++, riscv32-unknown-elf-c++filt, riscv32-unknown-elf-cpp, riscv32-unknown-elf-elfedit, riscv32-unknown-elf-g++, riscv32-unknown-elf-gcc, riscv32-unknown-elf-gcc-11.1.0, riscv32-unknown-elf-gcc-ar, riscv32-unknown-elf-gcc-nm, riscv32-unknown-elf-gcc-ranlib, riscv32-unknown-elf-gcov, riscv32-unknown-elf-gcov-dump, riscv32-unknown-elf-gcov-tool, riscv32-unknown-elf-gdb, riscv32-unknown-elf-gdb-add-index, riscv32-unknown-elf-gprof, riscv32-unknown-elf-ld, riscv32-unknown-elf-ld.bfd, riscv32-unknown-elf-lto-dump, riscv32-unknown-elf-nm, riscv32-unknown-elf-objcopy, riscv32-unknown-elf-objdump, riscv32-unknown-elf-ranlib, riscv32-unknown-elf-readelf, riscv32-unknown-elf-run, riscv32-unknown-elf-size, riscv32-unknown-elf-strings, riscv32-unknown-elf-strip, riscv32-unknown-linux-gnu-addr2line, riscv32-unknown-linux-gnu-ar, riscv32-unknown-linux-gnu-as, riscv32-unknown-linux-gnu-c++, riscv32-unknown-linux-gnu-c++filt, riscv32-unknown-linux-gnu-cpp, riscv32-unknown-linux-gnu-elfedit, riscv32-unknown-linux-gnu-g++, riscv32-unknown-linux-gnu-gcc, riscv32-unknown-linux-gnu-gcc-11.1.0, riscv32-unknown-linux-gnu-gcc-ar, riscv32-unknown-linux-gnu-gcc-nm, riscv32-unknown-linux-gnu-gcc-ranlib, riscv32-unknown-linux-gnu-gcov, riscv32-unknown-linux-gnu-gcov-dump, riscv32-unknown-linux-gnu-gcov-tool, riscv32-unknown-linux-gnu-gdb, riscv32-unknown-linux-gnu-gdb-add-index, riscv32-unknown-linux-gnu-gfortran, riscv32-unknown-linux-gnu-gprof, riscv32-unknown-linux-gnu-ld, riscv32-unknown-linux-gnu-ld.bfd, riscv32-unknown-linux-gnu-lto-dump, riscv32-unknown-linux-gnu-nm, riscv32-unknown-linux-gnu-objcopy, riscv32-unknown-linux-gnu-objdump, riscv32-unknown-linux-gnu-ranlib, riscv32-unknown-linux-gnu-readelf, riscv32-unknown-linux-gnu-run, riscv32-unknown-linux-gnu-size, riscv32-unknown-linux-gnu-strings, riscv32-unknown-linux-gnu-strip, riscv64-unknown-elf-addr2line, riscv64-unknown-elf-ar, riscv64-unknown-elf-as, riscv64-unknown-elf-c++, riscv64-unknown-elf-c++filt, riscv64-unknown-elf-cpp, riscv64-unknown-elf-elfedit, riscv64-unknown-elf-g++, riscv64-unknown-elf-gcc, riscv64-unknown-elf-gcc-11.1.0, riscv64-unknown-elf-gcc-ar, riscv64-unknown-elf-gcc-nm, riscv64-unknown-elf-gcc-ranlib, riscv64-unknown-elf-gcov, riscv64-unknown-elf-gcov-dump, riscv64-unknown-elf-gcov-tool, riscv64-unknown-elf-gdb, riscv64-unknown-elf-gdb-add-index, riscv64-unknown-elf-gprof, riscv64-unknown-elf-ld, riscv64-unknown-elf-ld.bfd, riscv64-unknown-elf-lto-dump, riscv64-unknown-elf-nm, riscv64-unknown-elf-objcopy, riscv64-unknown-elf-objdump, riscv64-unknown-elf-ranlib, riscv64-unknown-elf-readelf, riscv64-unknown-elf-run, riscv64-unknown-elf-size, riscv64-unknown-elf-strings, riscv64-unknown-elf-strip, riscv64-unknown-linux-gnu-addr2line, riscv64-unknown-linux-gnu-ar, riscv64-unknown-linux-gnu-as, riscv64-unknown-linux-gnu-c++, riscv64-unknown-linux-gnu-c++filt, riscv64-unknown-linux-gnu-cpp, riscv64-unknown-linux-gnu-elfedit, riscv64-unknown-linux-gnu-g++, riscv64-unknown-linux-gnu-gcc, riscv64-unknown-linux-gnu-gcc-11.1.0, riscv64-unknown-linux-gnu-gcc-ar, riscv64-unknown-linux-gnu-gcc-nm, riscv64-unknown-linux-gnu-gcc-ranlib, riscv64-unknown-linux-gnu-gcov, riscv64-unknown-linux-gnu-gcov-dump, riscv64-unknown-linux-gnu-gcov-tool, riscv64-unknown-linux-gnu-gdb, riscv64-unknown-linux-gnu-gdb-add-index, riscv64-unknown-linux-gnu-gfortran, riscv64-unknown-linux-gnu-gprof, riscv64-unknown-linux-gnu-ld, riscv64-unknown-linux-gnu-ld.bfd, riscv64-unknown-linux-gnu-lto-dump, riscv64-unknown-linux-gnu-nm, riscv64-unknown-linux-gnu-objcopy, riscv64-unknown-linux-gnu-objdump, riscv64-unknown-linux-gnu-ranlib, riscv64-unknown-linux-gnu-readelf, riscv64-unknown-linux-gnu-run, riscv64-unknown-linux-gnu-size, riscv64-unknown-linux-gnu-strings, riscv64-unknown-linux-gnu-strip
Submitter: sickcodes
Maintainer: sickcodes
Last Packager: sickcodes
Votes: 0
Popularity: 0.000000
First Submitted: 2021-09-22 01:23 (UTC)
Last Updated: 2022-04-01 22:08 (UTC)

Latest Comments

supergarfield commented on 2022-04-08 02:10 (UTC)

Yeah, same problem as @maleadt. I changed the PKGBUILD as follows and it looks like it fixed the issue:

(Some changes like checksums are not actually necessary, of course)

diff --git a/PKGBUILD b/PKGBUILD
index 504a44b..633333f 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -18,7 +18,8 @@ provides=(${pkgname}
 )
 depends=()
 optdepends=()
-makedepends=(curl python3 libmpc mpfr gmp texinfo gperf libtool patchutils bc zlib expat)
+makedepends=()
+options=(!strip)
 source=(
   "https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/${pkgver}/riscv32-elf-${_pkg_prefix}-${pkgver}-nightly.tar.gz"
   "https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/${pkgver}/riscv32-glibc-${_pkg_prefix}-${pkgver}-nightly.tar.gz"
@@ -26,42 +27,23 @@ source=(
   "https://github.com/riscv-collab/riscv-gnu-toolchain/releases/download/${pkgver}/riscv64-glibc-${_pkg_prefix}-${pkgver}-nightly.tar.gz"
 )
 # skipping shasums due to size
-sha256sums=(
-  'SKIP'
-  'SKIP'
-  'SKIP'
-  'SKIP'
-)
+sha256sums=('adef8ca8c24b237e9c2090b508fc44c0202f86362eb4f4dfe9698e4603973b66'
+            '3de9818ccc9d15d20a3e305b2409274a407320f8ec83cb4f79750845d90d2b3b'
+            '14d3415e671283b2f1de493ade1b69807a72242b237dca35b5b23a8e20c7e8ac'
+            '1654499b4bf014fc3e54a96512dd0174bd02ffd30fd4e5bb04518a7a21965bb0')

 package() {
-  
-  rm -rf "${srcdir}"/riscv/sysroot
-  rm -rf "${srcdir}"/riscv/riscv64-unknown-linux-gnu
-  rm -rf "${srcdir}"/riscv/riscv32-unknown-linux-gnu
-  rm -rf "${srcdir}"/riscv/riscv64-unknown-elf
-  rm -rf "${srcdir}"/riscv/riscv32-unknown-elf
-
-  install -dm755 ${pkgdir}/usr/libexec
-  install -dm755 ${pkgdir}/usr/share
-  install -dm755 ${pkgdir}/usr/bin
-  install -dm755 ${pkgdir}/usr/lib
+  install -dm755 "${pkgdir}"/usr/

-  cp -pvr "${srcdir}"/riscv/libexec/* "${pkgdir}"/usr/libexec/
-  cp -pvr "${srcdir}"/riscv/share/* "${pkgdir}"/usr/share/
-  cp -pvr "${srcdir}"/riscv/bin/* "${pkgdir}"/usr/bin/
-  cp -pvr "${srcdir}"/riscv/lib/* "${pkgdir}"/usr/lib/
+  cp -pr "${srcdir}"/riscv/* "${pkgdir}"/usr/

-  # strip host binaries
-  find "${pkgdir}"/usr/bin/ "${pkgdir}"/usr/lib/gcc/ -type f -and \( -executable \) -exec strip '{}' \;
-
-  # Remove existing conflicts
+  # Remove existing conflicts with gcc and other packages
+  rm -rf "${pkgdir}"/usr/include/gdb/jit-reader.h
   rm -rf "${pkgdir}"/usr/share/man/man7
   rm -rf "${pkgdir}"/usr/lib/libcc1.so*
   rm -rf "${pkgdir}"/usr/lib/bfd-plugins/libdep.so
-  rm -rf "${pkgdir}"/usr/share/gcc-11.1.0/python/libstdcxx
   rm -rf "${pkgdir}"/usr/share/gdb/python/gdb
   rm -rf "${pkgdir}"/usr/share/gdb/syscalls
   rm -rf "${pkgdir}"/usr/share/gdb/system-gdbinit
   rm -rf "${pkgdir}"/usr/share/info
-
 }

maleadt commented on 2021-12-04 21:53 (UTC)

How do you use the RISCV toolchain as packaged here? GCC seems confused by everything existing in /usr/bin and falls back to the host as which obviously does not work:

$ riscv64-unknown-elf-gcc dummy.c -march=rv32im -mabi=ilp32  -v
[...]
 as -v --traditional-format -march=rv32im -march=rv32im -mabi=ilp32 -o /tmp/cckCT3Al.o /tmp/ccOBmH6G.s
GNU assembler version 2.36.1 (x86_64-pc-linux-gnu) using BFD version (GNU Binutils) 2.36.1
Assembler messages:
Fatal error: invalid -march= option: `rv32im'

Extracting the upstream binaries in their own folder (e.g. /opt/riscv-gnu-toolchain) does result in a working compiler.