https://gcc.gnu.org/bugzilla/show_bug.cgi?id=98910
Bug ID: 98910 Summary: [11 regression] locale_t undefined on Solaris Product: gcc Version: 11.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 Created attachment 50100 --> https://gcc.gnu.org/bugzilla/attachment.cgi?id=50100&action=edit Proposed patch. This patch commit 92dd3e71f957c7818f4ce4189bd187b59af20d9b Author: Iain Buclaw <ibuc...@gdcproject.org> Date: Thu Jan 28 11:18:42 2021 +0100 libphobos: Synchronize libdruntime bindings with upstream druntime broke Solaris bootstrap for two reasons: * locale_t isn't defined: /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/sys/posix/locale.d:67:10: error: undefined identifier 'locale_t' 67 | locale_t duplocale(locale_t locale); | ^ /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/sys/posix/locale.d:69:10: error: undefined identifier 'locale_t' 69 | void freelocale(locale_t locale); | ^ /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/sys/posix/locale.d:73:10: error: undefined identifier 'locale_t' 73 | locale_t newlocale(int mask, const char* locale, locale_t base); | ^ /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/sys/posix/locale.d:77:10: error: undefined identifier 'locale_t' 77 | locale_t uselocale (locale_t locale); | ^ /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/sys/posix/string.d:24:15: error: module core.sys.posix.locale import 'locale_t' not found 24 | public import core.sys.posix.locale : locale_t; | ^ While this can be fixed as in the attached patch, there's a caveat: locale_t and the functions using it are XPG7 additions, but Solaris 11.3 (which is still supported by GCC) only conforms to XPG6. I suspect it's not the only one. Right now, the effects aren't that bad as I've confirmed with an Solaris 11.3/x86 bootstrap since those functions/types are only declared, but not actually used. * there's an alias conflict for idtype_t: /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/thread/osthread.d:1468:12: error: alias core.thread.osthread.idtype_t conflicts with alias core.thread.osthread.idtype_t at /vol/gcc/src/hg/master/local/libphobos/libdruntime/core/thread/osthread.d:162:12 1468 | import core.sys.posix.sys.wait : idtype_t; | ^ also fixed by removing the second group of imports. The attached patch has been tested on both i386-pc-solaris2.11 (Solaris 11.4 and 11.3) and sparc-sun-solaris2.11 (Solaris 11.4).