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

mongo_csfle_shlib_test can fail to build with -gsplit-dwarf

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.3.0
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.2, v5.0
    • Dev Platform 2022-02-21

      Building mongo_csfle_shlib_test with --link-model=dynamic and -gsplit-dwarf fails with a linker error that looks like this:

      /opt/mongodbtoolchain/v3/bin/ld.gold: warning: build/opt/mongo/db/modules/enterprise/src/fle/lib/mongo_csfle_shlib_test.dwo: missing .note.GNU-stack section implies executable stack
      /opt/mongodbtoolchain/v3/bin/ld.gold: error: treating warnings as errors
      clang-7: error: linker command failed with exit code 1 (use -v to see invocation)
      scons: *** [build/opt/mongo/db/modules/enterprise/src/fle/lib/mongo_csfle_shlib_test] Error 1
      scons: building terminated because of errors.
      

      This is happening because we're using a SCons Object to create a shared library for the test. However, if -gsplit-dwarf is enabled, the list of object files includes a .dwo, which indeed does not have a .note.GNU-stack section because it is not really an object file meant for linking. We know there will only be one object file for linking, so we just need to be specific about that.

            Assignee:
            ryan.egesdahl@mongodb.com Ryan Egesdahl (Inactive)
            Reporter:
            ryan.egesdahl@mongodb.com Ryan Egesdahl (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: