aboutsummaryrefslogtreecommitdiff
path: root/depends
diff options
context:
space:
mode:
authorfanquake <fanquake@gmail.com>2023-12-07 09:56:49 +0000
committerfanquake <fanquake@gmail.com>2023-12-07 10:00:47 +0000
commitdce1dfbc47050404bcf3ce2461e8baff0b088ffb (patch)
tree24d452dd0dc251f85250f0e94f63afe2bca21db2 /depends
parent2e8ec6b338a825a7155fff1be83993e3834ab655 (diff)
parent8ea45e626e5a0482ee11d4376f961d8126ce7c7b (diff)
Merge bitcoin/bitcoin#28622: build: use macOS 14 SDK (Xcode 15.0)
8ea45e626e5a0482ee11d4376f961d8126ce7c7b build: use macOS 14 SDK (Xcode 15.0) (fanquake) 51c97ffb6989a4cf56ad966d360a9fa0426e174c build: patch boost process for macOS 14 SDK (fanquake) 423949a13b39a193dff8b2758d23d6691d11dbc3 depends: add -platform_version to macOS build flags (fanquake) Pull request description: This fixes: https://github.com/bitcoin/bitcoin/pull/28349#issuecomment-1748515277 (cross-compiling with C++20 for macOS). See https://developer.apple.com/xcode/cpp/#c++20 for C++20 support in Apples libc++, some features landed with Xcode 14.3, although many more landed with Xcode 15.0. ACKs for top commit: hebasto: ACK 8ea45e626e5a0482ee11d4376f961d8126ce7c7b. TheCharlatan: ACK 8ea45e626e5a0482ee11d4376f961d8126ce7c7b Tree-SHA512: 274ce2c9b9f8e4d755c07b8d0d4897a7f92708ac64e6afb7a3f75bdb485e863fc7f40badf3a88b129ce36f6cca72f768dc2ed7fba2bdf0bb6da2bf0c8fedee10
Diffstat (limited to 'depends')
-rw-r--r--depends/hosts/darwin.mk11
-rw-r--r--depends/packages/boost.mk5
-rw-r--r--depends/patches/boost/process_macos_sdk.patch27
3 files changed, 40 insertions, 3 deletions
diff --git a/depends/hosts/darwin.mk b/depends/hosts/darwin.mk
index ecd45540cf..a89c82e408 100644
--- a/depends/hosts/darwin.mk
+++ b/depends/hosts/darwin.mk
@@ -1,7 +1,7 @@
OSX_MIN_VERSION=11.0
-OSX_SDK_VERSION=11.0
-XCODE_VERSION=12.2
-XCODE_BUILD_ID=12B45b
+OSX_SDK_VERSION=14.0
+XCODE_VERSION=15.0
+XCODE_BUILD_ID=15A240d
LD64_VERSION=711
OSX_SDK=$(SDK_PATH)/Xcode-$(XCODE_VERSION)-$(XCODE_BUILD_ID)-extracted-SDK-with-libcxx-headers
@@ -71,6 +71,10 @@ $(foreach TOOL,$(cctools_TOOLS),$(eval darwin_$(TOOL) = $$(build_prefix)/bin/$$(
#
# Adds the desired paths from the SDK
#
+# -platform_version
+#
+# Indicate to the linker the platform, the oldest supported version,
+# and the SDK used.
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
-u OBJC_INCLUDE_PATH -u OBJCPLUS_INCLUDE_PATH -u CPATH \
@@ -91,6 +95,7 @@ darwin_CXX=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
darwin_CFLAGS=-pipe -std=$(C_STANDARD)
darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
+darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION)
ifneq ($(LTO),)
darwin_CFLAGS += -flto
diff --git a/depends/packages/boost.mk b/depends/packages/boost.mk
index ebc097d686..ab43764b38 100644
--- a/depends/packages/boost.mk
+++ b/depends/packages/boost.mk
@@ -3,6 +3,11 @@ $(package)_version=1.81.0
$(package)_download_path=https://boostorg.jfrog.io/artifactory/main/release/$($(package)_version)/source/
$(package)_file_name=boost_$(subst .,_,$($(package)_version)).tar.bz2
$(package)_sha256_hash=71feeed900fbccca04a3b4f2f84a7c217186f28a940ed8b7ed4725986baf99fa
+$(package)_patches=process_macos_sdk.patch
+
+define $(package)_preprocess_cmds
+ patch -p1 < $($(package)_patch_dir)/process_macos_sdk.patch
+endef
define $(package)_stage_cmds
mkdir -p $($(package)_staging_prefix_dir)/include && \
diff --git a/depends/patches/boost/process_macos_sdk.patch b/depends/patches/boost/process_macos_sdk.patch
new file mode 100644
index 0000000000..ebc556d972
--- /dev/null
+++ b/depends/patches/boost/process_macos_sdk.patch
@@ -0,0 +1,27 @@
+Fix Boost Process compilation with macOS 14 SDK.
+Can be dropped with Boost 1.84.0.
+https://github.com/boostorg/process/pull/343.
+https://github.com/boostorg/process/issues/342.
+
+diff --git a/boost/process/detail/posix/handles.hpp b/boost/process/detail/posix/handles.hpp
+index cd9e1ce5a..304e77b1c 100644
+--- a/boost/process/detail/posix/handles.hpp
++++ b/boost/process/detail/posix/handles.hpp
+@@ -33,7 +33,7 @@ inline std::vector<native_handle_type> get_handles(std::error_code & ec)
+ else
+ ec.clear();
+
+- auto my_fd = ::dirfd(dir.get());
++ auto my_fd = dirfd(dir.get());
+
+ struct ::dirent * ent_p;
+
+@@ -117,7 +117,7 @@ struct limit_handles_ : handler_base_ext
+ return;
+ }
+
+- auto my_fd = ::dirfd(dir);
++ auto my_fd = dirfd(dir);
+ struct ::dirent * ent_p;
+
+ while ((ent_p = readdir(dir)) != nullptr)