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

ld warning "...weak symbol cannot be overridden at runtime" on macOS from Folly

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Minor
    • 6.5.0
    • 6.5.0
    • memcached
    • None
    • Untriaged
    • Unknown

    Description

      Since KV-engine started using Folly in dcp/producer.cc, we see the following warning on macOS (Xcode 10.1):

      [707/708] Linking CXX executable kv_engine/ep-engine_ep_unit_tests
      ld: warning: direct access in function 'folly::Function<bool ()>::Function<bool (*)()>(bool (*&&)(), std::__1::integral_constant<bool, true>)' from file 'kv_engine/engines/ep/CMakeFiles/ep_objs.dir/src/dcp/producer.cc.o' to global weak symbol 'folly::detail::function::FunctionTraits<bool ()>::uninitCall(folly::detail::function::Data&)' from file 'tlm/deps/folly.exploded/lib/libfolly.a(AtFork.cpp.o)' means the weak symbol cannot be overridden at runtime. This was likely caused by different translation units being compiled with different visibility settings.
      

      According to https://stackoverflow.com/questions/9894961/strange-warnings-from-the-linker-ld, this is caused by different visibility settings across different object files. This seems a likely cause, given CB Server builds with non-default (visibility=hidden) settings and I see no mention of us overriding it in Folly.

      Attachments

        Issue Links

          For Gerrit Dashboard: MB-33862
          # Subject Branch Project Status CR V

          Activity

            People

              ben.huddleston Ben Huddleston
              drigby Dave Rigby (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes

                  PagerDuty