Uploaded image for project: 'Couchbase Server'
  1. Couchbase Server
  2. MB-52493

Linker errors under Clang+UBsan for Golang targets

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • master
    • master
    • build
    • None
    • Untriaged
    • 1
    • Unknown

    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

          No reviews matched the request. Check your Options in the drop-down menu of this sections header.

          Activity

            People

              drigby Dave Rigby (Inactive)
              drigby Dave Rigby (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty