forked from swift-nav/libsbp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile.llvm_arm
50 lines (42 loc) · 1.85 KB
/
Dockerfile.llvm_arm
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
FROM balenalib/armv7hf-debian:stretch-build
RUN [ "cross-build-start" ]
ENV DEBIAN_FRONTEND=noninteractive
WORKDIR /work
RUN \
echo '>>> Setting up ARM build environment...' \
&& apt-get update \
&& apt-get install -y wget bzip2 build-essential python3 \
&& apt-get install -y build-essential tk-dev libncurses5-dev libncursesw5-dev \
libreadline6-dev libdb5.3-dev libgdbm-dev libsqlite3-dev \
libssl-dev libbz2-dev libexpat1-dev liblzma-dev zlib1g-dev \
libffi-dev cmake ccache binutils-dev ninja-build \
gperf gawk flex bison ncurses-dev m4 patchelf \
texinfo help2man libpthread-stubs0-dev libtinfo-dev \
libatlas-base-dev libsqlite3-dev tk-dev libgdbm-dev \
libc6-dev
ENV LLVM_BRANCH=release_70
ENV LLVM_URL=https://github.com/llvm-mirror/llvm.git
ENV CLANG_URL=https://github.com/llvm-mirror/clang.git
RUN \
echo '>>> Building LLVM 7.0...' \
&& git clone --depth=1 --single-branch -b ${LLVM_BRANCH} ${LLVM_URL} /tmp/llvm \
&& git clone --depth=1 --single-branch -b ${LLVM_BRANCH} ${CLANG_URL} /tmp/llvm/tools/clang \
&& mkdir -p /tmp/llvm/build \
&& cd /tmp/llvm/build \
&& cmake -G Ninja /tmp/llvm \
-DCMAKE_INSTALL_PREFIX=/usr/local \
-DLLVM_TARGETS_TO_BUILD=ARM \
-DCMAKE_BUILD_TYPE=Release \
-DLLVM_BINUTILS_INCDIR=/usr/include \
-DLLVM_INCLUDE_TESTS=OFF \
-DLLVM_ENABLE_TERMINFO=0 \
-DCMAKE_C_COMPILER=/usr/bin/cc \
-DCMAKE_CXX_COMPILER=/usr/bin/c++ \
-DCMAKE_ASM_COMPILER=/usr/bin/as \
-DCMAKE_CXX_FLAGS="-I/root/llvm/build/tools/clang/include -I/root/llvm/tools/clang/include -DENDIAN_LITTLE=1" \
&& ninja -v \
&& ninja install
RUN \
echo '>>> Cleaning up...' \
&& rm -rf /tmp/llvm
RUN [ "cross-build-end" ]