Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deps: cherry-pick e020aae394 from V8 upstream #14913

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion deps/v8/src/trap-handler/handler-shared.cc
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,14 @@ namespace v8 {
namespace internal {
namespace trap_handler {

THREAD_LOCAL bool g_thread_in_wasm_code = false;
// We declare this as int rather than bool as a workaround for a glibc bug, in
// which the dynamic loader cannot handle executables whose TLS area is only
// 1 byte in size; see https://sourceware.org/bugzilla/show_bug.cgi?id=14898.
THREAD_LOCAL int g_thread_in_wasm_code = false;

static_assert(sizeof(g_thread_in_wasm_code) > 1,
"sizeof(thread_local_var) must be > 1, see "
"https://sourceware.org/bugzilla/show_bug.cgi?id=14898");

size_t gNumCodeObjects = 0;
CodeProtectionInfoListEntry* gCodeObjects = nullptr;
Expand Down
2 changes: 1 addition & 1 deletion deps/v8/src/trap-handler/trap-handler.h
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ inline bool UseTrapHandler() {
return FLAG_wasm_trap_handler && V8_TRAP_HANDLER_SUPPORTED;
}

extern THREAD_LOCAL bool g_thread_in_wasm_code;
extern THREAD_LOCAL int g_thread_in_wasm_code;

inline bool IsThreadInWasm() { return g_thread_in_wasm_code; }

Expand Down