Page MenuHomeFreeBSD

Enable building tar for non-FreeBSD host
ClosedPublic

Authored by sjg on Apr 22 2023, 10:31 PM.
Tags
None
Referenced Files
F102803700: D39766.diff
Sun, Nov 17, 9:41 AM
Unknown Object (File)
Wed, Nov 6, 12:46 AM
Unknown Object (File)
Wed, Nov 6, 12:46 AM
Unknown Object (File)
Wed, Nov 6, 12:46 AM
Unknown Object (File)
Wed, Nov 6, 12:46 AM
Unknown Object (File)
Wed, Nov 6, 12:46 AM
Unknown Object (File)
Wed, Nov 6, 12:46 AM
Unknown Object (File)
Wed, Nov 6, 12:46 AM

Details

Summary

For DIRDEPS_BUILD we need Makefile.depend.options to
force libegacy to be built on older FreeBSD and non-FreeBSD hosts.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 51133
Build 48024: arc lint + arc unit

Event Timeline

sjg requested review of this revision.Apr 22 2023, 10:31 PM
sjg created this revision.

Out of interest do you know if macOS needs any changes to the config file? I could believe not given it's closer to the BSDs than Linux.

tools/build/Makefile
171

macOS has this; is there an issue with using FreeBSD's instead? Also how does this actually link? AFAICT libegacy won't have readpassphrase.c?

tools/build/Makefile
171

libbsd provides readpassphrase, which is presumably intended to be compatible, but using -I/usr/include/bsd opens a whole new can of worms.
So this is the simplest solution.

As for mac I expect it should "just work" but not sure if I can test.

tools/build/Makefile
171

Oh... it shouldn't be using libbsd, libegacy is supposed to contain everything needed when cross-building, rather than mixing in-tree things and whatever libbsd's doing.

arichardson added inline comments.
usr.bin/tar/Makefile
39

If I recall correctly I ran into some behaviour differences when using libbsd for the bootstrap tools, so I decided against using it. Since we already have -legacy we can hopefully just add the readpassphrase source to that?

tools/build/Makefile
171

libegacy does not currently provide readpassphrase
so that should be added?
AFAIK that's the only thing missing

usr.bin/tar/Makefile
39

That would be fine by me

tools/build/Makefile
171

Yes, we've added things to libegacy as needed for cross-building, it basically functions as a libbsd for cross-building

Add readpassphrase to libegacy to avoid libbsd

tools/build/Makefile
227

Just put this in tools/build/includes.h and add that to INCS?

Get _PATH_TTY from paths.h

tools/build/Makefile
227

If/when something outside of libegacy needs it
But I could add an includes.h if preferred

Add includes.h to include/linux

sjg marked an inline comment as done.Apr 23 2023, 3:52 AM
sjg added inline comments.
tools/build/Makefile
227

Actually -I${.CURDIR} doesn't work we get tools/build/fcntl.h which doesn't work
I put it in cross-build/include/linux

usr.bin/tar/Makefile
38

This breaks building the tests for world on !FreeBSD

usr.bin/tar/Makefile
38

And whatever the right fix for this is should likely be done elsewhere by whacking MK_TESTS globally?

Do not block target tests of tar when building on non-FreeBSD

Disable MK_TESTS in src.opts.mk when appropriate

share/mk/src.opts.mk
365 ↗(On Diff #120944)

Ugggg... Please add TESTS to the BROKEN list instead.

Use BROKEN_OPTIONS for TESTS

Looks good. Thanks for the ping.

This revision is now accepted and ready to land.Apr 24 2023, 5:19 PM
This revision was automatically updated to reflect the committed changes.