1 # -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
2 # vim: set filetype=python:
3 # This Source Code Form is subject to the terms of the Mozilla Public
4 # License, v. 2.0. If a copy of the MPL was not distributed with this
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/.
7 # Build mozglue as a shared lib on Windows, OSX and Android. But not for
9 # If this is ever changed, update MOZ_SHARED_MOZGLUE in browser/installer/Makefile.in
10 if CONFIG['JS_STANDALONE'] and not CONFIG['MOZ_MEMORY']:
12 elif CONFIG['OS_TARGET'] in ('WINNT', 'Darwin', 'Android'):
13 SharedLibrary('mozglue')
17 if CONFIG['OS_TARGET'] == 'Android':
22 if CONFIG['MOZ_ASAN']:
27 if CONFIG['MOZ_UBSAN']:
32 if CONFIG['OS_TARGET'] == 'WINNT':
33 DEFFILE = '!mozglue.def'
34 # We'll break the DLL blocklist if we immediately load user32.dll
38 RCINCLUDE = 'mozglue.rc'
40 if CONFIG['MOZ_PGO'] and CONFIG['CC_TYPE'] == 'clang-cl':
41 SOURCES += ['cygprofile.cpp']
42 SOURCES['cygprofile.cpp'].pgo_generate_only = True
44 if CONFIG['MOZ_WIDGET_TOOLKIT']:
46 if CONFIG['MOZ_MEMORY'] and FORCE_SHARED_LIB:
48 # TODO: SHARED_LIBRARY_LIBS go here
50 # Temporary, until bug 662814 lands
56 if CONFIG['OS_TARGET'] == 'WINNT':
63 'UntrustedDllsHandler.cpp',
64 'WindowsDllBlocklist.cpp',
79 'WindowsDllBlocklistCommon.h',
80 'WindowsDllBlocklistDefs.h',
82 EXPORTS.mozilla.glue += [
83 'WindowsDllServices.h',
88 if CONFIG['CPU_ARCH'] == 'aarch64':
97 'WindowsDllBlocklist.h',
100 if CONFIG['CPU_ARCH'].startswith('x86'):
105 if CONFIG['CPU_ARCH'] == 'arm':
110 if CONFIG['CPU_ARCH'].startswith('mips'):
115 if CONFIG['MOZ_LINKER']:
124 DEFINES['IMPL_MFBT'] = True
125 LIBRARY_DEFINES['MOZ_HAS_MOZGLUE'] = True
127 if CONFIG['OS_TARGET'] == 'Darwin':
128 # On OSX 10.10.3, a dead lock happens in some cases involving dynamic
129 # symbol resolution for symbols that jemalloc itself uses. While it
130 # might be possible to find a way to avoid all such symbol resolutions,
131 # it's currently not possible because at the very least there's a call
132 # to pthread_self from tsd_init_check_recursion, which is necessary
133 # because somehow clang doesn't want to accept the __thread keyword
135 LDFLAGS += ['-Wl,-bind_at_load']
137 if CONFIG['MOZ_LINKER'] and CONFIG['CPU_ARCH'] == 'arm':
138 LDFLAGS += ['-Wl,-version-script,%s/arm-eabi-filter' % SRCDIR]