https://gcc.gnu.org/bugzilla/show_bug.cgi?id=93532
--- Comment #20 from Jim Wilson <wilson at gcc dot gnu.org> --- Thanks for confirming that it solves the buildroot build problem. My gcc mainline g++ test failure turned out to be a thread related issue with qemu cross testing. The testcase works always on hardware, but fails maybe 10-20% of the time when run under qemu. RISC-V qemu is known to still have a few bugs in this area, though they might already be fixed in newer qemu versions than what I have.