Page MenuHomePhabricator

depends: Add --sysroot option to mac os native compile flags
ClosedPublic

Authored by Fabien on Sep 22 2020, 15:58.

Details

Summary
Catalina SDK clang stopped automatically searching the SDK include paths
when invoked without --sysroot:

https://github.com/bitcoin/bitcoin/pull/16367#issuecomment-594600985
https://github.com/Homebrew/homebrew-core/issues/45061

This hasn't been a problem for current native depends packages because
are passing their own --sysroot values, and hasn't been a problem for
current host packages because they use `darwin_` commands instead of
`build_darwin_` commands.  But the current `build_darwin_CC` and
`build_darwin_CXX` commands are still unnecessarily fragile, and
incompatible with new native depends packages added in
https://github.com/bitcoin/bitcoin/pull/18677.

Cory Fields <cory-nospam-@coryfields.com> suggested in
https://github.com/bitcoin/bitcoin/pull/16367#issuecomment-595393546
switching compiler from SDK clang to native clang (from $PATH) to avoid
this problem. This is easy and makes a certain amount of sense for
building native packages, as opposed to host packages. But fanquake
<fanquake@gmail.com> pointed out in
https://github.com/bitcoin/bitcoin/pull/18677#discussion_r409934309 that
it would be inconsistent use switch to non-SDK compilers while still
using other SDK tools like ranlib and install_name_tool. So simplest,
minimal fix seems to be just adding the missing --sysroot option.

Backport of core PR18743.
Note that it doesn't fix any real life problem for now.

Test Plan

Run the OSX Gitian build.

Diff Detail

Event Timeline

Fabien requested review of this revision.Sep 22 2020, 15:58

[Bot Message]
One or more PR numbers were detected in the summary.
Links to those PRs have been inserted into the summary for reference.

This revision is now accepted and ready to land.Sep 22 2020, 16:03