2017-02-09 04:52:55 +03:00
|
|
|
# -*- Mode: python; indent-tabs-mode: nil; tab-width: 40 -*-
|
|
|
|
# vim: set filetype=python:
|
|
|
|
# This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
# License, v. 2.0. If a copy of the MPL was not distributed with this
|
|
|
|
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
|
|
|
|
|
2015-06-05 23:03:11 +03:00
|
|
|
FINAL_LIBRARY = 'mozglue'
|
|
|
|
|
|
|
|
EXPORTS.mozilla += [
|
2017-06-07 05:36:26 +03:00
|
|
|
'AutoProfilerLabel.h',
|
2019-05-29 09:57:28 +03:00
|
|
|
'decimal/Decimal.h',
|
2020-03-17 07:11:20 +03:00
|
|
|
'decimal/DoubleConversion.h',
|
2017-02-09 04:52:55 +03:00
|
|
|
'PlatformConditionVariable.h',
|
|
|
|
'PlatformMutex.h',
|
2017-01-13 20:25:59 +03:00
|
|
|
'Printf.h',
|
2015-06-10 23:32:45 +03:00
|
|
|
'StackWalk.h',
|
2015-06-05 23:03:11 +03:00
|
|
|
'TimeStamp.h',
|
|
|
|
]
|
|
|
|
|
2019-03-06 03:51:15 +03:00
|
|
|
EXPORTS.mozilla.glue += [
|
|
|
|
'Debug.h',
|
2019-09-23 23:18:41 +03:00
|
|
|
'WinUtils.h',
|
2019-03-06 03:51:15 +03:00
|
|
|
]
|
|
|
|
|
2015-06-05 23:03:11 +03:00
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
|
|
|
EXPORTS.mozilla += [
|
2016-09-16 07:35:14 +03:00
|
|
|
'StackWalk_windows.h',
|
2015-06-05 23:03:11 +03:00
|
|
|
'TimeStamp_windows.h',
|
|
|
|
]
|
|
|
|
|
|
|
|
SOURCES += [
|
2017-06-21 23:26:16 +03:00
|
|
|
'AutoProfilerLabel.cpp',
|
2017-01-13 20:25:59 +03:00
|
|
|
'Printf.cpp',
|
2016-12-21 02:11:36 +03:00
|
|
|
'StackWalk.cpp',
|
2015-06-05 23:03:11 +03:00
|
|
|
'TimeStamp.cpp',
|
|
|
|
]
|
|
|
|
|
|
|
|
OS_LIBS += CONFIG['REALTIME_LIBS']
|
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
Bug 1526383: Add essential arm64 support to nsWindowsDllInterceptor; r=handyman
This patch doesn't cover all possible functions for which we currently
instantiate interceptors inside Firefox/Gecko. Rather than asserting, we just
fail in those cases (at least until we have full coverage of existing uses).
This is okay, as for the upcoming milestone 2 of aarch64 builds, we are most
concerned with successfully being able to hook the following functions:
ntdll!LdrLoadDll
ntdll!LdrUnloadDll
ntdll!LdrResolveDelayLoadedAPI
user32!GetWindowInfo
So, within that context, the aarch64 implementation is fairly simple:
Each instruction is 4-bytes wide. We iterate down each instruction, and if the
current instruction is *not* PC-relative, we just copy it verbatim. If we
encounter an instruction that *is* PC-relative, we either decode it and
rewrite it inside the trampoline, or we fail. For the purposes of milestone 2,
the only instruction that is essential to decode is ADRP.
In bug 1526016 I modify TestDllInterceptor to exclude functions that are not
yet supported by this patch.
Differential Revision: https://phabricator.services.mozilla.com/D19446
--HG--
extra : moz-landing-system : lando
2019-02-21 21:41:17 +03:00
|
|
|
DIRS += [
|
|
|
|
'interceptor',
|
|
|
|
]
|
2018-04-09 22:37:52 +03:00
|
|
|
EXPORTS += [
|
|
|
|
'nsWindowsDllInterceptor.h',
|
|
|
|
]
|
2018-04-05 01:31:43 +03:00
|
|
|
EXPORTS.mozilla += [
|
|
|
|
'DynamicallyLinkedFunctionPtr.h',
|
2019-04-12 22:58:01 +03:00
|
|
|
'ImportDir.h',
|
2019-01-16 02:10:00 +03:00
|
|
|
'NativeNt.h',
|
2018-04-05 01:31:43 +03:00
|
|
|
'WindowsMapRemoteView.h',
|
2019-04-22 22:13:23 +03:00
|
|
|
'WindowsProcessMitigations.h',
|
2018-04-05 01:31:43 +03:00
|
|
|
]
|
2019-09-23 23:18:41 +03:00
|
|
|
EXPORTS.mozilla.glue += [
|
|
|
|
'WindowsUnicode.h',
|
|
|
|
]
|
2015-06-05 23:03:11 +03:00
|
|
|
SOURCES += [
|
|
|
|
'TimeStamp_windows.cpp',
|
2018-04-05 01:31:43 +03:00
|
|
|
'WindowsMapRemoteView.cpp',
|
2019-04-22 22:13:23 +03:00
|
|
|
'WindowsProcessMitigations.cpp',
|
2019-09-23 23:18:41 +03:00
|
|
|
'WindowsUnicode.cpp',
|
2015-06-05 23:03:11 +03:00
|
|
|
]
|
2015-06-10 23:32:45 +03:00
|
|
|
OS_LIBS += ['dbghelp']
|
2015-06-05 23:03:11 +03:00
|
|
|
elif CONFIG['HAVE_CLOCK_MONOTONIC']:
|
|
|
|
SOURCES += [
|
|
|
|
'TimeStamp_posix.cpp',
|
|
|
|
]
|
|
|
|
elif CONFIG['OS_ARCH'] == 'Darwin':
|
|
|
|
SOURCES += [
|
|
|
|
'TimeStamp_darwin.cpp',
|
|
|
|
]
|
|
|
|
elif CONFIG['COMPILE_ENVIRONMENT']:
|
|
|
|
error('No TimeStamp implementation on this platform. Build will not succeed')
|
2017-02-09 04:52:55 +03:00
|
|
|
|
|
|
|
if CONFIG['OS_ARCH'] == 'WINNT':
|
|
|
|
SOURCES += [
|
|
|
|
'ConditionVariable_windows.cpp',
|
|
|
|
'Mutex_windows.cpp',
|
|
|
|
]
|
|
|
|
else:
|
|
|
|
SOURCES += [
|
|
|
|
'ConditionVariable_posix.cpp',
|
|
|
|
'Mutex_posix.cpp',
|
|
|
|
]
|
2019-05-29 09:57:28 +03:00
|
|
|
|
2019-11-21 17:57:24 +03:00
|
|
|
if CONFIG['MOZ_LINKER'] or CONFIG['MOZ_WIDGET_TOOLKIT'] == 'android':
|
2019-09-24 23:50:41 +03:00
|
|
|
LOCAL_INCLUDES += [
|
|
|
|
'/mozglue/linker',
|
|
|
|
]
|
|
|
|
|
2019-05-29 09:57:28 +03:00
|
|
|
SOURCES += [
|
|
|
|
'decimal/Decimal.cpp',
|
|
|
|
]
|
|
|
|
|
|
|
|
if CONFIG['CC_TYPE'] == 'clang':
|
|
|
|
# Suppress warnings from third-party V8 Decimal code.
|
|
|
|
SOURCES['decimal/Decimal.cpp'].flags += ['-Wno-implicit-fallthrough']
|