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

service_context_d is not an independently linkable library

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • None
    • None
    • Internal Code
    • None
    • ALL

    Description

      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.

      Attachments

        Issue Links

          Activity

            People

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

              Dates

                Created:
                Updated:
                Resolved: