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

Enabling the enterprise module should not alter link flags or linker search paths

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: Build

      Currently, the build.py for the enterprise module modifies the global environment by calling env.ParseFlags on the result of net-snmp-config --agent-libs.

      The result is that any strange linkflags that netsnmp thinks should be used are propagated to the global link flags.

      On my Ubuntu 16.04 machine, this results in the following flags being parsed:

      net-snmp-config --agent-libs
      -Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -L/usr/lib/x86_64-linux-gnu -lnetsnmpmibs -lsensors -lpci -ldl -lnetsnmpagent -lwrap -Wl,-E -lnetsnmp -lcrypto -lm
      

      We almost certainly don't want to be building with -Bsymbolic-functions. Nor do we want to be adding a -L argument into a system directory, which can interfere with the library search path for the toolchain.

      This was also the cause of SERVER-23200.

      This also lead to the puzzling fact that it appears that we were getting relro builds, when in fact that was only a side effect of the enterprise module being enabled.

            Assignee:
            gabriel.russell@mongodb.com Gabriel Russell (Inactive)
            Reporter:
            andrew.morrow@mongodb.com Andrew Morrow (Inactive)
            Votes:
            1 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: