Skip to content

Commit 4870f89

Browse files
committed
Update doc and config to NDK 26c
1 parent 17412cd commit 4870f89

File tree

4 files changed

+15
-15
lines changed

4 files changed

+15
-15
lines changed

README.md

+9-9
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ emulator](https://github.com/finagolfin/swift-android-sdk/blob/main/.github/work
1010
The CI now builds with both the latest LTS NDK 26 and the last LTS NDK 25c. Now
1111
that Swift 5.9 supports [the new experimental SDK bundle
1212
format](https://github.com/apple/swift-evolution/blob/main/proposals/0387-cross-compilation-destinations.md),
13-
I plan to distribute an Android SDK bundle for NDK 26 sometime this month.
13+
I plan to distribute an Android SDK bundle for NDK 26 at some point.
1414

1515
If you cannot build against NDK 26 and the Swift 5.9.2 SDK because of the newly
1616
added nullability annotations, use the previous NDK 25c and Swift 5.9 SDK instead,
@@ -20,9 +20,9 @@ compiler with the older Swift 5.9 SDK).
2020
## Cross-compiling and testing Swift packages with the Android SDK
2121

2222
To build with the Swift 5.9.2 SDK, first download [the latest Android LTS NDK
23-
26b](https://developer.android.com/ndk/downloads) and [Swift 5.9.2
23+
26c](https://developer.android.com/ndk/downloads) and [Swift 5.9.2
2424
compiler](https://swift.org/download/#releases) (make sure to install the Swift
25-
compiler's dependencies listed there). Unpack these archives and the SDK.
25+
compiler's dependencies linked there). Unpack these archives and the SDK.
2626

2727
Change the symbolic link at `swift-5.9.2-android-24-sdk/usr/lib/swift/clang`
2828
to point to the clang headers that come with your swift compiler, eg
@@ -35,8 +35,8 @@ swift-5.9.2-android-24-sdk/usr/lib/swift/clang
3535
Next, modify the cross-compilation JSON file `android-aarch64.json` in this repo
3636
similarly:
3737

38-
1. All paths to the NDK should change from `/home/finagolfin/android-ndk-r26b`
39-
to the path to your NDK, `/home/yourname/android-ndk-r26b`.
38+
1. All paths to the NDK should change from `/home/finagolfin/android-ndk-r26c`
39+
to the path to your NDK, `/home/yourname/android-ndk-r26c`.
4040

4141
2. The path to the compiler should change from `/home/finagolfin/swift-5.9.2-RELEASE-ubuntu22.04`
4242
to the path to your Swift compiler, `/home/yourname/swift-5.9.2-RELEASE-ubi9`.
@@ -146,11 +146,11 @@ dependencies and include them yourself.
146146

147147
## Building the Android SDKs from source
148148

149-
Download the Swift 5.9.2 compiler and Android NDK 26b as above. Check out this
149+
Download the Swift 5.9.2 compiler and Android NDK 26c as above. Check out this
150150
repo and run
151151
`SWIFT_TAG=swift-5.9.2-RELEASE ANDROID_ARCH=aarch64 swift get-packages-and-swift-source.swift`
152152
to get some prebuilt Android libraries and the Swift source to build the SDK. If
153-
you pass in a different tag like `swift-DEVELOPMENT-SNAPSHOT-2024-01-08-a`
153+
you pass in a different tag like `swift-DEVELOPMENT-SNAPSHOT-2024-02-29-a`
154154
for the latest Swift trunk snapshot and pass in the path to the corresponding
155155
prebuilt Swift toolchain to `build-script` below, you can build a Swift trunk
156156
SDK too, as seen on the CI.
@@ -168,7 +168,7 @@ are installed, run the following `build-script` command with your local paths
168168
substituted instead:
169169
```
170170
./swift/utils/build-script -RA --skip-build-cmark --build-llvm=0 --android
171-
--android-ndk /home/finagolfin/android-ndk-r26b/ --android-arch aarch64 --android-api-level 24
171+
--android-ndk /home/finagolfin/android-ndk-r26c/ --android-arch aarch64 --android-api-level 24
172172
--build-swift-tools=0 --native-swift-tools-path=/home/finagolfin/swift-5.9.2-RELEASE-ubuntu22.04/usr/bin/
173173
--native-clang-tools-path=/home/finagolfin/swift-5.9.2-RELEASE-ubuntu22.04/usr/bin/
174174
--host-cc=/usr/bin/clang-13 --host-cxx=/usr/bin/clang++-13
@@ -188,7 +188,7 @@ Finally, copy `libc++_shared.so` from the NDK and modify the cross-compiled
188188
`libdispatch.so` and Swift corelibs to include `$ORIGIN` and other relative
189189
directories in their rpaths:
190190
```
191-
cp /home/yourname/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so swift-release-android-aarch64-24-sdk/usr/lib
191+
cp /home/yourname/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/sysroot/usr/lib/aarch64-linux-android/libc++_shared.so swift-release-android-aarch64-24-sdk/usr/lib
192192
patchelf --set-rpath \$ORIGIN/../..:\$ORIGIN swift-release-android-aarch64-24-sdk/usr/lib/swift/android/lib*.so
193193
```
194194

android-aarch64.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"version": 1,
33
"target": "aarch64-unknown-linux-android24",
44
"toolchain-bin-dir": "/home/finagolfin/swift-5.9.2-RELEASE-ubuntu22.04/usr/bin",
5-
"sdk": "/home/finagolfin/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot",
5+
"sdk": "/home/finagolfin/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/sysroot",
66
"extra-cc-flags": [
77
"-fPIC"
88
],
99
"extra-swiftc-flags": [
1010
"-resource-dir", "/home/finagolfin/swift-5.9.2-android-24-sdk/usr/lib/swift",
11-
"-tools-directory", "/home/finagolfin/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin",
11+
"-tools-directory", "/home/finagolfin/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin",
1212
"-L", "/home/finagolfin/swift-5.9.2-android-24-sdk/usr/lib/aarch64-linux-android",
1313
],
1414
"extra-cpp-flags": [

android-armv7.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"version": 1,
33
"target": "armv7-unknown-linux-androideabi24",
44
"toolchain-bin-dir": "/home/finagolfin/swift-5.9.2-RELEASE-ubuntu22.04/usr/bin",
5-
"sdk": "/home/finagolfin/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot",
5+
"sdk": "/home/finagolfin/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/sysroot",
66
"extra-cc-flags": [
77
"-fPIC"
88
],
99
"extra-swiftc-flags": [
1010
"-resource-dir", "/home/finagolfin/swift-5.9.2-android-24-sdk/usr/lib/swift",
11-
"-tools-directory", "/home/finagolfin/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin",
11+
"-tools-directory", "/home/finagolfin/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin",
1212
"-L", "/home/finagolfin/swift-5.9.2-android-24-sdk/usr/lib/arm-linux-androideabi",
1313
],
1414
"extra-cpp-flags": [

android-x86_64.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
"version": 1,
33
"target": "x86_64-unknown-linux-android24",
44
"toolchain-bin-dir": "/home/finagolfin/swift-5.9.2-RELEASE-ubuntu22.04/usr/bin",
5-
"sdk": "/home/finagolfin/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/sysroot",
5+
"sdk": "/home/finagolfin/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/sysroot",
66
"extra-cc-flags": [
77
"-fPIC"
88
],
99
"extra-swiftc-flags": [
1010
"-resource-dir", "/home/finagolfin/swift-5.9.2-android-24-sdk/usr/lib/swift",
11-
"-tools-directory", "/home/finagolfin/android-ndk-r26b/toolchains/llvm/prebuilt/linux-x86_64/bin",
11+
"-tools-directory", "/home/finagolfin/android-ndk-r26c/toolchains/llvm/prebuilt/linux-x86_64/bin",
1212
"-L", "/home/finagolfin/swift-5.9.2-android-24-sdk/usr/lib/x86_64-linux-android",
1313
],
1414
"extra-cpp-flags": [

0 commit comments

Comments
 (0)