Skip to content

Commit f455b0c

Browse files
committed
Don't copy any libraries from the NDK: link the NDK's clang resource directory in the post-install script instead
1 parent f097b6d commit f455b0c

File tree

1 file changed

+3
-12
lines changed

1 file changed

+3
-12
lines changed

swift-ci/sdks/android/scripts/build.sh

Lines changed: 3 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -521,10 +521,6 @@ cat > $swift_res_root/SDKSettings.json <<EOF
521521
}
522522
EOF
523523

524-
# Copy necessary headers and libraries from the toolchain and NDK clang resource directories
525-
mkdir -p $swift_res_root/usr/lib/swift/clang/lib
526-
cp -r $host_toolchain/lib/clang/*/include $swift_res_root/usr/lib/swift/clang
527-
528524
for arch in $archs; do
529525
quiet_pushd ${sdk_staging}/${arch}/usr
530526
rm -rf bin lib/clang local
@@ -546,14 +542,6 @@ for arch in $archs; do
546542
mv lib/lib*.a lib/swift_static-$arch/android
547543

548544
ln -sv ../swift/clang lib/swift_static-$arch/clang
549-
550-
# copy the clang libraries that we need to build for each architecture
551-
aarch=${arch/armv7/arm}
552-
mkdir -p lib/swift/clang/lib/linux/${aarch}
553-
554-
# match clang version 21, 22, etc.
555-
cp -av ${ndk_installation}/lib/clang/[0-9]*/lib/linux/libclang_rt.builtins-${aarch}-android.a lib/swift/clang/lib/linux/
556-
cp -av ${ndk_installation}/lib/clang/[0-9]*/lib/linux/${aarch}/libunwind.a lib/swift/clang/lib/linux/${aarch}/
557545
quiet_popd
558546

559547
# now sync the massaged sdk_root into the swift_res_root
@@ -618,6 +606,9 @@ else
618606
cp -a ${ndk_prebuilt}/*/sysroot ${ndk_sysroot}
619607
fi
620608
609+
# link the NDK's clang resource directory
610+
ln -s ${ndk_prebuilt}/*/lib/clang/18 ${swift_resources}/usr/lib/swift/clang
611+
621612
# copy each architecture's swiftrt.o into the sysroot,
622613
# working around https://github.com/swiftlang/swift/pull/79621
623614
for folder in swift swift_static; do

0 commit comments

Comments
 (0)