Skip to content

Commit ffde326

Browse files
committed
v8: include Android trap handler sources
Signed-off-by: luoqianlin <qianlinluo@foxmail.com>
1 parent 71f5b1c commit ffde326

2 files changed

Lines changed: 8 additions & 12 deletions

File tree

‎deps/v8/src/trap-handler/trap-handler.h‎

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,12 @@
1515

1616
namespace v8::internal::trap_handler {
1717

18+
// Android is not supported because its signal and crash reporting behavior
19+
// requires a separate security review.
20+
#if V8_OS_ANDROID
21+
#define V8_TRAP_HANDLER_SUPPORTED false
1822
// X64 on Linux, Windows, MacOS, FreeBSD.
19-
#if V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
23+
#elif V8_HOST_ARCH_X64 && V8_TARGET_ARCH_X64 && \
2024
((V8_OS_LINUX && !V8_OS_ANDROID) || V8_OS_WIN || V8_OS_DARWIN || \
2125
V8_OS_FREEBSD)
2226
#define V8_TRAP_HANDLER_SUPPORTED true
@@ -59,14 +63,6 @@ namespace v8::internal::trap_handler {
5963
#define V8_TRAP_HANDLER_SUPPORTED false
6064
#endif
6165

62-
#if V8_OS_ANDROID && V8_TRAP_HANDLER_SUPPORTED
63-
// It would require some careful security review before the trap handler
64-
// can be enabled on Android. Android may do unexpected things with signal
65-
// handling and crash reporting that could open up security holes in V8's
66-
// trap handling.
67-
#error "The V8 trap handler should not be enabled on Android"
68-
#endif
69-
7066
// Setup for shared library export.
7167
#ifdef V8_OS_WIN
7268

‎tools/v8_gypfiles/v8.gyp‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1172,7 +1172,7 @@
11721172
}],
11731173
['v8_enable_webassembly==1', {
11741174
'conditions': [
1175-
['OS in "linux mac ios freebsd openharmony"', {
1175+
['OS in "linux mac ios freebsd openharmony android"', {
11761176
'sources': [
11771177
'<(V8_ROOT)/src/trap-handler/handler-inside-posix.cc',
11781178
'<(V8_ROOT)/src/trap-handler/handler-outside-posix.cc',
@@ -1200,7 +1200,7 @@
12001200
'conditions': [
12011201
['v8_enable_webassembly==1', {
12021202
'conditions': [
1203-
['((_toolset=="host" and host_arch=="arm64" or _toolset=="target" and target_arch=="arm64") and (OS in "linux mac ios openharmony")) or ((_toolset=="host" and host_arch=="x64" or _toolset=="target" and target_arch=="x64") and (OS in "linux mac openharmony"))', {
1203+
['((_toolset=="host" and host_arch=="arm64" or _toolset=="target" and target_arch=="arm64") and (OS in "linux mac ios openharmony android")) or ((_toolset=="host" and host_arch=="x64" or _toolset=="target" and target_arch=="x64") and (OS in "linux mac openharmony android"))', {
12041204
'sources': [
12051205
'<(V8_ROOT)/src/trap-handler/handler-inside-posix.cc',
12061206
'<(V8_ROOT)/src/trap-handler/handler-outside-posix.cc',
@@ -1212,7 +1212,7 @@
12121212
'<(V8_ROOT)/src/trap-handler/handler-outside-win.cc',
12131213
],
12141214
}],
1215-
['(_toolset=="host" and host_arch=="x64" or _toolset=="target" and target_arch=="x64") and (OS in "linux mac win openharmony")', {
1215+
['(_toolset=="host" and host_arch=="x64" or _toolset=="target" and target_arch=="x64") and (OS in "linux mac win openharmony android")', {
12161216
'sources': [
12171217
'<(V8_ROOT)/src/trap-handler/handler-outside-simulator.cc',
12181218
],

0 commit comments

Comments
 (0)