Bug 1494216 - Use the -Bsymbolic linker flag to build clang. r=froydnj

With libLLVM being a shared library exporting many symbols, all internal
calls using those symbols default to go through the PLT, which is
unnecessary (and costly) overhead. Using -Bsymbolic makes internal calls
go directly to the right place without going through the PLT.

Differential Revision: https://phabricator.services.mozilla.com/D7029
This commit is contained in:
Mike Hommey 2018-09-27 08:19:41 +09:00
parent b45169b5aa
commit 5b4e6b4365

View File

@ -616,7 +616,8 @@ if __name__ == "__main__":
# Silence clang's warnings about arguments not being used in compilation.
extra_cxxflags2 = ["-fPIC", '-Qunused-arguments']
extra_asmflags = []
extra_ldflags = []
# Avoid libLLVM internal function calls going through the PLT.
extra_ldflags = ['-Wl,-Bsymbolic']
if 'LD_LIBRARY_PATH' in os.environ:
os.environ['LD_LIBRARY_PATH'] = ('%s/lib64/:%s' %