Page MenuHomeFreeBSD

Allow bootstrapping localdef on non-FreeBSD systems
Needs ReviewPublic

Authored by arichardson on Thu, Jun 11, 10:24 AM.



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

Lint OK
No Unit Test Coverage
Build Status
Buildable 32060
Build 29585: arc lint + arc unit

Event Timeline

arichardson requested review of this revision.Thu, Jun 11, 10:24 AM
arichardson created this revision.

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

yuripv accepted this revision.Thu, Jun 18, 4:04 PM

I think this looks good.

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

New approach that avoids modifying public headers

This revision now requires review to proceed.Tue, Jun 30, 11:38 AM
arichardson edited the summary of this revision. (Show Details)Tue, Jun 30, 11:40 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?


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.

arichardson added inline comments.Tue, Jun 30, 1:10 PM

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