1 FROM ubuntu:20.04 AS builder
3 ARG DEBIAN_FRONTEND=noninteractive
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 \
10 rm -rf /var/lib/apt/lists
14 RUN git clone --depth 1 https://github.com/llvm/llvm-project
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 && \
26 ninja install-llvm-bolt install-perf2bolt install-merge-fdata \
27 install-llvm-boltdiff install-bolt_rt
31 COPY --from=builder /home/bolt/install /usr/local