Page MenuHomeFreeBSD

Allow bootstrapping localdef on non-FreeBSD systems
ClosedPublic

Authored by arichardson on Jun 11 2020, 10:24 AM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Nov 26, 9:49 AM
Unknown Object (File)
Mon, Nov 25, 8:18 PM
Unknown Object (File)
Nov 22 2024, 10:02 AM
Unknown Object (File)
Nov 18 2024, 4:31 PM
Unknown Object (File)
Nov 13 2024, 11:50 AM
Unknown Object (File)
Oct 16 2024, 12:55 AM
Unknown Object (File)
Oct 16 2024, 12:55 AM
Unknown Object (File)
Oct 13 2024, 7:36 PM
Subscribers
None

Details

Summary

The current localdef simply assumes that the locale headers on build system
are compatible with those on the target system which is not necessarily true.
It generally works on FreeBSD (as long as we don't change the locale headers),
but Linux and macOS provide completely different locale headers.

This change adds new bootstrap headers that namespace certain xlocale
structures defined or used by in the headers that localdef needs.
This is required since system headers *must* be able to include the "real"
locale headers for printf(), etc., but we also want to access the target
systems's internal locale structures.

Test Plan

compiles and we have been using a similar diff in CheriBSD for a long time.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

arichardson created this revision.

Not sure what arc did here with copied from. Those are new files not copies.

I think this looks good.

This revision is now accepted and ready to land.Jun 18 2020, 4:04 PM

New approach that avoids modifying public headers

This revision now requires review to proceed.Jun 30 2020, 11:38 AM
arichardson edited the test plan for this revision. (Show Details)
arichardson added reviewers: brooks, jhb.

avoid unncessary diff to makefile

collate.c looks like an independent bugfix you can just commit first?

usr.bin/localedef/collate.c
855 ↗(On Diff #73905)

could add the space after , here and below while you're changing it

approach seems reasonable to me

collate.c looks like an independent bugfix you can just commit first?

Sounds good. I'll commit those changes seprately from the cross-build changes.

usr.bin/localedef/bootstrap/namespace.h
40 ↗(On Diff #73905)

I will fix the names of these macros to use localedef_bootstrap before committing.

If no one objects I'll commit this patch later this week.

One small typo, but otherwise looks good.

usr.bin/localedef/bootstrap/bootstrap_xlocale_private.h
44 ↗(On Diff #73905)

s/th/the/

This revision is now accepted and ready to land.Jul 14 2020, 5:38 PM