File tree Expand file tree Collapse file tree 21 files changed +463
-200
lines changed Expand file tree Collapse file tree 21 files changed +463
-200
lines changed Original file line number Diff line number Diff line change @@ -51,6 +51,12 @@ matrix:
51
51
- os : linux
52
52
env : TARGET=arm-linux-androideabi
53
53
rust : stable
54
+ - os : linux
55
+ env : TARGET=aarch64-linux-android
56
+ rust : stable
57
+ - os : linux
58
+ env : TARGET=i686-linux-android
59
+ rust : stable
54
60
- os : linux
55
61
env : TARGET=x86_64-unknown-linux-musl
56
62
rust : stable
File renamed without changes.
Original file line number Diff line number Diff line change @@ -13,9 +13,24 @@ set -ex
13
13
14
14
curl -O https://dl.google.com/android/repository/android-ndk-r13b-linux-x86_64.zip
15
15
unzip -q android-ndk-r13b-linux-x86_64.zip
16
+
17
+ case " $1 " in
18
+ aarch64)
19
+ arch=arm64
20
+ ;;
21
+
22
+ i686)
23
+ arch=x86
24
+ ;;
25
+
26
+ * )
27
+ arch=$1
28
+ ;;
29
+ esac ;
30
+
16
31
android-ndk-r13b/build/tools/make_standalone_toolchain.py \
17
- --install-dir /android/ndk-arm \
18
- --arch arm \
32
+ --install-dir /android/ndk-$1 \
33
+ --arch $arch \
19
34
--api 24
20
35
21
36
rm -rf ./android-ndk-r13b-linux-x86_64.zip ./android-ndk-r13b
Original file line number Diff line number Diff line change @@ -19,15 +19,35 @@ set -ex
19
19
# which apparently magically accepts the licenses.
20
20
21
21
mkdir sdk
22
- curl https://dl.google.com/android/android-sdk_r24.4.1 -linux.tgz | \
23
- tar xzf - -C sdk --strip-components=1
22
+ curl https://dl.google.com/android/repository/tools_r25.2.5 -linux.zip -O
23
+ unzip -d sdk tools_r25.2.5-linux.zip
24
24
25
- filter=" platform-tools,android-21"
26
- filter=" $filter ,sys-img-armeabi-v7a-android-21"
25
+ filter=" platform-tools,android-24"
27
26
28
- ./accept-licenses.sh " android - update sdk -a --no-ui --filter $filter "
27
+ case " $1 " in
28
+ arm | armv7)
29
+ abi=armeabi-v7a
30
+ ;;
31
+
32
+ aarch64)
33
+ abi=arm64-v8a
34
+ ;;
35
+
36
+ i686)
37
+ abi=x86
38
+ ;;
39
+
40
+ * )
41
+ echo " invalid arch: $1 "
42
+ exit 1
43
+ ;;
44
+ esac ;
45
+
46
+ filter=" $filter ,sys-img-$abi -android-24"
47
+
48
+ ./android-accept-licenses.sh " android - update sdk -a --no-ui --filter $filter "
29
49
30
50
echo " no" | android create avd \
31
- --name arm-21 \
32
- --target android-21 \
33
- --abi armeabi-v7a
51
+ --name $1 \
52
+ --target android-24 \
53
+ --abi $abi
Original file line number Diff line number Diff line change
1
+ FROM ubuntu:16.04
2
+
3
+ RUN dpkg --add-architecture i386 && \
4
+ apt-get update && \
5
+ apt-get install -y --no-install-recommends \
6
+ file \
7
+ curl \
8
+ ca-certificates \
9
+ python \
10
+ unzip \
11
+ expect \
12
+ openjdk-9-jre \
13
+ libstdc++6:i386 \
14
+ libpulse0 \
15
+ gcc \
16
+ libc6-dev
17
+
18
+ WORKDIR /android/
19
+ COPY android* /android/
20
+
21
+ ENV ANDROID_ARCH=aarch64
22
+ ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
23
+
24
+ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
25
+ RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
26
+ RUN mv /root/.android /tmp
27
+ RUN chmod 777 -R /tmp/.android
28
+ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
29
+
30
+ ENV PATH=$PATH:/rust/bin \
31
+ CARGO_TARGET_AARCH64_LINUX_ANDROID_LINKER=aarch64-linux-android-gcc \
32
+ HOME=/tmp
Original file line number Diff line number Diff line change @@ -11,24 +11,22 @@ RUN dpkg --add-architecture i386 && \
11
11
expect \
12
12
openjdk-9-jre \
13
13
libstdc++6:i386 \
14
+ libpulse0 \
14
15
gcc \
15
16
libc6-dev
16
17
17
18
WORKDIR /android/
19
+ COPY android* /android/
18
20
19
- COPY install-ndk.sh /android/
20
- RUN sh /android/install- ndk.sh
21
+ ENV ANDROID_ARCH=arm
22
+ ENV PATH=$PATH: /android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
21
23
22
- ENV PATH=$PATH:/android/ndk-arm/bin:/android/sdk/tools:/android/sdk/platform-tools
23
-
24
- COPY install-sdk.sh accept-licenses.sh /android/
25
- RUN sh /android/install-sdk.sh
24
+ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
25
+ RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
26
+ RUN mv /root/.android /tmp
27
+ RUN chmod 777 -R /tmp/.android
28
+ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
26
29
27
30
ENV PATH=$PATH:/rust/bin \
28
31
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
29
- ANDROID_EMULATOR_FORCE_32BIT=1 \
30
32
HOME=/tmp
31
- RUN chmod 755 /android/sdk/tools/*
32
-
33
- RUN cp -r /root/.android /tmp
34
- RUN chmod 777 -R /tmp/.android
Original file line number Diff line number Diff line change
1
+ FROM ubuntu:16.04
2
+
3
+ RUN dpkg --add-architecture i386 && \
4
+ apt-get update && \
5
+ apt-get install -y --no-install-recommends \
6
+ file \
7
+ curl \
8
+ ca-certificates \
9
+ python \
10
+ unzip \
11
+ expect \
12
+ openjdk-9-jre \
13
+ libstdc++6:i386 \
14
+ libpulse0 \
15
+ gcc \
16
+ libc6-dev
17
+
18
+ WORKDIR /android/
19
+ COPY android* /android/
20
+
21
+ ENV ANDROID_ARCH=i686
22
+ ENV PATH=$PATH:/android/ndk-$ANDROID_ARCH/bin:/android/sdk/tools:/android/sdk/platform-tools
23
+
24
+ RUN sh /android/android-install-ndk.sh $ANDROID_ARCH
25
+ RUN sh /android/android-install-sdk.sh $ANDROID_ARCH
26
+ RUN mv /root/.android /tmp
27
+ RUN chmod 777 -R /tmp/.android
28
+ RUN chmod 755 /android/sdk/tools/* /android/sdk/tools/qemu/linux-x86_64/*
29
+
30
+ ENV PATH=$PATH:/rust/bin \
31
+ CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \
32
+ HOME=/tmp
Original file line number Diff line number Diff line change 5
5
6
6
run () {
7
7
echo $1
8
- docker build -t libc ci/docker/$1
8
+ # use -f so we can use ci/ as build context
9
+ docker build -t libc -f ci/docker/$1 /Dockerfile ci/
9
10
mkdir -p target
10
11
docker run \
11
12
--user ` id -u` :` id -g` \
Original file line number Diff line number Diff line change @@ -105,11 +105,16 @@ case "$TARGET" in
105
105
esac
106
106
107
107
case " $TARGET " in
108
- arm-linux-androideabi)
109
- emulator @arm-21 -no-window &
108
+ arm-linux-androideabi | aarch64-linux-android | i686-linux-android)
109
+ # set SHELL so android can detect a 64bits system, see
110
+ # http://stackoverflow.com/a/41789144
111
+ # https://issues.jenkins-ci.org/browse/JENKINS-26930?focusedCommentId=230791&page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#comment-230791
112
+ export SHELL=/bin/dash
113
+ arch=$( echo $TARGET | cut -d- -f1)
114
+ emulator @$arch -no-window -no-accel &
110
115
adb wait-for-device
111
- adb push $CARGO_TARGET_DIR /$TARGET /debug/libc-test /data/libc-test
112
- adb shell /data/libc-test 2>&1 | tee /tmp/out
116
+ adb push $CARGO_TARGET_DIR /$TARGET /debug/libc-test /data/local/tmp/ libc-test
117
+ adb shell /data/local/tmp/ libc-test 2>&1 | tee /tmp/out
113
118
grep " ^PASSED .* tests" /tmp/out
114
119
;;
115
120
Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ use std::env;
6
6
7
7
fn main ( ) {
8
8
let target = env:: var ( "TARGET" ) . unwrap ( ) ;
9
+ let aarch64 = target. contains ( "aarch64" ) ;
9
10
let x86_64 = target. contains ( "x86_64" ) ;
10
11
let windows = target. contains ( "windows" ) ;
11
12
let mingw = target. contains ( "windows-gnu" ) ;
@@ -105,8 +106,12 @@ fn main() {
105
106
}
106
107
107
108
if android {
109
+ if !aarch64 {
110
+ // time64_t is not define for aarch64
111
+ // If included it will generate the error 'Your time_t is already 64-bit'
112
+ cfg. header ( "time64.h" ) ;
113
+ }
108
114
cfg. header ( "arpa/inet.h" ) ;
109
- cfg. header ( "time64.h" ) ;
110
115
cfg. header ( "xlocale.h" ) ;
111
116
cfg. header ( "utmp.h" ) ;
112
117
} else if !windows {
You can’t perform that action at this time.
0 commit comments