0
|
1 BootStrap: docker
|
|
2 From: ubuntu:20.04
|
|
3
|
|
4 %post
|
|
5 apt-get update
|
|
6 apt-get upgrade -y
|
|
7 DEBIAN_FRONTEND=noninteractive \
|
|
8 apt-get install -y \
|
|
9 mercurial \
|
|
10 wget \
|
|
11 libssl-dev \
|
|
12 vim \
|
|
13 build-essential \
|
|
14 ninja-build \
|
|
15 clang \
|
|
16 cmake \
|
|
17 gcc-multilib \
|
|
18 g++-multilib
|
|
19 DEBIAN_FRONTEND=noninteractive \
|
|
20 apt-get install -y \
|
|
21 crossbuild-essential-armhf
|
|
22
|
|
23 # download arm-none-eabi
|
|
24 wget "https://developer.arm.com/-/media/Files/downloads/gnu-rm/10-2020q4/gcc-arm-none-eabi-10-2020-q4-major-x86_64-linux.tar.bz2?revision=ca0cbf9c-9de2-491c-ac48-898b5bbc0443&la=en&hash=68760A8AE66026BCF99F05AC017A6A50C6FD832A" -O /tmp/arm.tar.bz2 && \
|
|
25 tar -jxvf /tmp/arm.tar.bz2 -C /opt && \
|
|
26 mv /opt/gcc-arm-none-eabi-10-2020-q4-major /opt/tools
|
|
27
|
|
28 # install cbc_llvm
|
|
29 hg clone http://www.cr.ie.u-ryukyu.ac.jp/hg/CbC/CbC_llvm/
|
|
30 mkdir -p /usr/local/cbc_llvm
|
|
31 mkdir -p /CbC_llvm/builddir
|
|
32 cd /CbC_llvm/builddir
|
|
33 cmake -G Ninja -DCMAKE_BUILD_TYPE=Release -DLLVM_BUILD_DOCS=OFF -DLLVM_ENABLE_PROJECTS="clang;lld" \
|
|
34 -DCMAKE_INSTALL_PREFIX=/usr/local/cbc_llvm -DCMAKE_CROSSCOMPILING=True \
|
|
35 /CbC_llvm/llvm
|
|
36 ninja
|
|
37 ninja install
|
|
38
|
|
39 %environment
|
|
40 CC=/usr/local/cbc_llvm/bin/clang
|
|
41 CXX=/usr/local/cbc_llvm/bin/clang++
|
|
42 LLVM_DIR=CbC_llvm
|
|
43 export CC CXX LLVM_DIR
|
|
44 export PATH=/usr/local/cbc_llvm/bin:$PATH |