-
Notifications
You must be signed in to change notification settings - Fork 47
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Removed SymCC submodule & added SymCC-RT submodule. * SymCC Runtime Integration * Option to change SymCC RT backend * Option to compile SymCC RT statically and dynamically * Update working distributions * Adapt Dockerfile and GitHub workflow. * Make it possible to build against all possible LLVM versions as a command line switch TODO: LLVM 18 is not currently working... --------- Co-authored-by: Sebastian Poeplau <[email protected]> Co-authored-by: Aurelien Francillon <[email protected]>
- Loading branch information
1 parent
ba782cb
commit 45b4700
Showing
12 changed files
with
159 additions
and
120 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,2 @@ | ||
build | ||
.git |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,14 @@ | ||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
|
||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: git submodule update --init --recursive symcc | ||
- run: docker build -t symcc symcc | ||
- run: docker build -t symqemu . | ||
on: | ||
workflow_dispatch: | ||
push: | ||
pull_request: | ||
jobs: | ||
build-and-test: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- run: git submodule update --init --recursive subprojects/symcc-rt | ||
# build and test with default LLVM version 15 | ||
- run: docker build -t symqemu . | ||
# LLVM version 14 | ||
- run: docker build --build-arg LLVM_VERSION=14 -t symqemu . |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,47 +1,58 @@ | ||
# prepare machine | ||
FROM ubuntu:22.04 as builder | ||
|
||
RUN apt update | ||
RUN apt install -y \ | ||
RUN apt update && apt install -y \ | ||
ninja-build \ | ||
libglib2.0-dev \ | ||
llvm \ | ||
git \ | ||
python3 \ | ||
python3-pip | ||
|
||
# | ||
FROM builder as symqemu | ||
python3-pip \ | ||
cmake \ | ||
wget \ | ||
lsb-release \ | ||
software-properties-common \ | ||
gnupg \ | ||
z3 \ | ||
libz3-dev \ | ||
libz3-dev \ | ||
libzstd-dev | ||
|
||
RUN pip install --user meson | ||
|
||
# This is passed along to symcc and qsym backend | ||
arg LLVM_VERSION=15 | ||
|
||
# installing/building with the right LLVM version, currently: | ||
# - no plan to support < 11 | ||
# - 12 to 15 are in official packages, | ||
# - 16 and 17 provided by llvm.org | ||
# - TODO 18 should be fixed | ||
RUN if [ $LLVM_VERSION -le 11 ]; then echo "LLVM <= 11 not supported" ; false ;fi | ||
RUN if [ $LLVM_VERSION -ge 18 ]; then echo "LLVM >= 18 currently not supported" ; false ;fi | ||
RUN if [ $LLVM_VERSION -eq 12 ] || [ $LLVM_VERSION -eq 13 ] || [ $LLVM_VERSION -eq 14 ] || [ $LLVM_VERSION -eq 15 ]; then \ | ||
apt install -y llvm-${LLVM_VERSION} clang-${LLVM_VERSION} ; \ | ||
else mkdir /llvm && cd /llvm && wget https://apt.llvm.org/llvm.sh && chmod +x llvm.sh && ./llvm.sh ${LLVM_VERSION}; \ | ||
fi | ||
|
||
COPY . /symqemu_source | ||
WORKDIR /symqemu_source | ||
|
||
# Meson gives an error if symcc is in a subdirectory of symqemu | ||
RUN mv /symqemu_source/symcc /symcc | ||
|
||
# The only symcc artifact needed by symqemu is libSymRuntime.so | ||
# Instead of compiling symcc in this image, we rely on the existing symcc docker image and | ||
# we just copy libSymRuntime.so at the location where symqemu expects it | ||
COPY --from=symcc /symcc_build/SymRuntime-prefix/src/SymRuntime-build/libSymRuntime.so /symcc/build/SymRuntime-prefix/src/SymRuntime-build/libSymRuntime.so | ||
|
||
RUN ./configure \ | ||
RUN mkdir build && cd build && ../configure \ | ||
--audio-drv-list= \ | ||
--disable-sdl \ | ||
--disable-gtk \ | ||
--disable-vte \ | ||
--disable-opengl \ | ||
--disable-virglrenderer \ | ||
--disable-werror \ | ||
--target-list=x86_64-linux-user,riscv64-linux-user \ | ||
--target-list=x86_64-linux-user,riscv64-linux-user \ | ||
--enable-debug \ | ||
--symcc-source=/symcc \ | ||
--symcc-build=/symcc/build \ | ||
--enable-debug-tcg \ | ||
--enable-werror | ||
--symcc-rt-llvm-version="$LLVM_VERSION" | ||
|
||
RUN make -j | ||
RUN cd build && make -j | ||
|
||
RUN make check | ||
RUN cd build && make check | ||
|
||
WORKDIR /symqemu_source/tests/symqemu | ||
RUN python3 -m unittest test.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.