Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
51 changes: 17 additions & 34 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,10 @@ jobs:
matrix:
include:
# Linux with GCC
# - {os: ubuntu-18.04, llvm: '3.9', compiler: gcc}
# - {os: ubuntu-18.04, llvm: '4.0', compiler: gcc}
# - {os: ubuntu-18.04, llvm: '5.0', compiler: gcc}
- {os: ubuntu-18.04, llvm: '6.0', compiler: gcc}
- {os: ubuntu-18.04, llvm: 7, compiler: gcc}
- {os: ubuntu-18.04, llvm: 8, compiler: gcc}
- {os: ubuntu-18.04, llvm: 9, compiler: gcc}
- {os: ubuntu-20.04, llvm: '6.0', compiler: gcc}
- {os: ubuntu-20.04, llvm: 7, compiler: gcc}
- {os: ubuntu-20.04, llvm: 8, compiler: gcc}
- {os: ubuntu-20.04, llvm: 9, compiler: gcc}
- {os: ubuntu-20.04, llvm: 10, compiler: gcc}
- {os: ubuntu-20.04, llvm: 10, compiler: gcc, type: Debug}
# FIXME: Edit when KLEE is rebased to latest upstream.
Expand All @@ -31,13 +28,10 @@ jobs:
- {os: ubuntu-22.04, llvm: 13, compiler: gcc, klee: 'no-klee'}

# Linux with Clang
# - {os: ubuntu-18.04, llvm: '3.9', compiler: clang}
# - {os: ubuntu-18.04, llvm: '4.0', compiler: clang}
# - {os: ubuntu-18.04, llvm: '5.0', compiler: clang}
- {os: ubuntu-18.04, llvm: '6.0', compiler: clang}
- {os: ubuntu-18.04, llvm: 7, compiler: clang}
- {os: ubuntu-18.04, llvm: 8, compiler: clang}
- {os: ubuntu-18.04, llvm: 9, compiler: clang}
- {os: ubuntu-20.04, llvm: '6.0', compiler: clang}
- {os: ubuntu-20.04, llvm: 7, compiler: clang}
- {os: ubuntu-20.04, llvm: 8, compiler: clang}
- {os: ubuntu-20.04, llvm: 9, compiler: clang}
- {os: ubuntu-20.04, llvm: 10, compiler: clang}
- {os: ubuntu-20.04, llvm: 10, compiler: clang, type: Debug}
# FIXME: Edit when KLEE is rebased to latest upstream.
Expand All @@ -52,23 +46,11 @@ jobs:
with:
submodules: true

# LLVM 7.0.x built by GCC is not ABI compatible with tools built by Clang
# and vice-versa. Therefore, every instance of KLEE ended being killed
# by SIGSEGV. LLVM 7.1 fixes this issue but it never made its way to
# Bionic's official repositories. So let's use the LLVM repos instead.
#
# https://lists.llvm.org/pipermail/llvm-dev/2018-September/126564.html
- name: '[Bionic + LLVM 7.1] Add repositories'
if: matrix.os == 'ubuntu-18.04' && matrix.llvm == 7
run: |
wget -O - https://apt.llvm.org/llvm-snapshot.gpg.key | sudo apt-key add -
sudo apt-add-repository "deb http://apt.llvm.org/bionic/ llvm-toolchain-bionic-7 main"

- name: Install dependencies
run: |
sudo apt update
sudo apt install ccache cmake clang-${{matrix.llvm}} \
llvm-${{matrix.llvm}}-dev libc6-dev-i386 \
llvm-${{matrix.llvm}}-dev gcc-multilib \
libz3-dev

- name: Set environment
Expand Down Expand Up @@ -100,6 +82,10 @@ jobs:
CFLAGS="-shared-libasan $CFLAGS"
CXXFLAGS="-shared-libasan $CXXFLAGS"

# Dynamic compiler-rt libraries are not in /usr/lib
tmp="$(clang-${{matrix.llvm}} -print-file-name=libclang_rt.asan-x86_64.so)"
LD_LIBRARY_PATH="$(dirname "$tmp")"

# Force coloured output
CFLAGS="-fcolor-diagnostics $CFLAGS"
CXXFLAGS="-fcolor-diagnostics $CXXFLAGS"
Expand All @@ -119,20 +105,19 @@ jobs:
echo "CFLAGS=$CFLAGS" >> $GITHUB_ENV
echo "CXXFLAGS=$CXXFLAGS" >> $GITHUB_ENV
echo "LDFLAGS=$LDFLAGS" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV

# Set up ccache
sudo /usr/sbin/update-ccache-symlinks
echo "/usr/lib/ccache" >> $GITHUB_PATH

# Bionic does not create symlinks to versioned clang
sudo ln -sfr /usr/bin/ccache /usr/lib/ccache/clang-${{matrix.llvm}}
sudo ln -sfr /usr/bin/ccache /usr/lib/ccache/clang++-${{matrix.llvm}}
# Store the environment
echo "CCACHE_BASEDIR=$GITHUB_WORKSPACE" >> $GITHUB_ENV
echo "CCACHE_COMPRESS=true" >> $GITHUB_ENV
echo "CCACHE_COMPRESSLEVEL=6" >> $GITHUB_ENV
echo "CCACHE_DIR=$GITHUB_WORKSPACE/.ccache" >> $GITHUB_ENV
echo "CCACHE_MAXSIZE=400M" >> $GITHUB_ENV
echo "::set-output name=timestamp::$(date -u -Iseconds)"
echo "timestamp=$(date -u -Iseconds)" >> $GITHUB_OUTPUT

- name: Set up ccache
uses: actions/cache@v3
Expand All @@ -152,11 +137,9 @@ jobs:
if: matrix.llvm < 11
run: |
if [[ "${{matrix.compiler}}" = "clang" ]]; then
# * libclang_rt.asan-x86_64.so must be loaded as the first library
# * other compiler_rt libraries are not in /usr/lib
# libclang_rt.asan-x86_64.so must be loaded as the first library
# See https://systemd.io/TESTING_WITH_SANITIZERS for details.
export LD_PRELOAD="$(clang-${{matrix.llvm}} -print-file-name=libclang_rt.asan-x86_64.so)"
export LD_LIBRARY_PATH="$(dirname $LD_PRELOAD)"
else
export LD_PRELOAD="$(gcc -print-file-name=libasan.so)"
fi
Expand Down
2 changes: 1 addition & 1 deletion build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -831,7 +831,7 @@ if [ $FROM -le 6 -a "$BUILD_PREDATOR" = "yes" ]; then
pushd predator-${LLVM_VERSION}

if [ ! -f cl_build/CMakeCache.txt ]; then
CXX=clang++ ./switch-host-llvm.sh ${ABS_SRCDIR}/llvm-${LLVM_VERSION}/build/${LLVM_CMAKE_CONFIG_DIR}
./switch-host-llvm.sh ${ABS_SRCDIR}/llvm-${LLVM_VERSION}/build/${LLVM_CMAKE_CONFIG_DIR}
fi

build || exitmsg "Building Predator"
Expand Down
9 changes: 7 additions & 2 deletions lib/symbioticpy/symbiotic/environment.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
from . utils import err, dbg
from . utils.utils import process_grep

import re

def _vers_are_same(v1, v2):
parts1 = v1.split('.')
parts2 = v2.split('.')
Expand All @@ -17,8 +19,11 @@ def _check_clang_in_path(llvm_version):
if versline[0] != 0 or len(versline[1]) != 1:
return False

parts = versline[1][0].split()
return _vers_are_same(parts[2].decode('utf-8'), llvm_version)
match = re.search(r'\d+\.\d+\.\d+', versline[1][0].decode())
if match is None:
err('Could not determine the clang version')

return _vers_are_same(match[0], llvm_version)

def _set_symbiotic_environ(tool, env, opts):
env.cwd = getcwd()
Expand Down
9 changes: 1 addition & 8 deletions system-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -166,11 +166,6 @@ mkdir -p $PREFIX/include
check()
{
MISSING=""
if ! curl --version &>/dev/null; then
echo "Need curl to download files"
MISSING="curl"
fi

if ! which true ; then
echo "Need 'which' command."
MISSING="which"
Expand Down Expand Up @@ -407,9 +402,7 @@ if [ $FROM -le 6 -a "$BUILD_PREDATOR" = "yes" ]; then
pushd predator-${LLVM_VERSION}

if [ ! -f cl_build/CMakeCache.txt ]; then
which "$LLVM_BIN_DIR/clang++" # plain clang has already been tested above
CC="$LLVM_BIN_DIR/clang" CXX="$LLVM_BIN_DIR/clang++" \
./switch-host-llvm.sh "$LLVM_DIR"
./switch-host-llvm.sh "$LLVM_DIR"
fi

build || exitmsg "Failed building Predator"
Expand Down