This repository was archived by the owner on Aug 31, 2018. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Expand file tree Collapse file tree 2 files changed +9
-2
lines changed Original file line number Diff line number Diff line change @@ -23,7 +23,14 @@ namespace v8 {
2323namespace internal {
2424namespace trap_handler {
2525
26- THREAD_LOCAL bool g_thread_in_wasm_code = false ;
26+ // We declare this as int rather than bool as a workaround for a glibc bug, in
27+ // which the dynamic loader cannot handle executables whose TLS area is only
28+ // 1 byte in size; see https://sourceware.org/bugzilla/show_bug.cgi?id=14898.
29+ THREAD_LOCAL int g_thread_in_wasm_code = false ;
30+
31+ static_assert (sizeof (g_thread_in_wasm_code) > 1 ,
32+ " sizeof(thread_local_var) must be > 1, see "
33+ " https://sourceware.org/bugzilla/show_bug.cgi?id=14898" );
2734
2835size_t gNumCodeObjects = 0 ;
2936CodeProtectionInfoListEntry* gCodeObjects = nullptr ;
Original file line number Diff line number Diff line change @@ -65,7 +65,7 @@ inline bool UseTrapHandler() {
6565 return FLAG_wasm_trap_handler && V8_TRAP_HANDLER_SUPPORTED;
6666}
6767
68- extern THREAD_LOCAL bool g_thread_in_wasm_code;
68+ extern THREAD_LOCAL int g_thread_in_wasm_code;
6969
7070inline bool IsThreadInWasm () { return g_thread_in_wasm_code; }
7171
You can’t perform that action at this time.
0 commit comments