-
Notifications
You must be signed in to change notification settings - Fork 153
Expand file tree
/
Copy pathDockerfile
More file actions
64 lines (53 loc) · 2.1 KB
/
Copy pathDockerfile
File metadata and controls
64 lines (53 loc) · 2.1 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
FROM ubuntu:24.04
# Stop ubuntu-20 interactive options.
ENV DEBIAN_FRONTEND=noninteractive
ARG TARGETPLATFORM
# Stop script if any individual command fails.
RUN set -e
# Define LLVM version.
ENV llvm_version=21.1.0
# Define home directory
ENV HOME=/home/SVF-tools
# Define dependencies.
# Use the default python3-dev that ships with the Ubuntu base image (24.04
# ships python 3.12) instead of pulling python3.10-dev from a PPA — the
# Launchpad PPA infrastructure has been intermittently unreachable
# (HTTP 504 from add-apt-repository), and SVF itself does not pin a Python
# version, so the base-image python is sufficient.
ENV lib_deps="cmake g++ gcc git zlib1g-dev libncurses5-dev libtinfo6 build-essential libssl-dev libpcre2-dev zip libzstd-dev python3-dev libc6-dbg"
ENV build_deps="wget xz-utils git gdb tcl"
# Fetch dependencies.
RUN apt-get update --fix-missing
RUN apt-get install -y $build_deps $lib_deps
# Prevent GDB from waiting for Ubuntu's remote debuginfod service.
# Local debug symbols installed by packages such as libc6-dbg remain available.
RUN rm -f /etc/debuginfod/*.urls
# Fetch and build SVF source.
RUN echo "Downloading LLVM and building SVF to " ${HOME}
WORKDIR ${HOME}
RUN git clone "https://github.com/SVF-tools/SVF.git"
WORKDIR ${HOME}/SVF
RUN echo "Building SVF ..."
RUN bash ./build.sh debug
# Export SVF, llvm, z3 paths
ENV PATH=${HOME}/SVF/Debug-build/bin:$PATH
ENV PATH=${HOME}/SVF/llvm-$llvm_version.obj/bin:$PATH
ENV SVF_DIR=${HOME}/SVF
ENV LLVM_DIR=${HOME}/SVF/llvm-$llvm_version.obj
ENV Z3_DIR=${HOME}/SVF/z3.obj
RUN ln -s ${Z3_DIR}/bin/libz3.so ${Z3_DIR}/bin/libz3.so.4
# Fetch and build Software-Analysis-Studio
WORKDIR ${HOME}
RUN git clone "https://github.com/SVF-tools/Software-Analysis-Studio.git"
WORKDIR ${HOME}/Software-Analysis-Studio
RUN echo "Building Software-Analysis-Studio ..."
COPY .vscode/launch.json .vscode/launch.json
COPY .vscode/tasks.json .vscode/tasks.json
RUN cmake \
-DCMAKE_BUILD_TYPE=Debug \
-DSVF_DIR="${SVF_DIR}/Debug-build/lib/cmake/SVF" \
-DLLVM_DIR="${LLVM_DIR}/lib/cmake/llvm" \
-DZ3_DIR="${Z3_DIR}" \
.
RUN make -j8
CMD ["/bin/bash"]