From bc9682e03a68290ec36196b3c0db8aa922e901f8 Mon Sep 17 00:00:00 2001 From: "Adi (Suissa) Peleg" Date: Tue, 16 Nov 2021 10:02:18 -0500 Subject: [PATCH] Envoy: overriding CC and CXX when building in oss-fuzz (#6805) * Envoy: overriding CC and CXX when building in oss-fuzz Signed-off-by: Adi Suissa-Peleg --- projects/envoy/build.sh | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/projects/envoy/build.sh b/projects/envoy/build.sh index c9f29ae6d..9b32ed61c 100755 --- a/projects/envoy/build.sh +++ b/projects/envoy/build.sh @@ -22,11 +22,18 @@ declare -r FUZZ_TARGET_QUERY=' declare -r OSS_FUZZ_TARGETS="$(bazel query "${FUZZ_TARGET_QUERY}" | sed 's/$/_oss_fuzz/')" declare -r EXTRA_BAZEL_FLAGS="$( +if [ -n "$CC" ]; then + echo "--action_env=CC=${CC}" +fi +if [ -n "$CXX" ]; then + echo "--action_env=CXX=${CXX}" +fi 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)\"" + echo "--linkopt=$(find $(llvm-config --libdir) -name libclang_rt.ubsan_standalone_cxx-x86_64.a | head -1)" + echo "--linkopt=-fsanitize=undefined" elif [ "$SANITIZER" = "address" ] then echo "--copt=-D__SANITIZE_ADDRESS__" "--copt=-DADDRESS_SANITIZER=1" "--linkopt=-fsanitize=address"