Page MenuHomeFreeBSD

localedef: Fix bootstrapping on Ubuntu 16.04
ClosedPublic

Authored by jrtc27 on Jan 23 2021, 10:57 PM.
Tags
None
Referenced Files
Unknown Object (File)
Dec 21 2023, 3:16 PM
Unknown Object (File)
Dec 20 2023, 4:35 AM
Unknown Object (File)
Dec 14 2023, 8:18 PM
Unknown Object (File)
Dec 3 2023, 11:25 AM
Unknown Object (File)
Nov 1 2023, 9:13 AM
Unknown Object (File)
Aug 18 2023, 6:22 AM
Unknown Object (File)
Aug 16 2023, 8:28 AM
Unknown Object (File)
Aug 16 2023, 6:20 AM
Subscribers

Details

Summary

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.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Jan 23 2021, 11:39 PM

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.

This revision was automatically updated to reflect the committed changes.