Page MenuHomeFreeBSD

cross-build: Provide real fflagstostr/strtofflags on Linux
ClosedPublic

Authored by jrtc27 on Apr 29 2025, 7:39 PM.
Tags
None
Referenced Files
F126697379: D50080.diff
Fri, Aug 22, 6:35 PM
Unknown Object (File)
Mon, Aug 18, 1:18 AM
Unknown Object (File)
Sat, Aug 16, 3:14 AM
Unknown Object (File)
Thu, Aug 14, 8:47 PM
Unknown Object (File)
Fri, Aug 8, 7:52 PM
Unknown Object (File)
Wed, Jul 30, 1:23 AM
Unknown Object (File)
Tue, Jul 29, 8:29 AM
Unknown Object (File)
Thu, Jul 24, 5:02 PM
Subscribers

Details

Summary

These are used by mtree and makefs, so in order to be able to set schg
on /var/empty in METALOG and set schg on various files and directories
in the resulting disk images we need to have a real implementation
rather than always giving no flags.

Ideally mtree wouldn't rely on round-tripping the textual flags field
via the "native" flags encoding using these functions, and ideally
makefs wouldn't rely on the "native" flags encoding matching FreeBSD's,
but in practice macOS's schg is the same and we can pretend Linux has
the same.

This fixes Linux-produced disk images lacking schg on any files or
directories, and Linux-produced distribution tarballs lacking schg on
/var/empty (note though that they do set schg on files, as install
already preserves file flags on Linux).

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 63788
Build 60672: arc lint + arc unit

Event Timeline

tools/build/Makefile
216

in practice macOS's schg is the same and we can pretend Linux has
the same.

IMO it'd be good to have this information in the src as well, making it clear that we're conflating host and target flags but in practice it works.

Add comment about host vs target

This revision is now accepted and ready to land.Apr 29 2025, 8:38 PM