Skip to content

Commit

Permalink
TEST
Browse files Browse the repository at this point in the history
  • Loading branch information
lzaoral committed Dec 16, 2022
1 parent 1dafae1 commit 205116a
Showing 1 changed file with 28 additions and 20 deletions.
48 changes: 28 additions & 20 deletions .github/workflows/linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,10 @@ jobs:
# Force coloured output
CFLAGS="-fcolor-diagnostics $CFLAGS"
CXXFLAGS="-fcolor-diagnostics $CXXFLAGS"
# * libclang_rt.asan-x86_64.so must be loaded as the first library
# See https://systemd.io/TESTING_WITH_SANITIZERS for details.
LD_PRELOAD="$(clang-${{matrix.llvm}} -print-file-name=libclang_rt.asan-x86_64.so)"
else
# GCC
CC="gcc"
Expand All @@ -115,15 +119,38 @@ jobs:
# Force coloured output
CFLAGS="-fdiagnostics-color $CFLAGS"
CXXFLAGS="-fdiagnostics-color $CXXFLAGS"
# libasan.so must be loaded as the first library
export LD_PRELOAD="$(gcc -print-file-name=libasan.so)"
fi
# Make symbiotic use correct clang & friends from PATH (e.g. no
# disguised ccache or problems with unversioned tools not being
# in PATH).
#
# Also, clang's ASAN and UBSAN expect unversioned llvm-symbolizer
# in PATH.
PATH="$(llvm-config-${{matrix.llvm}} --bindir):$PATH"
# Due to LD_PRELOAD above, leak sanitizer was reporting leaks
# literally in everything that was executed, e.g. make, shell,
# python and other tools that are not under our control.
ASAN_OPTIONS=detect_leaks=0
# Make UBSAN print whole stack traces
UBSAN_OPTIONS="print_stacktrace=1"
# Save the environment
echo "CC=$CC" >> $GITHUB_ENV
echo "CXX=$CXX" >> $GITHUB_ENV
echo "CFLAGS=$CFLAGS" >> $GITHUB_ENV
echo "CXXFLAGS=$CXXFLAGS" >> $GITHUB_ENV
echo "LDFLAGS=$LDFLAGS" >> $GITHUB_ENV
echo "LD_PRELOAD=$LD_PRELOAD" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH" >> $GITHUB_ENV
echo "PATH=$PATH" >> "$GITHUB_ENV"
echo "ASAN_OPTIONS=$ASAN_OPTIONS" >> "$GITHUB_ENV"
echo "UBSAN_OPTIONS=$UBSAN_OPTIONS" >> "$GITHUB_ENV"
# Set up ccache
sudo /usr/sbin/update-ccache-symlinks
Expand Down Expand Up @@ -156,26 +183,7 @@ jobs:
# FIXME: Remove when KLEE is rebased to latest upstream.
if: matrix.llvm < 11
run: |
if [[ "${{matrix.compiler}}" = "clang" ]]; then
# * 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)"
else
export LD_PRELOAD="$(gcc -print-file-name=libasan.so)"
fi
# Make symbiotic use correct clang & friends from PATH (e.g. no
# disguised ccache or problems with unversioned tools not being
# in PATH).
#
# Also, clang's ASAN and UBSAN expect unversioned llvm-symbolizer
# in PATH.
export PATH="$(llvm-config-${{matrix.llvm}} --bindir):$PATH"
# Due to LD_PRELOAD above, leak sanitizer was reporting leaks
# literally in everything that was executed, e.g. make, shell,
# python and other tools that are not under our control.
ASAN_OPTIONS=detect_leaks=0 make -C tests
make -C tests
- name: ccache statistics
run: ccache -s

0 comments on commit 205116a

Please sign in to comment.