build: fix ubsan oss-fuzz build.#5875
Conversation
We were still failing ClusterFuzz builds for ubsan, another external_cmake regression. Risk level: Low Testing: oss-fuzz undefined Docker build. Signed-off-by: Harvey Tuch <htuch@google.com>
Signed-off-by: Harvey Tuch <htuch@google.com>
| # it in the same test. | ||
| if "-static-libstdc++" in sys.argv[1:] or "-stdlib=libc++" in sys.argv[1:]: | ||
| if ("-static-libstdc++" in sys.argv[1:] or "-stdlib=libc++" in sys.argv[1:] or | ||
| "-std=c++0x" in sys.argv[1:]): |
There was a problem hiding this comment.
I cannot figure out why, but this change breaks local builds with --config libc++ (seems to be working fine on the CI, though...).
There was a problem hiding this comment.
Have you looked any further into this? How would you like to move proceed?
There was a problem hiding this comment.
I did not, and I won't have time to dig further into it anytime soon, sorry!
It's also unclear to me as to why did we need this change to fix UBSan on oss-fuzz, since everything else seems to work fine without it, and without access to oss-fuzz, it's really hard to fix this without breaking UBSan again.
Perhaps @lizan can dig into it? He was the one that originally asked for libc++ support.
There was a problem hiding this comment.
This was due to the fact that we invoke envoy_cc_wrapper for both CC and CXX for the external deps under external_cmake. The external_cmake build for some deps (e.g. zlib, c-ares) tries to build test/build binaries etc. that don't statically link, and doesn't supply the above flags, but it does set -std=c++0x. The use of the wrong compiler causes confusion specifically because of missing ubsan symbols. At least, that's roughly what I remember.
You can definitely repeat this yourself if you'd like, to run the oss-fuzz build, follow the instructions at https://github.com/envoyproxy/envoy/tree/master/test/fuzz#running-fuzz-tests-locally and replace --sanitizer=address with --sanitizer=undefined.
We were still failing ClusterFuzz builds for ubsan, another external_cmake regression. Risk level: Low Testing: oss-fuzz undefined Docker build. Signed-off-by: Harvey Tuch <htuch@google.com> Signed-off-by: Fred Douglas <fredlas@google.com>
We were still failing ClusterFuzz builds for ubsan, another external_cmake regression.
Risk level: Low
Testing: oss-fuzz undefined Docker build.
Signed-off-by: Harvey Tuch htuch@google.com