0
0
mirror of https://github.com/mongodb/mongo.git synced 2024-11-24 00:17:37 +01:00

SERVER-90930 adding symbol.orderfile and build flags (#22633)

GitOrigin-RevId: 8e3c8eb6aec4d3bca8e43253726ea4628ef7e6d0
This commit is contained in:
Daniel Hill 2024-05-28 17:44:21 -07:00 committed by MongoDB Bot
parent ba4bee0dad
commit fca47bffd1
2 changed files with 3211 additions and 0 deletions

View File

@ -4766,6 +4766,17 @@ def doConfigure(myenv):
# If possible with the current linker, mark relocations as read-only.
myenv.AddToLINKFLAGSIfSupported("-Wl,-z,relro")
if linker_ld != "gold" and not env.TargetOSIs("darwin", "macOS"):
myenv.AppendUnique(
CCFLAGS=["-ffunction-sections"],
LINKFLAGS=[
"-Wl,--symbol-ordering-file=symbols.orderfile",
"-Wl,--no-warn-symbol-ordering",
],
)
else:
print("WARNING: lld linker is required to sort symbols")
# As far as we know these flags only apply on posix-y systems,
# and not on Darwin.
if env.TargetOSIs("posix") and not env.TargetOSIs("darwin"):

3200
symbols.orderfile Normal file

File diff suppressed because it is too large Load Diff