mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1481633 Resolve kPStaticModules undefined symbols in MinGW Clang r=glandium
clang can handle MSVC-like codepaths generally, so we want to use those when building with clang for Windows. So we switch _MSC_VER over to _WIN32 to pick up those codepaths when compiling for Windows with clang. Additionally, we relax the ordering of sections for the same scenario. Note that we do need to tell clang to use -fms-extensions with the MSVC code, we do that in the mingw clang build job patch. Differential Revision: https://phabricator.services.mozilla.com/D3526 --HG-- extra : moz-landing-system : lando
This commit is contained in:
parent
0f09d86a83
commit
26dbd4d795
@ -222,8 +222,11 @@ def check_nsmodules(target, binary):
|
||||
# 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'):
|
||||
test_msvc = (buildconfig.substs.get('_MSC_VER') and \
|
||||
buildconfig.substs.get('DEVELOPER_OPTIONS'))
|
||||
test_clang = (buildconfig.substs.get('CC_TYPE') == 'clang' and \
|
||||
buildconfig.substs.get('OS_ARCH') == 'WINNT')
|
||||
if test_msvc or test_clang:
|
||||
sym_cmp = lambda guessed, actual: guessed <= actual
|
||||
else:
|
||||
sym_cmp = lambda guessed, actual: guessed == actual
|
||||
|
@ -133,7 +133,7 @@ struct Module
|
||||
|
||||
#if defined(MOZILLA_INTERNAL_API)
|
||||
# define NSMODULE_NAME(_name) _name##_NSModule
|
||||
# if defined(_MSC_VER)
|
||||
# if defined(_MSC_VER) || (defined(__clang__) && defined(__MINGW32__))
|
||||
# pragma section(".kPStaticModules$M", read)
|
||||
# pragma comment(linker, "/merge:.kPStaticModules=.rdata")
|
||||
# define NSMODULE_SECTION __declspec(allocate(".kPStaticModules$M"), dllexport)
|
||||
|
@ -280,7 +280,7 @@ static nsTArray<const mozilla::Module*>* sExtraStaticModules;
|
||||
// Dummy class to define a range-iterator for the static modules.
|
||||
class AllStaticModules {};
|
||||
|
||||
#if defined(_MSC_VER)
|
||||
#if defined(_MSC_VER) || (defined(__clang__) && defined(__MINGW32__))
|
||||
|
||||
# pragma section(".kPStaticModules$A", read)
|
||||
NSMODULE_ASAN_BLACKLIST __declspec(allocate(".kPStaticModules$A"), dllexport)
|
||||
|
Loading…
Reference in New Issue
Block a user