Unverified Commit bf1e52ab by Evgeny Vereshchagin Committed by Christian Brauner

ci: switch to --enable-fuzzers

parent 06b14efd
...@@ -20,8 +20,13 @@ apt-get install --yes --no-install-recommends \ ...@@ -20,8 +20,13 @@ apt-get install --yes --no-install-recommends \
python3-setuptools rsync squashfs-tools uidmap unzip uuid-runtime \ python3-setuptools rsync squashfs-tools uidmap unzip uuid-runtime \
wget xz-utils wget xz-utils
ARGS="--enable-sanitizers --enable-tests --prefix=/usr/ --sysconfdir=/etc/ --localstatedir=/var/ --disable-no-undefined"
case "$CC" in clang*)
ARGS="$ARGS --enable-fuzzers"
esac
./autogen.sh ./autogen.sh
CFLAGS="-Wall -Werror" ./configure --enable-sanitizers --enable-tests --prefix=/usr/ --sysconfdir=/etc/ --localstatedir=/var/ --disable-no-undefined CFLAGS="-Wall -Werror" ./configure $ARGS
make make
make install make install
......
...@@ -17,4 +17,4 @@ jobs: ...@@ -17,4 +17,4 @@ jobs:
- name: Build - name: Build
run: | run: |
sudo CC=${{ matrix.compiler }} .github/workflows/sanitizers.sh sudo CC=${{ matrix.compiler }} CXX=${{ matrix.compiler }}++ .github/workflows/sanitizers.sh
...@@ -39,14 +39,15 @@ sed -i 's/^AC_CHECK_LIB(util/#/' configure.ac ...@@ -39,14 +39,15 @@ sed -i 's/^AC_CHECK_LIB(util/#/' configure.ac
--disable-selinux \ --disable-selinux \
--disable-seccomp \ --disable-seccomp \
--disable-capabilities \ --disable-capabilities \
--disable-no-undefined --disable-no-undefined \
--enable-tests \
--enable-fuzzers
make -j$(nproc) make -j$(nproc)
for fuzz_target_source in src/tests/fuzz-lxc*.c; do for fuzz_target_source in src/tests/fuzz-lxc*.c; do
fuzz_target_name=$(basename "$fuzz_target_source" ".c") fuzz_target_name=$(basename "$fuzz_target_source" ".c")
$CC -c -o "$fuzz_target_name.o" $CFLAGS -Isrc -Isrc/lxc "$fuzz_target_source" cp "src/tests/$fuzz_target_name" "$OUT"
$CXX $CXXFLAGS $LIB_FUZZING_ENGINE "$fuzz_target_name.o" src/lxc/.libs/liblxc.a -o "$OUT/$fuzz_target_name"
done done
perl -lne 'if (/config_jump_table\[\]\s*=/../^}/) { /"([^"]+)"/ && print "$1=" }' src/lxc/confile.c >doc/examples/keys.conf perl -lne 'if (/config_jump_table\[\]\s*=/../^}/) { /"([^"]+)"/ && print "$1=" }' src/lxc/confile.c >doc/examples/keys.conf
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment