mirror of https://github.com/google/oss-fuzz.git
[envoy] fix ubsan build (#2664)
Signed-off-by: Lizan Zhou <lizan@tetrate.io>
This commit is contained in:
parent
40dbd8d101
commit
be1baac06a
projects/envoy
|
@ -15,9 +15,8 @@
|
||||||
#
|
#
|
||||||
################################################################################
|
################################################################################
|
||||||
|
|
||||||
# Disable UBSan vptr since target built with -fno-rtti.
|
export CFLAGS="$CFLAGS"
|
||||||
export CFLAGS="$CFLAGS -fno-sanitize=vptr"
|
export CXXFLAGS="$CXXFLAGS"
|
||||||
export CXXFLAGS="$CXXFLAGS -fno-sanitize=vptr"
|
|
||||||
|
|
||||||
declare -r FUZZER_TARGETS_CC=$(find . -name *_fuzz_test.cc)
|
declare -r FUZZER_TARGETS_CC=$(find . -name *_fuzz_test.cc)
|
||||||
declare -r FUZZER_TARGETS="$(for t in ${FUZZER_TARGETS_CC}; do echo "${t:2:-3}"; done)"
|
declare -r FUZZER_TARGETS="$(for t in ${FUZZER_TARGETS_CC}; do echo "${t:2:-3}"; done)"
|
||||||
|
@ -39,6 +38,13 @@ done
|
||||||
for f in ${CXXFLAGS}; do
|
for f in ${CXXFLAGS}; do
|
||||||
echo "--cxxopt=${f}" "--linkopt=${f}"
|
echo "--cxxopt=${f}" "--linkopt=${f}"
|
||||||
done
|
done
|
||||||
|
|
||||||
|
if [ "$SANITIZER" = "undefined" ]
|
||||||
|
then
|
||||||
|
# Bazel uses clang to link binary, which does not link clang_rt ubsan library for C++ automatically.
|
||||||
|
# See issue: https://github.com/bazelbuild/bazel/issues/8777
|
||||||
|
echo "--linkopt=\"$(find $(llvm-config --libdir) -name libclang_rt.ubsan_standalone_cxx-x86_64.a | head -1)\""
|
||||||
|
fi
|
||||||
)"
|
)"
|
||||||
|
|
||||||
declare BAZEL_BUILD_TARGETS=""
|
declare BAZEL_BUILD_TARGETS=""
|
||||||
|
|
Loading…
Reference in New Issue