Skip to content

Commit 3c5aa92

Browse files
committed
Use prebuilt linkers
Signed-off-by: Yuki Okushi <[email protected]>
1 parent 98a97b3 commit 3c5aa92

File tree

4 files changed

+11
-39
lines changed

4 files changed

+11
-39
lines changed

ci/android-install-ndk.sh

Lines changed: 2 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -6,36 +6,7 @@ NDK=android-ndk-r21d
66
wget --tries=20 -q https://dl.google.com/android/repository/${NDK}-linux-x86_64.zip
77
unzip -q ${NDK}-linux-x86_64.zip
88

9-
case "$1" in
10-
arm)
11-
arch=arm
12-
api=28
13-
;;
14-
armv7)
15-
arch=arm
16-
api=28
17-
;;
18-
aarch64)
19-
arch=arm64
20-
api=28
21-
;;
22-
i686)
23-
arch=x86
24-
api=28
25-
;;
26-
x86_64)
27-
arch=x86_64
28-
api=28
29-
;;
30-
*)
31-
echo "invalid arch: $1"
32-
exit 1
33-
;;
34-
esac;
35-
36-
python3 ${NDK}/build/tools/make_standalone_toolchain.py \
37-
--install-dir "/android/ndk-${1}" \
38-
--arch "${arch}" \
39-
--api ${api}
9+
mkdir -p /android/ndk-${1}/bin
10+
mv ${NDK}/toolchains/llvm/prebuilt/linux-x86_64/bin/* /android/ndk-${1}/bin
4011

4112
rm -rf ./${NDK}-linux-x86_64.zip ./${NDK}

ci/docker/arm-linux-androideabi/Dockerfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,9 +28,9 @@ RUN chmod 777 -R /tmp/.android
2828
RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
2929

3030
ENV PATH=$PATH:/rust/bin \
31-
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=arm-linux-androideabi-gcc \
31+
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_LINKER=armv7a-linux-androideabi28-clang \
3232
CARGO_TARGET_ARM_LINUX_ANDROIDEABI_RUNNER=/tmp/runtest \
33-
CC_arm_linux_androideabi=arm-linux-androideabi-gcc \
33+
CC_arm_linux_androideabi=armv7a-linux-androideabi28-clang \
3434
HOME=/tmp
3535

3636
ADD runtest-android.rs /tmp/runtest.rs

ci/docker/i686-linux-android/Dockerfile

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ FROM ubuntu:22.04
22

33
RUN dpkg --add-architecture i386
44
RUN apt-get update
5-
RUN apt-get install -y --no-install-recommends libc6-dev gcc
5+
RUN apt-get install -y --no-install-recommends linux-libc-dev:i386 gcc
66
RUN apt-get install -y --no-install-recommends \
77
file \
88
wget \
@@ -12,7 +12,8 @@ RUN apt-get install -y --no-install-recommends \
1212
unzip \
1313
expect \
1414
openjdk-8-jre \
15-
libstdc++6:i386 \
15+
libstdc++-10-dev:i386 \
16+
libc++-dev:i386 \
1617
libpulse0
1718

1819
WORKDIR /android/
@@ -28,9 +29,9 @@ RUN chmod 777 -R /tmp/.android
2829
RUN chmod 755 /android/sdk/cmdline-tools/tools/* /android/sdk/emulator/qemu/linux-x86_64/*
2930

3031
ENV PATH=$PATH:/rust/bin \
31-
CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android-gcc \
32+
CARGO_TARGET_I686_LINUX_ANDROID_LINKER=i686-linux-android28-clang \
3233
CARGO_TARGET_I686_LINUX_ANDROID_RUNNER=/tmp/runtest \
33-
CC_i686_linux_android=i686-linux-android-gcc \
34+
CC_i686_linux_android=i686-linux-android28-clang \
3435
HOME=/tmp
3536

3637
ADD runtest-android.rs /tmp/runtest.rs

libc-test/src/cmsg.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
#include <sys/socket.h>
33

44
// Since the cmsg(3) macros are macros instead of functions, they aren't
5-
// available to FFI. libc must reimplement them, which is error-prone. This
5+
// available to FFI. libc must reimplement them, which is error-prone. This
66
// file provides FFI access to the actual macros so they can be tested against
7-
// the Rust reimplementations.
7+
// the Rust re-implementation.
88

99
struct cmsghdr *cmsg_firsthdr(struct msghdr *msgh) {
1010
return CMSG_FIRSTHDR(msgh);

0 commit comments

Comments
 (0)