diff --git a/python/mozbuild/mozbuild/action/check_binary.py b/python/mozbuild/mozbuild/action/check_binary.py index 787703c4643d..dc44ec1f6be8 100644 --- a/python/mozbuild/mozbuild/action/check_binary.py +++ b/python/mozbuild/mozbuild/action/check_binary.py @@ -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 diff --git a/xpcom/components/Module.h b/xpcom/components/Module.h index fac3e6ca8d54..37c9a861eb79 100644 --- a/xpcom/components/Module.h +++ b/xpcom/components/Module.h @@ -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) diff --git a/xpcom/components/nsComponentManager.cpp b/xpcom/components/nsComponentManager.cpp index 7486d6964508..3159ef8c2ca3 100644 --- a/xpcom/components/nsComponentManager.cpp +++ b/xpcom/components/nsComponentManager.cpp @@ -280,7 +280,7 @@ static nsTArray* 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)