Skip to content

Commit 7b0a1f2

Browse files
committed
merge bitcoin#28622: use macOS 14 SDK (Xcode 15.0)
continuation of 9e80893 from dash#6150
1 parent 02eb735 commit 7b0a1f2

File tree

8 files changed

+32
-38
lines changed

8 files changed

+32
-38
lines changed

.gitlab-ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -42,8 +42,8 @@ builder-image:
4242
image: $CI_REGISTRY_IMAGE:builder-$CI_COMMIT_REF_SLUG
4343
variables:
4444
SDK_URL: https://bitcoincore.org/depends-sources/sdks
45-
XCODE_VERSION: "12.2"
46-
XCODE_BUILD_ID: 12B45b
45+
XCODE_VERSION: "15.0"
46+
XCODE_BUILD_ID: 15A240d
4747
before_script:
4848
- echo HOST=$HOST
4949
- |

ci/test/00_setup_env_mac.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ export LC_ALL=C.UTF-8
99
export CONTAINER_NAME=ci_macos_cross
1010
export HOST=x86_64-apple-darwin
1111
export PACKAGES="cmake libz-dev python3-setuptools xorriso"
12-
export XCODE_VERSION=12.2
13-
export XCODE_BUILD_ID=12B45b
12+
export XCODE_VERSION=15.0
13+
export XCODE_BUILD_ID=15A240d
1414
export RUN_UNIT_TESTS=false
1515
export RUN_FUNCTIONAL_TESTS=false
1616
export GOAL="all deploy"

contrib/containers/guix/scripts/guix-start

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ if [[ ! -d "${WORKSPACE_PATH}" || ! "${WORKSPACE_PATH}" = /* || ! -f "${WORKSPAC
99
exit 1
1010
fi
1111

12-
XCODE_VERSION="12.2"
13-
XCODE_RELEASE="12B45b"
12+
XCODE_VERSION="15.0"
13+
XCODE_RELEASE="15A240d"
1414
XCODE_ARCHIVE="Xcode-${XCODE_VERSION}-${XCODE_RELEASE}-extracted-SDK-with-libcxx-headers"
1515
XCODE_SOURCE="${XCODE_SOURCE:-https://bitcoincore.org/depends-sources/sdks}"
1616

contrib/devtools/symbol-check.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -247,7 +247,7 @@ def check_MACHO_min_os(binary) -> bool:
247247
return False
248248

249249
def check_MACHO_sdk(binary) -> bool:
250-
if binary.build_version.sdk == [11, 0, 0]:
250+
if binary.build_version.sdk == [14, 0, 0]:
251251
return True
252252
return False
253253

contrib/guix/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,5 +59,5 @@ RUN mkdir base_cache sources SDKs
5959
WORKDIR /dash
6060

6161
RUN mkdir -p depends/SDKs && \
62-
curl -L https://bitcoincore.org/depends-sources/sdks/Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz | tar -xz -C depends/SDKs
62+
curl -L https://bitcoincore.org/depends-sources/sdks/Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz | tar -xz -C depends/SDKs
6363

contrib/macdeploy/README.md

Lines changed: 14 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -14,51 +14,45 @@ When complete, it will have produced `Dash-Qt.dmg`.
1414

1515
A free Apple Developer Account is required to proceed.
1616

17-
Our current macOS SDK
18-
(`Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz`)
19-
can be extracted from
20-
[Xcode_12.2.xip](https://download.developer.apple.com/Developer_Tools/Xcode_12.2/Xcode_12.2.xip).
17+
Our macOS SDK can be extracted from
18+
[Xcode_15.xip](https://download.developer.apple.com/Developer_Tools/Xcode_15/Xcode_15.xip).
2119

2220
Alternatively, after logging in to your account go to 'Downloads', then 'More'
23-
and search for [`Xcode_12.2`](https://developer.apple.com/download/all/?q=Xcode%2012.2).
21+
and search for [`Xcode 15`](https://developer.apple.com/download/all/?q=Xcode%2015).
2422

2523
An Apple ID and cookies enabled for the hostname are needed to download this.
2624

27-
The `sha256sum` of the downloaded XIP archive should be `28d352f8c14a43d9b8a082ac6338dc173cb153f964c6e8fb6ba389e5be528bd0`.
25+
The `sha256sum` of the downloaded XIP archive should be `4daaed2ef2253c9661779fa40bfff50655dc7ec45801aba5a39653e7bcdde48e`.
2826

29-
After Xcode version 7.x, Apple started shipping the `Xcode.app` in a `.xip`
30-
archive. This makes the SDK less-trivial to extract on non-macOS machines. One
31-
approach (tested on Debian Buster) is outlined below:
27+
To extract the `.xip` on Linux:
3228

3329
```bash
3430
# Install/clone tools needed for extracting Xcode.app
3531
apt install cpio
3632
git clone https://github.com/bitcoin-core/apple-sdk-tools.git
3733

38-
# Unpack Xcode_12.2.xip and place the resulting Xcode.app in your current
34+
# Unpack the .xip and place the resulting Xcode.app in your current
3935
# working directory
40-
python3 apple-sdk-tools/extract_xcode.py -f Xcode_12.2.xip | cpio -d -i
36+
python3 apple-sdk-tools/extract_xcode.py -f Xcode_15.xip | cpio -d -i
4137
```
4238

43-
On macOS the process is more straightforward:
39+
On macOS:
4440

4541
```bash
46-
xip -x Xcode_12.2.xip
42+
xip -x Xcode_15.xip
4743
```
4844

49-
### Step 2: Generating `Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz` from `Xcode.app`
45+
### Step 2: Generating the SDK tarball from `Xcode.app`
5046

51-
To generate `Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz`, run
52-
the script [`gen-sdk`](./gen-sdk) with the path to `Xcode.app` (extracted in the
53-
previous stage) as the first argument.
47+
To generate the SDK, run the script [`gen-sdk`](./gen-sdk) with the
48+
path to `Xcode.app` (extracted in the previous stage) as the first argument.
5449

5550
```bash
56-
# Generate a Xcode-12.2-12B45b-extracted-SDK-with-libcxx-headers.tar.gz from
57-
# the supplied Xcode.app
5851
./contrib/macdeploy/gen-sdk '/path/to/Xcode.app'
5952
```
6053

61-
The `sha256sum` of the generated TAR.GZ archive should be `df75d30ecafc429e905134333aeae56ac65fac67cb4182622398fd717df77619`.
54+
The generated archive should be: `Xcode-15.0-15A240d-extracted-SDK-with-libcxx-headers.tar.gz`.
55+
The `sha256sum` should be `c0c2e7bb92c1fee0c4e9f3a485e4530786732d6c6dd9e9f418c282aa6892f55d`.
6256

6357
## Deterministic macOS DMG Notes
6458

contrib/macdeploy/gen-sdk

Lines changed: 2 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -62,18 +62,15 @@ def run():
6262

6363
out_name = "Xcode-{xcode_version}-{xcode_build_id}-extracted-SDK-with-libcxx-headers".format(xcode_version=xcode_version, xcode_build_id=xcode_build_id)
6464

65-
xcode_libcxx_dir = xcode_app.joinpath("Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/include/c++/v1")
66-
assert xcode_libcxx_dir.is_dir()
67-
6865
if args.out_sdktgz:
6966
out_sdktgz_path = pathlib.Path(args.out_sdktgz_path)
7067
else:
7168
# Construct our own out_sdktgz if not specified on the command line
7269
out_sdktgz_path = pathlib.Path("./{}.tar.gz".format(out_name))
7370

7471
def tarfp_add_with_base_change(tarfp, dir_to_add, alt_base_dir):
75-
"""Add all files in dir_to_add to tarfp, but prepent MEMBERPREFIX to the file's
76-
name
72+
"""Add all files in dir_to_add to tarfp, but prepent alt_base_dir to the files'
73+
names
7774
7875
e.g. if the only file under /root/bazdir is /root/bazdir/qux, invoking:
7976
@@ -107,8 +104,6 @@ def run():
107104
with tarfile.open(mode="w", fileobj=gzf, format=tarfile.GNU_FORMAT) as tarfp:
108105
print("Adding MacOSX SDK {} files...".format(sdk_version))
109106
tarfp_add_with_base_change(tarfp, sdk_dir, out_name)
110-
print("Adding libc++ headers...")
111-
tarfp_add_with_base_change(tarfp, xcode_libcxx_dir, "{}/usr/include/c++/v1".format(out_name))
112107
print("Done! Find the resulting gzipped tarball at:")
113108
print(out_sdktgz_path.resolve())
114109

depends/hosts/darwin.mk

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
OSX_MIN_VERSION=11.0
2-
OSX_SDK_VERSION=11.0
3-
XCODE_VERSION=12.2
4-
XCODE_BUILD_ID=12B45b
2+
OSX_SDK_VERSION=14.0
3+
XCODE_VERSION=15.0
4+
XCODE_BUILD_ID=15A240d
55
LD64_VERSION=711
66

77
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/$$(
7171
#
7272
# Adds the desired paths from the SDK
7373
#
74+
# -platform_version
75+
#
76+
# Indicate to the linker the platform, the oldest supported version,
77+
# and the SDK used.
7478

7579
darwin_CC=env -u C_INCLUDE_PATH -u CPLUS_INCLUDE_PATH \
7680
-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 \
9195

9296
darwin_CFLAGS=-pipe -std=$(C_STANDARD)
9397
darwin_CXXFLAGS=-pipe -std=$(CXX_STANDARD)
98+
darwin_LDFLAGS=-Wl,-platform_version,macos,$(OSX_MIN_VERSION),$(OSX_SDK_VERSION)
9499

95100
ifneq ($(LTO),)
96101
darwin_CFLAGS += -flto

0 commit comments

Comments
 (0)