Page MenuHomeFreeBSD

Add necessary Makefile.inc1 infrastructure for building on non-FreeBSD
ClosedPublic

Authored by arichardson on Aug 7 2020, 3:27 PM.

Details

Summary

The most awkward bit in this patch is the bootstrapping of m4:
We can't simply use the host version of m4 since that is not compatible
with the flags passed by lex (at least on macOS, possibly also on Linux).
Therefore we need to bootstrap m4, but lex needs m4 to build but m4 also
depends on lex (which needs m4 to generate any files). To work around this
cyclic dependency we can build a bootstrap version of m4 (with pre-generated
files) then use that to build the real m4.

This patch also changes the xz/unxz/dd tools to always use the host version
since the version in the source tree cannot easily be bootstrapped on macOS
or Linux.

Diff Detail

Lint
Lint OK
Unit
No Unit Test Coverage
Build Status
Buildable 32933
Build 30331: arc lint + arc unit

Event Timeline

arichardson created this revision.

This all looks basically sane, subject to my usual worries about it breaking native builds... :) I didn't see anything that would, though.

Makefile.inc1
2372

shouldn't nawk and awk be identical? There won't be a nawk

This revision is now accepted and ready to land.Aug 7 2020, 8:38 PM
Makefile.inc1
2372

Yes, awk installs a mask symlink (LINKS= ${BINDIR}/awk ${BINDIR}/nawk) so this works fine when awk is bootstrapped.

This change is not needed for cross builds, only for native builds with strict tmppath since otherwise the nawk symlink is missing. I can't split this into a separate commit if you'd like.

Makefile.inc1
1355

Since we're overriding PATH, should we show what we set it to in the diagnostic message?

2268

Is it intended that bin/dd is no longer in _basic_bootstrap_tools?

arichardson marked 3 inline comments as done.

I plan to commit this later this week together with the other crossbuild patches.

This revision now requires review to proceed.Aug 11 2020, 11:19 PM
Makefile.inc1
2268

dd is linked from the host in tools/build/Makefile so it should not be here since otherwise we would attempt to bootstrap it for cross-builds.
The build system no longer uses non-portable dd flags so using the host version is fine.

2372

slightly different version of this change committed as D26025/rS364123

brooks added inline comments.
Makefile.inc1
1310

It's weird that we have two styles of adding things to ITOOLS, but this doesn't make anything worse.

1360–1369

Should probably indent all these lines.

This revision is now accepted and ready to land.Aug 13 2020, 10:17 PM
head/Makefile.inc1
2086–2094 ↗(On Diff #76197)

_config_deps is unused now. It was updated though. Is it needed somewhere?

head/Makefile.inc1
2086–2094 ↗(On Diff #76197)

I thought I fixed that in a follow-up commit, but I may have only done it in CheriBSD. Will check tomorrow morning.

arichardson added inline comments.
head/Makefile.inc1
2086–2094 ↗(On Diff #76197)

Fixed in rS367636