riscv-tools
riscv-tools copied to clipboard
Error building binutils in riscv-gnu-toolchain target with GCC 7.2.0 and 4.9.4
When building with either GCC version 7.2.0 or 4.9.4, both of which satisfy the requirement of GCC >= 4.8 for C++11 dependencies, I am met with a cascade of build-time errors. Most notably:
/home/user/riscv/riscv-tools/riscv-gnu-toolchain/riscv-binutils-gdb/gdb/guile/scm-ports.c:146:10:` error: ‘scm_new_port_table_entry’ was not declared in this scope
and
/home/user/riscv/riscv-tools/riscv-gnu-toolchain/riscv-binutils-gdb/gdb/guile/scm-ports.c:231:20: error: ‘SCM_PTAB_ENTRY’ was not declared in this scope
Host OS: Arch Linux 4.13.7 GCC: 7.2.0 Error Log: builderror_720.log
GCC: 4.9.4 Error Log: builderror_494.log
From what I gather online, this seems to have been an issue since upstream guile deprecated structures used by gdb.
https://sourceware.org/bugzilla/show_bug.cgi?id=21104 https://github.com/crosstool-ng/crosstool-ng/issues/799 http://archive.linuxfromscratch.org/mail-archives/blfs-dev/2017-March/033056.html https://github.com/crosstool-ng/crosstool-ng/issues/718
The suggested fix is to include --without-guile
or --with-guile=no
in GDB's configure scripts. My system has guile 2.2.2 installed, which explains the inability to find the missing types. It is likely that installing an earlier version of Guile would also remedy the situation.
This issue is more appropriately listed over at riscv-binutils-gdb
and, as such, should likely be closed. However, a temporary fix from this repo can be had by changing this line to:
build_project riscv-gnu-toolchain --prefix=$RISCV --without-guile