https://gcc.gnu.org/bugzilla/show_bug.cgi?id=90440
--- Comment #2 from Jonathan Wakely <redi at gcc dot gnu.org> --- The libstdc++ config should select one of these headers to use: ./config/cpu/i486/opt/ext/opt_random.h ./config/cpu/aarch64/opt/ext/opt_random.h ./config/cpu/generic/opt/ext/opt_random.h There should be an "ext" dir containing a symlink to the chosen file, which will be found by -I/export/home/jullien/gcc-8.3.0/obj/sparc-sun-solaris2.10/libstdc++-v3/include/sparc-sun-solaris2.10 It's possible that for --enable-obsolete this isn't set up correctly (although I think solaris2.10 is only obsolete for gcc-9 not gcc-8).