Created attachment 542834 [details] dev-util:ninja-1.8.2-r1:20180809-091057.log ./src/disk_interface.cc: In member function ‘virtual TimeStamp RealDiskInterface::Stat(const string&, std::__cxx11::string*) const’: ./src/disk_interface.cc:216:51: error: ‘struct stat’ has no member named ‘st_mtimensec’; did you mean ‘st_mtim’? return (int64_t)st.st_mtime * 1000000000LL + st.st_mtimensec; ^~~~~~~~~~~~ st_mtim
Created attachment 542836 [details] e-info.txt
I looked into this since someone on IRC ran into this on musl. The sourcecode used FTMs as a conditional for its own code. That is total bullock of course - FTMs are to be set by the source and used by sys-headers to determine the interface to use. Upstream really needs to fix the source - snippet: #if defined(__APPLE__) && !defined(_POSIX_C_SOURCE) return ((int64_t)st.st_mtimespec.tv_sec * 1000000000LL + st.st_mtimespec.tv_nsec); #elif (_POSIX_C_SOURCE >= 200809L || _XOPEN_SOURCE >= 700 || defined(_BSD_SOURCE) || defined(_SVID_SOURCE) || \ defined(__BIONIC__) || (defined (__SVR4) && defined (__sun))) _POSIX_C_SOURCE, _XOPEN_SOURCE and _BSD_SOURCE are FTMs and may not be used this way. And since ninja uses C++ _GNU_SOURCE FTM is defined unconditionally by the compiler anyway, so the assumptions made regarding these FTMs are wrong anyway.
Upstream bug is https://github.com/ninja-build/ninja/issues/1510 Apparently this is only tied to musl, not to freebsd, as a matrix user reported the same issue on Musl-Linux-amd64.
This bug appears not only under fbsd but also Linux. It's still present in 1.8.2-r2 and most likely tied to musl as already mentioned.
Created attachment 567708 [details, diff] ninja-1.8.2-r2 upstream patch Fully tested on musl setup
(In reply to Jory A. Pratt from comment #5) I'm waiting for upstream to actually merge something.
(In reply to Mike Gilbert from comment #6) > (In reply to Jory A. Pratt from comment #5) > > I'm waiting for upstream to actually merge something. That's going to be a one-in-a-lifetime event indeed.
A link to a pull request upstream would suffice.
The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=b6ab66e96f36dd162edf26463d9fa93c2f3f131e commit b6ab66e96f36dd162edf26463d9fa93c2f3f131e Author: Mike Gilbert <floppym@gentoo.org> AuthorDate: 2019-04-03 19:49:49 +0000 Commit: Mike Gilbert <floppym@gentoo.org> CommitDate: 2019-04-03 19:49:49 +0000 dev-util/ninja: fix build on bsd/musl Closes: https://bugs.gentoo.org/663216 Package-Manager: Portage-2.3.62_p4, Repoman-2.3.12_p87 Signed-off-by: Mike Gilbert <floppym@gentoo.org> dev-util/ninja/files/ninja-1.9.0-musl.patch | 39 +++++++++++++++++++++++++++++ dev-util/ninja/ninja-1.9.0.ebuild | 6 ++++- dev-util/ninja/ninja-9999.ebuild | 2 +- 3 files changed, 45 insertions(+), 2 deletions(-)