https://gcc.gnu.org/bugzilla/show_bug.cgi?id=103528
Bug ID: 103528 Summary: [12 regression] d21 doesn't build on Solaris Product: gcc Version: 12.0 Status: UNCONFIRMED Severity: normal Priority: P3 Component: d Assignee: ibuclaw at gdcproject dot org Reporter: ro at gcc dot gnu.org Target Milestone: --- Target: *-*-solaris2.11 The migration to the DMD-based D frontend badly broke Solaris bootstrap on both sparc and x86. I'm always using GCC 9.1.0 as bootstrap compiler. * Solaris 11.4/x86 configured to use /bin/as: stage 1 d21 fails to link: ld: fatal: library -lgphobos: not found No wonder, libphobos is disabled on Solaris/x86 when /bin/as is in use. * Solaris 11.4/x86 configured to use gas: libphobos doesn't build: /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/internal/gc/impl/conservative/gc.d:3169:47: error: undefined identifier 'SIG_BLOCK' 3169 | auto sigmask_rc = pthread_sigmask(SIG_BLOCK, &new_mask, &old_mask); | SIG_BLOCK is used unconditionally, but defined nowhere. It should be in libphobos/libdruntime/core/sys/posix/signal.d. I'm use a local patch (attached) to fix that. * Solaris 11.4/sparc configured to use /bin/as: cannot compile d21, always like: d21: error: cannot find source code for runtime library file 'object.d' d21: note: dmd might not be correctly installed. Run 'dmd -man' for installation instructions. d21: note: config file: not found import path[0] = /vol/gcc/src/hg/master/local/gcc/d For one, libphobos isn't enabled on Solaris/SPARC by default, so no include files are installed. On Solaris/x86, I default to a gas-based gcc, so includes are installed for the bootstrap compiler. Besides, the message about dmd -man is wrong/misleading for gdc. After that, I rebuilt gcc 9.1.0 with gas and --enable-libphobos to get an appropriate bootstrap compiler. However * Solaris 11.4/sparc configured to use gas: stage 1 d21 cannot even compile a trivial test program when configuring libphobos configure: error: can't compile D sources! make[2]: *** [Makefile:26643: configure-stage1-target-libphobos] Error 1 so the build stops. I'll report the details separately. I believe there are several issues here beyond the Solaris problems: * toplevel configure needs to make certain that the bootstrap gdc can compile *and link* some trivial D program. Letting the build proceed otherwise leads to confusing link errors as seen here. gnat can do away without such a test because there are no gnat without libgnat configurations (either you have a fully working GNAT or you have none), while the gdc without libphobos situation is quite common in GCC. * I suspect it's time to do away without disabling libphobos on Solaris with /bin/as. I've now successfully bootstrapped master on Solaris 11.3 and 11.4 with such a patch with both as and gas and the testresults are mostly the same. Certainly no build failures. * Likewise, it might be possible to declare Solaris/SPARC as sort of supported in libphobos. The test results are still worse than on Solaris/x86, but not fundamentally so.