Description
When attempting to compile with Clang-9 and UndefefinedSanitizer enabled (related to issues with GCC-10 + UBSan with latest folly - see MB-52475), we see the following linker errors for Golang targets which link native shares libraries:
TERM='dumb' /usr/bin/clang-9 -I /home/couchbase/server/goproj/src/github.com/couchbase/indexing/secondary/fdb -fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=$WORK/b197=/tmp/go-build -gno-record-gcc-switches -o $WORK/b197/_cgo_.o $WORK/b197/_cgo_main.o $WORK/b197/_x001.o $WORK/b197/_x002.o $WORK/b197/_x003.o $WORK/b197/_x004.o $WORK/b197/_x005.o $WORK/b197/_x006.o $WORK/b197/_x007.o $WORK/b197/_x008.o $WORK/b197/_x009.o $WORK/b197/_x010.o $WORK/b197/_x011.o -L/home/couchbase/server/build/forestdb -L/home/couchbase/server/build/sigar/src -L/home/couchbase/server/build/platform -L/home/couchbase/server/install/lib -L/home/couchbase/server/install/lib -L/home/couchbase/server/install/lib -Wl,-rpath-link=/home/couchbase/server/build/forestdb -Wl,-rpath-link=/home/couchbase/server/build/sigar/src -Wl,-rpath-link=/home/couchbase/server/build/platform -Wl,-rpath-link=/home/couchbase/server/install/lib -Wl,-rpath-link=/home/couchbase/server/install/lib -Wl,-rpath-link=/home/couchbase/server/install/lib -fsanitize=address -fsanitize=undefined -Wl,-rpath=$ORIGIN/../lib -lforestdb -lforestdb -lforestdb
|
# github.com/couchbase/indexing/secondary/fdb
|
/home/couchbase/server/build/forestdb/libforestdb.so: undefined reference to `__ubsan_handle_function_type_mismatch_v1_abort'
|
clang: error: linker command failed with exit code 1 (use -v to see invocation)
|
What appears to be happening is while the linker is told to enable ASan and UBSan (-fsanitize=address -fsanitize=undefined), the UBSan runtime library is not getting linked and hence missing symbols are seen.
Attachments
Issue Links
- relates to
-
MB-41896 ThreadSanitizer CHECK failed: sanitizer_deadlock_detector1.cc:166 "((!dd.isHeld(<->dd, m->id))) != (0)" (0x0, 0x0)
- Closed