diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-07 18:45:59 +0000 |
commit | 19fcec84d8d7d21e796c7624e521b60d28ee21ed (patch) | |
tree | 42d26aa27d1e3f7c0b8bd3fd14e7d7082f5008dc /src/jaegertracing/thrift/build/docker/scripts/ubsan.sh | |
parent | Initial commit. (diff) | |
download | ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.tar.xz ceph-19fcec84d8d7d21e796c7624e521b60d28ee21ed.zip |
Adding upstream version 16.2.11+ds.upstream/16.2.11+dsupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'src/jaegertracing/thrift/build/docker/scripts/ubsan.sh')
-rwxr-xr-x | src/jaegertracing/thrift/build/docker/scripts/ubsan.sh | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/src/jaegertracing/thrift/build/docker/scripts/ubsan.sh b/src/jaegertracing/thrift/build/docker/scripts/ubsan.sh new file mode 100755 index 000000000..650dba0a6 --- /dev/null +++ b/src/jaegertracing/thrift/build/docker/scripts/ubsan.sh @@ -0,0 +1,30 @@ +#!/bin/sh + +set -e + +# Wraps autotools.sh, but each binary crashes if it exhibits undefined behavior. +# Set the undefined behavior flags. This crashes on all undefined behavior except for +# undefined casting, aka "vptr". +# TODO: fix undefined vptr behavior and turn this option back on. + +export CFLAGS="-fsanitize=undefined -fno-sanitize-recover=undefined -O0 -ggdb3 -fno-omit-frame-pointer" +export CXXFLAGS="${CFLAGS}" +export LDFLAGS="-lubsan" +export UBSAN_OPTIONS=print_stacktrace=1 + +# +# work around https://svn.boost.org/trac10/ticket/11632 if present +# + +sed -i 's/, stream_t(rdbuf()) /, stream_t(pbase_type::member.get())/g' /usr/include/boost/format/alt_sstream.hpp + +# llvm-symbolizer must be on PATH to get a stack trace on error + +CLANG_PATH="$(mktemp -d)" +trap "rm -rf ${CLANG_PATH}" EXIT +ln -s "$(whereis llvm-symbolizer-4.0 | rev | cut -d ' ' -f 1 | rev)" \ + "${CLANG_PATH}/llvm-symbolizer" +export PATH="${CLANG_PATH}:${PATH}" +llvm-symbolizer -version + +build/docker/scripts/autotools.sh $* |