diff --git a/python/mozbuild/mozbuild/action/check_binary.py b/python/mozbuild/mozbuild/action/check_binary.py index 1e4fa41abbae..aafd191f99b2 100644 --- a/python/mozbuild/mozbuild/action/check_binary.py +++ b/python/mozbuild/mozbuild/action/check_binary.py @@ -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 diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index c1371595f820..f5082bf06327 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -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) {