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

Repository
rS FreeBSD src repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

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
2351 ↗(On Diff #75566)

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
2351 ↗(On Diff #75566)

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
1348 ↗(On Diff #75566)

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

2251 ↗(On Diff #75566)

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
2251 ↗(On Diff #75566)

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.

2351 ↗(On Diff #75566)

slightly different version of this change committed as D26025/rS364123

brooks added inline comments.
Makefile.inc1
1310 ↗(On Diff #75710)

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

1360–1369 ↗(On Diff #75710)

Should probably indent all these lines.

This revision is now accepted and ready to land.Aug 13 2020, 10:17 PM