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

Dynamic builds should use --no-as-needed for executables, not just libraries

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.4.1, 3.5.1
    • Affects Version/s: None
    • Component/s: Build
    • None
    • Fully Compatible
    • ALL
    • v3.4
    • Platforms 2017-01-23

      We currently add -Wl,--no-as-needed to SHLINKFLAGS, so that we don't silently drop library to library dependency edges if there is no symbolic dependency on platforms where -Wl,--no-as-needed is on by default. We don't want to drop those edges because even though there is no symbol level dependency, there may be a "hidden" dependency on static initializers or mongo initializers.

      However, we have not done the same thing for executable to library edges, so we can still end up dropping a dependency edge.

      We should add -Wl,--no-as-needed to LINKFLAGS instead of SHLINKFLAGS, so it is applied to both executables and dynamic libraries.

            Assignee:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: