[SERVER-24184] Enabling the enterprise module should not alter link flags or linker search paths Created: 17/May/16  Updated: 27/Feb/17  Resolved: 27/Feb/17

Status: Closed
Project: Core Server
Component/s: Build
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Andrew Morrow (Inactive) Assignee: Gabriel Russell (Inactive)
Resolution: Done Votes: 1
Labels: platforms-re-triaged
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: ALL
Steps To Reproduce:

Build the enterprise module, and note that -Wl,-Bsymbolic-functions appears on the link line, despite our not requesting it anywhere in the SCons build:

https://evergreen.mongodb.com/task_log_raw/mongodb_mongo_master_enterprise_ubuntu_dynamic_1404_64_bit_compile_ef4d89551ed93f9381047630f1374d789c4082f8_16_05_17_18_04_51/0?type=T#L287

Sprint: Platforms 2017-03-06
Participants:

 Description   

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.



 Comments   
Comment by Gabriel Russell (Inactive) [ 27/Feb/17 ]

I suspect that this problem has gone away.

adam.martin, the other week, during a meeting, you said that this was either happening, or that it clearly shouldn't be happening, I can't remember which, but in case it was the former, can you let me know if you have evidence of a real problem?

Thank you,
Gabriel

Generated at Thu Feb 08 04:05:37 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.