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",
|
2021-04-20 20:24:24 +03:00
|
|
|
"AwakeTimeStamp.h",
|
2019-05-29 09:57:28 +03:00
|
|
|
"decimal/Decimal.h",
|
2020-03-17 07:11:20 +03:00
|
|
|
"decimal/DoubleConversion.h",
|
2021-03-11 02:52:39 +03:00
|
|
|
"IntegerPrintfMacros.h",
|
2020-04-11 00:16:15 +03:00
|
|
|
"MmapFaultHandler.h",
|
2017-02-09 04:52:55 +03:00
|
|
|
"PlatformConditionVariable.h",
|
|
|
|
"PlatformMutex.h",
|
2017-01-13 20:25:59 +03:00
|
|
|
"Printf.h",
|
2021-03-11 02:52:39 +03:00
|
|
|
"Sprintf.h",
|
2015-06-10 23:32:45 +03:00
|
|
|
"StackWalk.h",
|
2015-06-05 23:03:11 +03:00
|
|
|
"TimeStamp.h",
|
2021-01-12 15:34:59 +03:00
|
|
|
"Uptime.h",
|
2015-06-05 23:03:11 +03:00
|
|
|
]
|
|
|
|
|
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 += [
|
2020-09-24 17:25:56 +03:00
|
|
|
"PreXULSkeletonUI.h",
|
2016-09-16 07:35:14 +03:00
|
|
|
"StackWalk_windows.h",
|
2021-03-23 00:25:29 +03:00
|
|
|
"StackWalkThread.h",
|
2015-06-05 23:03:11 +03:00
|
|
|
"TimeStamp_windows.h",
|
2020-09-16 23:14:40 +03:00
|
|
|
"WindowsDpiAwareness.h",
|
2015-06-05 23:03:11 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
SOURCES += [
|
2017-06-21 23:26:16 +03:00
|
|
|
"AutoProfilerLabel.cpp",
|
2021-04-20 20:24:24 +03:00
|
|
|
"AwakeTimeStamp.cpp",
|
2020-04-11 00:16:15 +03:00
|
|
|
"MmapFaultHandler.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",
|
2021-01-12 15:34:59 +03:00
|
|
|
"Uptime.cpp",
|
2015-06-05 23:03:11 +03:00
|
|
|
]
|
|
|
|
|
|
|
|
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",
|
2021-05-19 21:01:47 +03:00
|
|
|
"WindowsEnumProcessModules.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 += [
|
2020-09-24 17:25:56 +03:00
|
|
|
"PreXULSkeletonUI.cpp",
|
2015-06-05 23:03:11 +03:00
|
|
|
"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",
|
|
|
|
]
|
2021-04-08 11:02:16 +03:00
|
|
|
# WASI hasn't supported cond vars and mutexes yet so noop implementation is used.
|
|
|
|
elif CONFIG["OS_ARCH"] == "WASI":
|
|
|
|
SOURCES += [
|
|
|
|
"ConditionVariable_noop.cpp",
|
|
|
|
"Mutex_noop.cpp",
|
|
|
|
]
|
2017-02-09 04:52:55 +03:00
|
|
|
else:
|
|
|
|
SOURCES += [
|
|
|
|
"ConditionVariable_posix.cpp",
|
|
|
|
"Mutex_posix.cpp",
|
|
|
|
]
|
2019-05-29 09:57:28 +03:00
|
|
|
|
2020-07-09 00:37:24 +03:00
|
|
|
if CONFIG["MOZ_LINKER"] and 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"]
|
2020-09-15 17:50:19 +03:00
|
|
|
|
|
|
|
for var in ("MOZ_APP_BASENAME", "MOZ_APP_VENDOR"):
|
|
|
|
DEFINES[var] = '"%s"' % CONFIG[var]
|