Skip to content

Commit 1e94a2b

Browse files
committed
depends: Add --sysroot option to mac os native compile flags
Catalina SDK clang stopped automatically searching the SDK include paths when invoked without --sysroot: bitcoin#16367 (comment) Homebrew/homebrew-core#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 bitcoin#18677. Cory Fields <[email protected]> suggested in bitcoin#16367 (comment) 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 <[email protected]> pointed out in bitcoin#18677 (comment) 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.
1 parent 5dcb061 commit 1e94a2b

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

depends/builders/darwin.mk

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
build_darwin_CC:=$(shell xcrun -f clang)
2-
build_darwin_CXX:=$(shell xcrun -f clang++)
1+
build_darwin_CC:=$(shell xcrun -f clang) --sysroot $(shell xcrun --show-sdk-path)
2+
build_darwin_CXX:=$(shell xcrun -f clang++) --sysroot $(shell xcrun --show-sdk-path)
33
build_darwin_AR:=$(shell xcrun -f ar)
44
build_darwin_RANLIB:=$(shell xcrun -f ranlib)
55
build_darwin_STRIP:=$(shell xcrun -f strip)

0 commit comments

Comments
 (0)