Bug 1494216 - Use the -Bsymbolic-functions 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-functions 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
Родитель c039cd96a7
Коммит 9a846a77d5
1 изменённых файлов: 2 добавлений и 1 удалений

Просмотреть файл

@ -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-functions']
if 'LD_LIBRARY_PATH' in os.environ:
os.environ['LD_LIBRARY_PATH'] = ('%s/lib64/:%s' %