aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Adi (Suissa) Peleg <adip@google.com>2021-11-16 10:02:18 -0500
committerGravatar GitHub <noreply@github.com>2021-11-16 09:02:18 -0600
commitbc9682e03a68290ec36196b3c0db8aa922e901f8 (patch)
treebd458bd0cf53b479328a5006069c7f5f5c38e6d4
parent9fc819841ff23ef817790d424b4ff5963fb1c779 (diff)
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 <adip@google.com>
-rwxr-xr-xprojects/envoy/build.sh9
1 files changed, 8 insertions, 1 deletions
diff --git a/projects/envoy/build.sh b/projects/envoy/build.sh
index c9f29ae6..9b32ed61 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"