Glibc's stdlib.h defines various prototypes for GNU extensions that take
a locale_t. Newer versions use locale_t directly and include an internal
bits/types/locale_t.h in order to get its definition, but older versions
include xlocale.h for that, for which our bootstrap version is empty.
Moreover it expects to use the glibc-specific __locale_t type. Thus,
provide dummy definitions of both types in order to ensure the
prototypes don't give any errors, and guard against the header being
inadvertently included between the bootstrapping namespace.h and
un-namespace.h, where locale_t is #define'd.
Details
Details
Diff Detail
Diff Detail
- Repository
- rG FreeBSD src repository
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
I was able to compile this on a 12.2 system with -DBUILD_WITH_STRICT_TMPPATH -DBOOTSTRAP_ALL_TOOLS and the following patch applied:
diff --git a/usr.bin/localedef/bootstrap/xlocale.h b/usr.bin/localedef/bootstrap/xlocale.h index 05629a32f4e3..d4b8d75de55c 100644 --- a/usr.bin/localedef/bootstrap/xlocale.h +++ b/usr.bin/localedef/bootstrap/xlocale.h @@ -51,5 +51,6 @@ #error "Dummy xlocale.h included inside bootstrapping namespace context" #endif +#error "Linux only?" typedef struct __dummy_host_locale *__locale_t; typedef __locale_t locale_t;
So it seems like I did remember correctly that this only affects Linux bootstrap. Therefore this is unlikely to break anything important and should be fine to commit. CheriBSD CI is also happy so it seems like both Ubuntu 18.04 and 20.04 still work.