[release] Use threaded compression with xz
[llvm-project.git] / bolt / utils / docker / Dockerfile
blob722a07e46f9e430506a501056a89f32240b3fde0
1 FROM ubuntu:20.04 AS builder
3 ARG DEBIAN_FRONTEND=noninteractive
4 ENV TZ=UTC
6 RUN apt-get update && \
7     apt-get install -y --no-install-recommends ca-certificates git \
8       build-essential cmake ninja-build python3 libjemalloc-dev \
9       python3-psutil && \
10     rm -rf /var/lib/apt/lists
12 WORKDIR /home/bolt
14 RUN git clone --depth 1 https://github.com/llvm/llvm-project
16 RUN mkdir build && \
17     cd build && \
18     cmake -G Ninja ../llvm-project/llvm \
19       -DLLVM_ENABLE_PROJECTS="bolt;clang;lld" \
20       -DLLVM_TARGETS_TO_BUILD="X86;AArch64" \
21       -DCMAKE_BUILD_TYPE=Release \
22       -DLLVM_ENABLE_ASSERTIONS=ON \
23       -DCMAKE_EXE_LINKER_FLAGS="-Wl,--push-state -Wl,-whole-archive -ljemalloc_pic -Wl,--pop-state -lpthread -lstdc++ -lm -ldl" \
24       -DCMAKE_INSTALL_PREFIX=/home/bolt/install && \
25     ninja check-bolt && \
26     ninja install-llvm-bolt install-perf2bolt install-merge-fdata \
27       install-llvm-boltdiff install-bolt_rt
29 FROM ubuntu:20.04
31 COPY --from=builder /home/bolt/install /usr/local