-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathDockerfile.aarch64
76 lines (65 loc) · 3.03 KB
/
Dockerfile.aarch64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
FROM ubuntu:22.04
ENV DEBIAN_FRONTEND=noninteractive
ENV GCC_VERS=12
# Set the working directory to root (ie $HOME)
WORKDIR root
RUN apt-get update \
&& apt install -y --no-install-recommends \
cmake ninja-build llvm-dev clang lld libc++-dev \
libc++abi-dev zlib1g-dev git build-essential \
ca-certificates crossbuild-essential-arm64 \
libstdc++-$GCC_VERS-dev-arm64-cross qemu-user \
wget rsync curl
RUN cd \
&& mkdir -p sysroots/aarch64-linux-gnu/usr \
&& cd sysroots/aarch64-linux-gnu/usr \
&& cp -r -v -L /usr/aarch64-linux-gnu/include /usr/aarch64-linux-gnu/lib . \
&& cd lib \
&& cp -r -v -L /usr/lib/gcc-cross/aarch64-linux-gnu/$GCC_VERS/*gcc* . \
&& cp -r -v -L /usr/lib/gcc-cross/aarch64-linux-gnu/$GCC_VERS/*crt* . \
&& cp -r -v -L /usr/lib/gcc-cross/aarch64-linux-gnu/$GCC_VERS/libsupc++.a . \
&& cp -r -v -L /usr/lib/gcc-cross/aarch64-linux-gnu/$GCC_VERS/libstdc++* . \
&& cd ../../ \
&& mkdir tmp \
&& cd tmp \
&& export LIBEDIT_URL="http://ports.ubuntu.com/ubuntu-ports/pool/main/libe/libedit/" \
&& curl $LIBEDIT_URL 2>&1 | grep -oh "\"libedit-dev_3.1-2022.*arm64.deb\"" | sort -nr | head -n1 | xargs -I% wget $LIBEDIT_URL% \
&& dpkg-deb -R libedit-dev*arm64.deb . \
&& rm -rf usr/share libedit-dev*arm64.deb DEBIAN \
&& export LIBBSD_URL="http://ports.ubuntu.com/ubuntu-ports/pool/main/libb/libbsd/" \
&& curl $LIBBSD_URL 2>&1 | grep -oh "\"libbsd-dev.*arm64.deb\"" | sort -nr | head -n1 | xargs -I% wget $LIBBSD_URL% \
&& dpkg-deb -R libbsd-dev*arm64.deb . \
&& rm -rf usr/share libbsd-dev*arm64.deb DEBIAN \
&& export LIBTINFO_URL="http://ports.ubuntu.com/ubuntu-ports/pool/main/n/ncurses/" \
&& curl $LIBTINFO_URL 2>&1 | grep -oh "\"libncurses-dev.*arm64.deb\"" | sort -nr | head -n1 | xargs -I% wget $LIBTINFO_URL/% \
&& dpkg-deb -R libncurses-dev*arm64.deb . \
&& rm -rf usr/share libncurses-dev*arm64.deb DEBIAN \
&& rsync -av usr ../ \
&& cd .. \
&& rm -rf tmp \
# Clean up
&& apt-get autoremove -y \
&& apt-get clean -y \
&& rm -rf /var/lib/apt/lists/*
COPY test test
COPY fuzz fuzz
COPY CMakeLists.txt CMakeLists.txt
COPY scripts scripts
COPY cli-test-cases cli-test-cases
COPY src src
ENV TARGET_TRIPLE=aarch64-unknown-linux-gnu
RUN cmake -S . -B build \
-GNinja -DCMAKE_BUILD_TYPE=Release \
-DCMAKE_C_COMPILER=clang -DCMAKE_CXX_COMPILER=clang++ \
-DCMAKE_ASM_COMPILER=clang \
-DCMAKE_INSTALL_PREFIX=/ \
-DBuildTest=TRUE \
-DCMAKE_SYSROOT=$HOME/sysroots/aarch64-linux-gnu \
-DCMAKE_C_COMPILER_TARGET=$TARGET_TRIPLE \
-DCMAKE_CXX_COMPILER_TARGET=$TARGET_TRIPLE \
-DCMAKE_ASM_COMPILER_TARGET=$TARGET_TRIPLE \
-DCMAKE_EXE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_MODULE_LINKER_FLAGS_INIT="-fuse-ld=lld" \
-DCMAKE_SHARED_LINKER_FLAGS_INIT="-fuse-ld=lld"
RUN ninja -C./build
RUN qemu-aarch64 -L sysroots/aarch64-linux-gnu/usr/ build/test/WarfLang_TEST