https://gcc.gnu.org/bugzilla/show_bug.cgi?id=87690
--- Comment #3 from Jim Wilson <wilson at gcc dot gnu.org> ---
As far as I know, combined tree builds for RISC-V have never worked. When
using a combined tree build, configure makes assumptions about gas/ld features
instead of doing run-time gas/ld checks. Because of our reliance on link time
optimization to reduce code size, we can't support some uses of
.uleb128/.sleb128 that expect code label differences to resolve to a constant,
since this is not a constant at assembly time for RISC-V. The result is that
the combined tree build gas/ld feature assumptions are wrong, and the build
fails. I haven't tried to fix this as combined tree builds are obsolete and
not recommended practice anymore.
I have been using the github riscv/riscv-gnu-toolchain for cross builds. I use
git remote add to add in the FSF git trees I want. You can do something like
this
git remote add upstream git://gcc.gnu.org/git/gcc.git
git fetch upstream
git checkout -b upstream-trunk --track upstream/trunk
You can do the same thing with binutils using
git://sourceware.org/git/binutils-gdb.git and master instead of trunk.
Another option is to use crosstool-NG.