Skip to content

Commit 9370dfa

Browse files
authored
Update to llvm 14 (#664)
* Build docker with llvm 14 * Add "Free disk space on runner" in publish base env * Change dwarf to 4 version
1 parent f366873 commit 9370dfa

32 files changed

+164
-706
lines changed

.github/workflows/matrix.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"include": [
33
{
4-
"DOCKER_TAG": "2023.10.0",
4+
"DOCKER_TAG": "2023.12.0",
55
"OPERATING_SYSTEM_TAG": "18.04",
6-
"LLVM_VERSION_MAJOR": "10"
6+
"LLVM_VERSION_MAJOR": "14"
77
}
88
]
99
}

.github/workflows/publish-base-env.yml

+11
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,17 @@ jobs:
3131
steps:
3232
- uses: actions/checkout@v3
3333

34+
- name: Free Disk Space (Ubuntu)
35+
uses: jlumbroso/free-disk-space@main
36+
with:
37+
tool-cache: true
38+
android: true
39+
dotnet: true
40+
haskell: true
41+
large-packages: true
42+
docker-images: true
43+
swap-storage: true
44+
3445
- name: Log in to the Container registry
3546
uses: docker/login-action@v2
3647
with:

docker/Dockerfile_base

+22-13
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,9 @@ RUN echo "check_certificate = off" > /etc/wgetrc
2323

2424
# We use C++ 17 for UnitTestBot, it is available in gcc-9; default gcc for ubuntu:18.04 is gcc-7
2525
RUN add-apt-repository ppa:ubuntu-toolchain-r/test
26-
RUN apt update && apt install -y --no-install-recommends gcc-9 g++-9
27-
# Skip 32bits libs installation before LLVM compilation
26+
RUN apt update && apt install -y --no-install-recommends gcc-9 g++-9 gcc-multilib g++-multilib gcc-9-multilib g++-9-multilib
27+
28+
# Set gcc-9 as default gcc version
2829
RUN sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-9 100
2930
RUN sudo update-alternatives --install /usr/bin/g++ g++ /usr/bin/g++-9 100
3031
RUN sudo update-alternatives --install /usr/bin/gcov gcov /usr/bin/gcov-9 100
@@ -69,29 +70,34 @@ WORKDIR /home/utbot
6970
USER root
7071
ARG LLVM_VERSION_MAJOR
7172
RUN mkdir $UTBOT_ALL/llvm_gold_plugin
72-
COPY building_dependencies/llvm_gold_plugin/plugin-api.h $UTBOT_ALL/llvm_gold_plugin
73+
RUN wget -P $UTBOT_ALL/llvm_gold_plugin https://raw.githubusercontent.com/bminor/binutils-gdb/fd67aa1129fd006ad49ed5ecb2b063705211553a/include/plugin-api.h
7374
RUN git clone --single-branch --branch "release/${LLVM_VERSION_MAJOR}.x" --depth 1 "https://github.com/llvm/llvm-project.git" $UTBOT_ALL/llvm-project
7475
WORKDIR $UTBOT_ALL/llvm-project
7576
RUN mkdir build && cd build \
7677
&& $UTBOT_CMAKE_BINARY \
77-
-DCMAKE_BUILD_TYPE=MinSizeRel \
78+
-DCMAKE_BUILD_TYPE=Release \
7879
-DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR \
7980
-DLLVM_INCLUDE_TESTS=OFF \
8081
-DLLVM_BINUTILS_INCDIR=$UTBOT_ALL/llvm_gold_plugin \
8182
-DLLVM_ENABLE_RTTI=ON \
8283
-DLLVM_ENABLE_EH=ON \
8384
-DLLVM_TARGETS_TO_BUILD="host" \
84-
-DLLVM_ENABLE_PROJECTS="clang;compiler-rt;libc;libclc;libcxx;libcxxabi;lld;lldb;clang-tools-extra" -G "Ninja" ../llvm \
85+
-DLLVM_INSTALL_UTILS=ON \
86+
-DLLVM_ENABLE_PROJECTS="clang;libclc;lld;lldb;clang-tools-extra" \
87+
-DLLVM_ENABLE_RUNTIMES="compiler-rt;libc;libcxx;libcxxabi" \
88+
-G "Ninja" ../llvm \
8589
&& $UTBOT_CMAKE_BINARY --build . --target install
8690

87-
8891
# Install KLEE dependencies
8992
ENV CURL_CA_BUNDLE=""
9093
RUN sudo -E pip3 install tabulate==0.8.7 \
9194
typing==3.7.4.3 \
9295
lit==0.11.0.post1 \
9396
wllvm==1.3.1
9497

98+
ENV CFLAGS="-gdwarf-4"
99+
ENV CXXFLAGS="-gdwarf-4"
100+
95101
WORKDIR $UTBOT_ALL/llvm-project
96102
RUN mkdir libcxx_build && cd libcxx_build \
97103
&& export CC=wllvm \
@@ -125,7 +131,7 @@ RUN cd $UTBOT_ALL/grpc && git submodule update --init
125131
RUN cd $UTBOT_ALL/grpc \
126132
&& mkdir -p cmake/build \
127133
&& cd cmake/build \
128-
&& $UTBOT_CMAKE_BINARY -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR ../.. \
134+
&& $UTBOT_CMAKE_BINARY -DgRPC_INSTALL=ON -DgRPC_BUILD_TESTS=OFF -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$UTBOT_INSTALL_DIR ../.. \
129135
&& make -j`nproc` \
130136
&& make install \
131137
&& cd $UTBOT_ALL \
@@ -205,13 +211,16 @@ RUN wget https://github.com/agauniyal/rang/releases/download/v3.1.0/rang.hpp -P
205211
COPY building_dependencies/runtime_env.sh /home/utbot/.bashrc
206212
COPY building_dependencies/runtime_env.sh /root/.bashrc
207213

208-
# Install uclibc
209-
RUN git clone -b klee_uclibc_v1.2 https://github.com/klee/klee-uclibc.git $UTBOT_ALL/klee-uclibc
210-
WORKDIR $UTBOT_ALL/klee-uclibc
211-
RUN ./configure --make-llvm-lib && make -j`nproc`
214+
# We need to install version 32 and 64 for klee.
215+
# Install uclibc-32
216+
RUN git clone -b klee_uclibc_v1.2 https://github.com/klee/klee-uclibc.git $UTBOT_ALL/klee-uclibc-32
217+
WORKDIR $UTBOT_ALL/klee-uclibc-32
218+
RUN ./configure --make-llvm-lib && make KLEE_CFLAGS="-m32" -j`nproc`
212219

213-
# Install 32bits libs AFTER LLVM compilation
214-
RUN apt update && apt install -y --no-install-recommends gcc-multilib g++-multilib gcc-9-multilib g++-9-multilib
220+
# Install uclibc-64
221+
RUN git clone -b klee_uclibc_v1.2 https://github.com/klee/klee-uclibc.git $UTBOT_ALL/klee-uclibc-64
222+
WORKDIR $UTBOT_ALL/klee-uclibc-64
223+
RUN ./configure --make-llvm-lib && make -j`nproc`
215224

216225
# Download library for access private members
217226
RUN git clone https://github.com/martong/access_private.git $UTBOT_ALL/access_private

docker/building_dependencies/clean_release.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# This script clears out all the unnecessary files from the release build
22

33
# Need just clang-10, llvm-cov, llvm-profdata and cmake in $UTBOT_INSTALL_DIR/bin
4-
cd $UTBOT_INSTALL_DIR/bin && find -type f \( -name "*" ! -name "llvm-cov" ! -name "llvm-profdata" ! -name "llvm-nm" ! -name "clang" ! -name "clang++" ! -name "clang-10" ! -name cmake \) -delete
4+
cd $UTBOT_INSTALL_DIR/bin && find -type f \( -name "*" ! -name "llvm-cov" ! -name "llvm-profdata" ! -name "llvm-nm" ! -name "clang" ! -name "clang++" ! -name "clang-14" ! -name cmake \) -delete
55

66
# Delete all broken links. Don't need to delete clang which is a link (not broken) to clang-10
77
find $UTBOT_INSTALL_DIR/bin/ -xtype l -delete

0 commit comments

Comments
 (0)