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

stitch_support library fails to load due to missing static initializers

    • Type: Icon: Bug Bug
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 5.2.0, 5.0.4, 5.1.0-rc1
    • Affects Version/s: None
    • Component/s: None
    • None
    • Fully Compatible
    • ALL
    • v5.1, v5.0
    • Hide

      1. Save

      #include "stitch_support/stitch_support.h"
      #include <cassert>
      
      int main() {
          auto status = stitch_support_v1_status_create();
          assert(status != nullptr);
      
          auto lib = stitch_support_v1_init(status);
          assert(lib != nullptr);
      
          return 0;
      }
      

      2. g++ -I build/install/include/stitch_support/v1 stitch.cpp -L build/install/lib/ -lstitch_support

      3. LD_LIBRARY_PATH=build/install/lib/ gdb ./a.out
      a.out should return 0 instead of asserting

      Show
      1. Save #include "stitch_support/stitch_support.h" #include <cassert> int main() { auto status = stitch_support_v1_status_create(); assert(status != nullptr); auto lib = stitch_support_v1_init(status); assert(lib != nullptr); return 0; } 2. g++ -I build/install/include/stitch_support/v1 stitch.cpp -L build/install/lib/ -lstitch_support 3. LD_LIBRARY_PATH=build/install/lib/ gdb ./a.out a.out should return 0 instead of asserting
    • Dev Platform 2021-10-18

      The link-model "dynamic-sdk" is linking archives but by default object files in archives are not included unless they are needed.

      The specific issue in this case is that https://github.com/mongodb/mongo/blob/master/src/mongo/util/options_parser/startup_option_init.cpp is missing from the final library.

            Assignee:
            daniel.moody@mongodb.com Daniel Moody
            Reporter:
            mark.benvenuto@mongodb.com Mark Benvenuto
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: