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
Unknown Object (File)
Sat, Oct 11, 5:11 AM
Unknown Object (File)
Sat, Oct 4, 5:43 PM
Unknown Object (File)
Sat, Oct 4, 4:29 PM
Unknown Object (File)
Wed, Sep 17, 4:17 AM
Unknown Object (File)
Sep 15 2025, 7:32 PM
Unknown Object (File)
Sep 14 2025, 5:18 PM
Unknown Object (File)
Sep 13 2025, 10:00 PM
Unknown Object (File)
Sep 12 2025, 5:31 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 63786
Build 60670: 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