-
Type: Bug
-
Resolution: Fixed
-
Priority: Major - P3
-
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.