Skip to content

Commit 6f72c69

Browse files
committed
Use Clang from the NDK, user no longer needs to symlink ld, push libc++
1 parent 01e1637 commit 6f72c69

File tree

4 files changed

+13
-2
lines changed

4 files changed

+13
-2
lines changed
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
#!/bin/sh
2+
exec arm-linux-androideabi-ld.bfd $@

release/bin/swift-android-push

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ for i in $mydir/../lib/swift/android/*.so
55
do
66
adb push $i /data/local/tmp
77
done
8+
adb push $ANDROID_NDK_HOME/sources/cxx-stl/llvm-libc++/libs/armeabi-v7a/libc++_shared.so /data/local/tmp
89
adb push $1 /data/local/tmp
910
adb shell chmod 755 /data/local/tmp/$1

release/bin/swiftc-android

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/bash
22
mypath=`which $0`
33
mydir=`dirname $mypath`
4-
which armv7-none-linux-androideabi-ld >/dev/null || echo "you didn't symlink arm-linux-androideabi-ld.bfd; please check the README"
4+
if [ -z $ANDROID_NDK_HOME ]
5+
then
6+
echo "ANDROID_NDK_HOME not set: run \"export ANDROID_NDK_HOME=/path/to/ndk\""
7+
exit 1
8+
fi
9+
clangpath=$ANDROID_NDK_HOME/toolchains/llvm-3.6/prebuilt/linux-x86_64/bin
10+
gccpath=$ANDROID_NDK_HOME/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin
11+
export PATH=$clangpath:$gccpath:$PATH:`pwd`
512
$mydir/swiftc -target armv7-none-linux-androideabi -Xlinker --allow-shlib-undefined $@

release/deploy.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,13 @@ do
99
echo $i
1010
strip -o bin/$i ../bin/$i
1111
done
12-
for i in swift-autolink-extract swiftc swiftc-android swift-android-push
12+
for i in swift-autolink-extract swiftc swiftc-android swift-android-push armv7-none-linux-androideabi-ld
1313
do
1414
cp -P ../bin/$i bin/$i
1515
done
1616
mkdir lib
1717
cp -r ../lib/swift lib/
18+
[ -a lib/swift/android/libicuuc.so ] || echo "WHERE IS ICU"
1819
cd ..
1920
rm swift_android.tar.xz
2021
tar cJf swift_android.tar.xz swiftandroid

0 commit comments

Comments
 (0)