Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-34786

service_context_d is not an independently linkable library

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Internal Code
    • Labels:
      None
    • ALL

      service_context_d is a library with some undefined references:

      build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'mongo::ShardServerCatalogCacheLoader::ShardServerCatalogCacheLoader(std::unique_ptr<mongo::CatalogCacheLoader, std::default_delete<mongo::CatalogCacheLoader> >)'
      build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'vtable for mongo::ReadOnlyCatalogCacheLoader'
      /opt/mongodbtoolchain/v2/bin/ld.gold: the vtable symbol may be undefined because the class is missing its key function
      build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'mongo::ChunkSplitter::setReplicaSetMode(bool)'
      build/ninja/mongo/db/s/libsharding.so: error: undefined reference to 'mongo::ChunkSplitter::get(mongo::OperationContext*)'
      clang-3.9: error: linker command failed with exit code 1 (use -v to see invocation)
      ninja: build stopped: subcommand failed.
      

      (I produced this by simply making service_context_d a Program instead of a Library, and adding a trivial main() module to it.)

      This means that if you attempt to add service_context_d to a LIBDEPS section, without also adding the libraries containing the missing symbols to the same section, you will get link errors such as the above.

      Would it be possible to, in general, enforce that our libraries can all stand by themselves with no undefined references? We could make a whitelist of libraries that cannot abide by this rule, if necessary.

            Assignee:
            backlog-server-platform DO NOT USE - Backlog - Platform Team
            Reporter:
            milkie@mongodb.com Eric Milkie
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: