https://gcc.gnu.org/bugzilla/show_bug.cgi?id=88238
--- Comment #8 from ro at CeBiTec dot Uni-Bielefeld.DE <ro at CeBiTec dot Uni-Bielefeld.DE> --- >> --- Comment #6 from Rainer Orth <ro at gcc dot gnu.org> --- >> The patch consists primarily of additions to >> DRUNTIME_LIBRARIES_DL_ITERATE_PHDR >> to detect the situation, the mapfile and libdruntime/Makefile.am code to >> create >> the helper lib. > > Is a helper library really needed? I think I'd prefer it to go in any > of the existing libraries already built instead of adding more things > to link in. This otherwise won't work with -static-libphobos, unfortunately: * The amd64 __tls_get_addr bug can only be avoided if the call to that function lives in a shared object (or a position independent executable, which Solaris 10 doesn't support), thus a helper lib is the only option. * Likewise for the missing sparcv9 dl_iterate_phdr: the mapfile directing that call to ld.so.1 has only effect inside a shared object. I know this is ugly as hell, but the Solaris linker engineer couldn't come up with any other option. It's clearly your call if this is acceptable for GCC 9 (the dl_iterate_phdr part which isn't necessary on mainline with Solaris 10 support removed) or both GCC 9 and 10 (the __tls_addr_part which also benefits Illumos even with Solaris 10 gone). I just wanted to turn this into a patch which shows that the workarounds are viable; if the resulting mess is really worth while is another matter...