Bug 1471685 - Work around MSVC linker adding padding during incremental builds. r=froydnj

--HG--
extra : rebase_source : 0e6f711d5f8517ca37d39c6f5a39cd0c0e3ec387
This commit is contained in:
Mike Hommey 2018-06-28 15:53:25 +09:00
Родитель 8a7d143341
Коммит e44bfe7b57
2 изменённых файлов: 14 добавлений и 2 удалений

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

@ -214,8 +214,17 @@ def check_nsmodules(target, binary):
symbols = sorted(symbols)
next_addr = None
# MSVC linker, when doing incremental linking, adds padding when
# merging sections. Allow there to be more space between the NSModule
# symbols, as long as they are in the right order.
if buildconfig.substs.get('_MSC_VER') and \
buildconfig.substs.get('DEVELOPER_OPTIONS'):
sym_cmp = lambda guessed, actual: guessed <= actual
else:
sym_cmp = lambda guessed, actual: guessed == actual
for addr, size, sym in symbols:
if next_addr is not None and next_addr != addr:
if next_addr is not None and not sym_cmp(next_addr, addr):
print_symbols(symbols)
raise RuntimeError('NSModules are not adjacent')
next_addr = addr + size

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

@ -363,7 +363,10 @@ nsComponentManagerImpl::Init()
RegisterModule(&kXPCOMModule, nullptr);
for (auto module : AllStaticModules()) {
RegisterModule(module, nullptr);
if (module) { // On local Windows builds, the list may contain null
// pointers from padding.
RegisterModule(module, nullptr);
}
}
for (uint32_t i = 0; i < sExtraStaticModules->Length(); ++i) {