libmongocrypt: Build static link of libbson by default

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Fixed
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      In CDRIVER-2973, the linkage of libmongocrypt to libbson was changed from static to dynamic in order to prevent problems with symbol clashes when a libmongocrypt consumer also links directly to libbson. However, there are instances where the static linkage is preferable. Specifically the libmongocrypt Java implementation, which loads a .so/.dll via JNA, is drastically simplified by only requiring the loading of a single library file. The dynamic linkage situation forces users of the Java bindings to either install libbson in a system-wide location or to set the LD_LIBRARY_PATH environment variable to the location of libbson in order to enable the dynamic linker to satisfy the dependencies.

      The desired approach is instead to make a static linkage of libbson the default (most consumers of this library will never have a need to link directly to libbson) and to allow dynamic linkage based on a build flag for those consumers which require it (i.e., the C driver, which links directly to both libmongocrypt and libbson).

      The artifacts published by this ticket's parent (CDRIVER-3133) will be the static-linked version.

            Assignee:
            Roberto Sanchez
            Reporter:
            Roberto Sanchez
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: