Add patch: apply V8_TLS_USED_IN_LIBRARY to V8 internal_config#20
Merged
Conversation
V8 already declares the `v8_monolithic_for_shared_library` GN arg, but the only place it adds the `V8_TLS_USED_IN_LIBRARY` define is the `:features` config -- which is consumed only by external embedders, not by the `internal_config` that V8's own `.cc` files use. As a result, V8 internal sources (where the `thread_local Isolate*` etc. live) keep their `local-exec` TLS model and emit `R_X86_64_TPOFF32` relocations that fail to link into a downstream cdylib/.so on Linux. Add the same define to `internal_config` under the same arg, and drop the redundant `v8_monolithic &&` part of the existing `:features` condition (the arg already implies its scope).
2 tasks
github-actions Bot
pushed a commit
that referenced
this pull request
May 21, 2026
Original change's description: > [maglev] Fix deopt literals IdentityMap race during GC > > Maglev used an IdentityMap to store deoptimization literals, assigning > IDs based on the map's size. During concurrent GC, ThinString > shortcutting could merge previously distinct string pointers, causing > the map to rehash and shrink. This led to corrupted IDs and subsequent > out-of-bounds writes in DeoptimizationLiteralArray. > > This CL implements an optimized hybrid approach: > 1. Pair the IdentityMap cache with ZoneVectors to preserve original > insertion order. > 2. Populate the DeoptimizationLiteralArray from the vectors. > 3. Safely canonicalize vector handles using Maglev's persistent > CanonicalHandlesMap. > 4. Optimize compiler::Ref overloads to bypass redundant lookups. > > We also improve V8's runtime testing infrastructure by fixing > OptimizeMaglevOnNextCall's registration in runtime.h to support > variable arguments, enabling native concurrent Maglev testing in JS. > > A robust randomized concurrent regression test is added to verify. > > TAG=agy > CONV=8a5b0da0-ce00-46ee-83f5-9a341372b6f7 > > Fixed: 508811474 > Change-Id: I69bffdbe6736552e273480c8cf23de25af112739 > Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7816278 > Commit-Queue: Leszek Swirski <leszeks@chromium.org> > Reviewed-by: Patrick Thier <pthier@chromium.org> > Auto-Submit: Leszek Swirski <leszeks@chromium.org> > Commit-Queue: Patrick Thier <pthier@chromium.org> > Cr-Commit-Position: refs/heads/main@{#107059} (cherry picked from commit 00f6ecd8a7cca6911789a11b7a7b01aaf41f925b) Bug: 514928956,508811474 Change-Id: I69bffdbe6736552e273480c8cf23de25af112739 Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/7864503 Auto-Submit: chrome-cherry-picker@chops-service-accounts.iam.gserviceaccount.com <chrome-cherry-picker@chops-service-accounts.iam.gserviceaccount.com> Reviewed-by: Patrick Thier <pthier@chromium.org> Reviewed-by: Leszek Swirski <leszeks@chromium.org> Commit-Queue: Leszek Swirski <leszeks@chromium.org> Cr-Commit-Position: refs/branch-heads/14.9@{#20} Cr-Branched-From: 8f08364-refs/heads/14.9.207@{#1} Cr-Branched-From: 8de67b1-refs/heads/main@{#106999}
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds a new floated patch (
patches/0003-...) that fixes a V8 build-system bug surfacing when rusty_v8's archive is linked into a downstreamcdylib/.soon Linux.V8 already declares
v8_monolithic_for_shared_libraryas a GN arg, but the only place it adds theV8_TLS_USED_IN_LIBRARYdefine is the:featuresconfig -- which is consumed only by external embedders, not by theinternal_configthat V8's own.ccfiles use. So V8 internal sources (wherethread_local Isolate* g_current_isolate_etc. live) stay inlocal-execTLS model and emitR_X86_64_TPOFF32relocations:This breaks
V8_FROM_SOURCE=1 cargo buildfor any downstream that links rusty_v8 into a shared library (e.g. Deno'sdenort_desktopcdylib).Patch contents
defines += [ "V8_TLS_USED_IN_LIBRARY" ]toconfig("internal_config")underif (v8_monolithic_for_shared_library).v8_monolithic &&part of the existing:featurescondition (the arg's name already implies the scope, and requiringv8_monolithicexcludes us since rusty_v8 doesn't build thev8_monolithstatic lib target).Companion PR
denoland/rusty_v8#1970 will start passing
v8_monolithic_for_shared_library=trueonce this lands and gets rolled into the next14.7-lkgr-denolandautoroll.Test plan
14.7-lkgr-denoland.V8_FROM_SOURCE=1 cargo buildof Deno'sdenort_desktopcdylib succeeds on Linux.