Page MenuHomeFreeBSD

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

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



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 OK
No Unit Test Coverage
Build Status
Buildable 32844
Build 30253: 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.


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

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.


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


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

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.


slightly different version of this change committed as D26025/rS364123

brooks added inline comments.

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


Should probably indent all these lines.

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

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

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.
2086–2094 ↗(On Diff #76197)

Fixed in rS367636