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

Prefix all shared libraries produced by the server build with libmongo rather than plain lib

    • Type: Icon: Improvement Improvement
    • Resolution: Won't Do
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Build
    • Labels:
    • Server Development Platform
    • Fully Compatible
    • Dev Platform 2021-04-19, Dev Platform 2021-05-03

      In dynamic builds we produce a library called libunwind.so. Things that link to it end up with DT_NEEDED entries that reference libunwind.so. That's not a great idea: the system almost surely has a libunwind.so and it surely isn't the one we intend things to use at load time. Normally, it shouldn't be a problem because our DT_RUNPATH uses $ORIGIN or the macOS analogue, so we will look in our PREFIX_LIBDIR first. But other things can get in the way, like an errant LD_LIBRARY_PATH, since LD_LIBRARY_PATH is searched before DT_RUNPATH. This exact situation has happened to developers and led to great confusion.

      We can leverage the SCons SHLIBPREFIX variable to have all of our libraries come out with a libmongo_ prefix. So we would have libmongo_unwind.so, libmongo_tcmalloc_minimal.so.

      Due to the way libdeps works, we wouldn't need to actually replace any of the library references in our existing LIBDEPS declarations in our SConscripts, so the change required to make this safety improvement is quite small.

            backlog-server-devplatform [DO NOT ASSIGN] Backlog - Server Development Platform Team (SDP) (Inactive)
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            1 Vote for this issue
            3 Start watching this issue