Commit 9e52070
authored
fix: shared-library-safe V8 TLS on Linux via v8_monolithic_for_shared_library (#2008)
On Linux, V8's default "local-exec" TLS model emits R_X86_64_TPOFF32
relocations against thread-locals such as g_current_isolate_. lld refuses
to place those in a -shared object, so downstream crates that link the
rusty_v8 static archive into a cdylib fail to link.
The previous attempt injected `extra_cflags=["-DV8_TLS_USED_IN_LIBRARY"]`,
but `extra_cflags` is not a declared GN build arg in the chromium_build
fork, so the define never reached V8's compilation and the archive still
carried TPOFF32 relocations.
Instead set the V8-sanctioned `v8_monolithic_for_shared_library=true` GN
arg, which routes the V8_TLS_USED_IN_LIBRARY define into both
internal_config and the features config — covering V8's own sources and
rusty_v8's bindings alike — switching to the local-dynamic TLS model with
an out-of-line accessor.1 parent 7e2d4a2 commit 9e52070
1 file changed
Lines changed: 18 additions & 26 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
353 | 353 | | |
354 | 354 | | |
355 | 355 | | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | | - | |
364 | | - | |
365 | | - | |
366 | | - | |
367 | | - | |
368 | | - | |
369 | | - | |
370 | | - | |
371 | | - | |
372 | | - | |
373 | | - | |
374 | | - | |
375 | | - | |
376 | | - | |
377 | | - | |
378 | | - | |
379 | | - | |
| 356 | + | |
| 357 | + | |
| 358 | + | |
| 359 | + | |
380 | 360 | | |
381 | | - | |
382 | | - | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
| 365 | + | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
| 369 | + | |
| 370 | + | |
| 371 | + | |
| 372 | + | |
| 373 | + | |
| 374 | + | |
383 | 375 | | |
384 | 376 | | |
385 | 377 | | |
| |||
0 commit comments