ci: turn off _FORTIFY_SOURCE explicitly

libelf is compiled with _FORTIFY_SOURCE by default and it
isn't compatible with MSan. It was borrowed
from https://github.com/google/oss-fuzz/pull/7422
This commit is contained in:
Evgeny Vereshchagin
2022-04-11 00:23:02 +00:00
committed by Andrii Nakryiko
parent 14414c6ea5
commit 8bc3e510fc

View File

@@ -17,6 +17,14 @@ mkdir -p "$OUT"
export LIB_FUZZING_ENGINE=${LIB_FUZZING_ENGINE:--fsanitize=fuzzer}
# libelf is compiled with _FORTIFY_SOURCE by default and it
# isn't compatible with MSan. It was borrowed
# from https://github.com/google/oss-fuzz/pull/7422
if [[ "$SANITIZER" == memory ]]; then
CFLAGS+=" -U_FORTIFY_SOURCE"
CXXFLAGS+=" -U_FORTIFY_SOURCE"
fi
# The alignment check is turned off by default on OSS-Fuzz/CFLite so it should be
# turned on explicitly there. It was borrowed from
# https://github.com/google/oss-fuzz/pull/7092