What I did was change the file ‘riscv-gnu-toolchain/riscv-binutils-gdb/gdb/configure’ so that on the lines:
# Check whether --with-guile was given.
if test "${with_guile+set}" = set; then :
withval=$with_guile;
else
with_guile=auto
fi
the line
with_guile=auto
became
with_guile=no
Another way to do it, and it’s probably what gdb should do, is to change
try_guile_versions="guile-2.2 guile-2.0"
to just
try_guile_versions="guile-2.0"