Page MenuHomeFreeBSD

makefs: Fix build on FreeBSD to handle birthtimes and other things
Needs ReviewPublic

Authored by jhb on Thu, Jun 25, 3:43 PM.

Details

Reviewers
emaste
jrtc27
Summary

When building on FreeBSD, nbtool_config.h is not provided, so all of
the various HAVE_* default to off except for HAVE_STRUCT_STAT_ST_FLAGS
which is enabled in both the Makefile and in makefs.h.

The setting in the Makefile is overriden by nbtool_config.h when
cross-building, but that is non-obvious. Instead, follow the example
from commit c49043eacb14c951b0675eb4d37b81d4b02b949f and flesh out the
rest of the relevant nbtool_config.h settings in makefs.h.

Diff Detail

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

Event Timeline

jhb requested review of this revision.Thu, Jun 25, 3:43 PM

I'm not sure which way of fixing this is correct. Note that mtree is similarly broken when built on FreeBSD AFAICT as nothing defines HAVE_STRUCT_STAT_ST_FLAGS to 1 when building that tool natively on FreeBSD. We could fix this by instead adding these settings to the Makefile instead as was done for st_flags in the initial import of makefs (and then we could also do that for mtree's Makefile). In that case, we should maybe drop the explicit HAVE_ from makefs.h?

Note to self: Rebase D54585 after this has landed.

@jlduran oof, I should have looked at your prior review more closely when you mentioned it earlier. The other things I added here don't really matter as fstatvfs() is only used if f_iosize is present, I was just going for completeness based on grep'ing for all the HAVE_* used in makefs.