dev preset (Debug) with MSVC 19.42: five CRT-free TLS fixture targets fail to link (unresolved __dyn_tls_on_demand_init) #1087
Closed
opened 2026-11-24 00:55:44 +00:00 by trick-ye
·
6 comments
No Branch/Tag specified
main
codex/indirect-large-backed-views
codex/word3-preflight-check
codex/vertex-table-two-records
codex/live-index-alias
codex/copied-vertex-buffer-srv
codex/windows-stage-test-output
codex/preserve-live-srv-retirement
codex/share-render-target-tracking
codex/sgd5-negative-offset-fixture
coverage-dashboard
codex/mesh-loose-root
codex/mesh86-cache-padding
codex/xmem-scatter-preflight
codex/mesh-depth-ps
codex/indirect-dispatch-refresh
codex/compute-container-index
codex/startup-compute-formatted-load
codex/compute-indirect-producer
codex/compute-atomic-soffset
codex/mesh-dual-handoff
codex/startup-run-sh-watcher-control
codex/queue31-page-alias
codex/indexed-indirect-compute-root
codex/typed-buffer-view-metadata
codex/translated-indexed-address-alias
codex/fixed-mesh-create-result
codex/xmem-section-lease
codex/startup-slot86-mesh-cache
codex/restore-mesh-barrier-iteration
codex/translated-indirect-upload-index
codex/xapu-completion-opt-in
codex/translated-indexed-rect
codex/translated-indexed-indirect
codex/startup-mesh-lds-integration
codex/startup-console-ms24
codex/startup-slot57-mesh-request
codex/indirect-copy-provenance
codex/present-color-producer-trace
codex/compute-dispatch-binding-trace
codex/translated-indirect-table-buffers
codex/indirect-copy-provenance-base
codex/mix-half-literal-source
codex/translated-indirect-draw
codex/xmem-scatter-diagnostics
codex/slot148-recording-upload
codex/slot70-loading-art-verified
codex/command-list-upload-arena
codex/recover-failed-command-list
codex/startup-heap-timing-notes
codex/align-audio-input-timeline
codex/synthetic-depth-export-control
codex/startup-texture1d-on-windows
codex/1629-packed-position-fixture
codex/cpu-srv-refresh
codex/stream-root-srv-draw
codex/audio-mixer-timer
codex/startup-reload-published-shader
codex/priority-integrate-1284
codex/guest-sixteen-page-record
codex/aot-placed-dxr-batch
codex/guest-directory-selection
codex/gamesave-enumerate-read
codex/readme-archive-to-pixels
codex/pe-placed-view-draw
codex/archive-directory-gpu
codex/slot133-dxr-build
codex/materialize-placed-vertex-view
codex/dstorage-directory-offsets
codex/xg-nine-bc-copy
codex/xg-slot10-bc64-arrays
codex/dxr-guest-address-readback
codex/gpu-va-high-bits
codex/clarify-diagnostic-startup-scope
codex/xg-six-levels
codex/typed-derived-blend
codex/english-legal-text-progress
codex/address-bc-4ks
codex/dstorage-bounded-file-read
codex/wide-srv-offsets-menu
codex/startup-memory-srv
codex/bound-view-tail
codex/language-selector-readback
codex/setup-menu-progress
codex/cpu-plane-refresh
codex/startup-ubyte-vertex
codex/presenter-window-selection
codex/startup-uniform-buffer-lane
codex/intro-loop-timing
codex/static-clzero-loops
codex/document-rtx-intro
codex/startup-insertq
codex/nv12-startup-texture
codex/stream-stage-draw
codex/startup-null-uav-format
codex/startup-draw-capture
codex/shorten-windows-checks
codex/dstorage-rfc1950
codex/startup-dump-fence
codex/pr1135-review-base
codex/startup-stream-requests
codex/startup-chroma-view
codex/readme-graphics-pipeline-streams
codex/static-crt-free-tls
codex/arc-140t-rtx-5080-laptop-gpu-reports
codex/main-startup-progress-entry
codex/signed-dxil-catalogue
codex/reloc-free-preferred-base
codex/quad-dpp-bit-mask
codex/raw-srv-bounds
codex/rx9070-31044-hardware-report
codex/gpu-page-source-provenance
codex/runtime-placeholder-interior
codex/gpu-copy-queue-tile-order
codex/pe-pin-external-providers
codex/xmem-placeholder-reservations
codex/xmem-shared-physical-pages
codex/pe-package-startup
codex/xmem-tools-memory-query
codex/cpu-stack-output-import
codex/pe-load-security-cookie
codex/record-three-bvh-retests
codex/cpu-rbp-frame-anchor
codex/xmem-default-startup
codex/record-rtx-3050-ti-9597
codex/docs-readme-start-here
codex/check-compute-mad24-truncation
codex/docs-discord-community
codex/bound-rcx-branch-mutants
codex/rtx5060ti-bvh-62114
codex/837-neutral-readme-disclaimer
codex/record-rtx-3070-ti
codex/title-neutral-public-wording
codex/exe-shadow-frame-submissions
codex/exe-shadow-runtime-chain
codex/readme-polish
codex/gpu-coverage-nov23
codex/spirv-minlod
codex/shadow-shim-device
codex/exe-two-shadow-frames
codex/shim-dispatch-cleanup
codex/fix-spirv-cache-probe
codex/sampler-use
codex/ballot-bit-extract
codex/packed-fma-release
codex/cpu-packed-fma-o2
codex/publish-coverage-dashboard
codex/mesh-cbv-binding-order
codex/spirv-window-fixture
codex/ps-e32-float-uint
codex/ps-cbuffer-reads
codex/fixed-profile-rescan
codex/shim-compute-integration
codex/readme-visible-coverage
codex/readme-research-navigation
codex/integrate-pr-256
codex/indexed-mesh
codex/sampled-coverage
codex/first-ms
codex/dual-ps
codex/ps-attribute
codex/compute-first
codex/ps-export
codex/readme-research-status
codex/ps-layout
codex/blast-window
codex/chart-caption
codex/reviewer-roles
codex/blast-aot
codex/archive-program
codex/crc-stream-program
codex/exe-image-data-chain
codex/local-cpu-fixture-coverage
codex/exe-bound-frame-chain
codex/exe-mapped-comparison
codex/contribution-dependencies
codex/exe-entry-aot
codex/bink-frame-heap-integration
docs/hardware-seven-reports
codex/bink-custom-heap
codex/bink-heap-callers
codex/discussions-entry-points
codex/gpu-community-batch-64
codex/ffx-scratch-writers
codex/generic-project-documentation
codex/ffx-dispatch-rcas
codex/four-windows-gpu-reports
codex/title-neutral-project-wording
codex/community-coverage-provenance
codex/rcas-packed-texels
codex/community-gpu-retests
codex/community-build-and-gpu-reports
codex/ffx-provider-loop
codex/ffx-recurrent-views
codex/ffx-recurrent-resource
codex/amd-wave64-reports
codex/ffx-backend-slots
codex/upscaler-device-init
codex/ffx-context-lifecycle
codex/ffx-version-query
codex/ffx-provider-contract
codex/typed-object-callback
codex/cpu-ordinal-import
codex/chained-cpu-ranges
codex/cpu-import-call
codex/cpu-direct-call
codex/cpu-leaf-aot
codex/community-project-status
codex/script-state-path-replay
codex/script-state-evidence
codex/bc7-resident-tail
codex/bcpack-mip-tail
codex/bc7-texture-draw
codex/asset-ranges
codex/pixel-constants
codex/pixel-aot
codex/pre-exe-workloads
codex/root-signature-device-coverage
engineering/packed-bvh-leaves
engineering/bvh-build-and-update
engineering/intake-root-roundtrip
community/gpu-check-release
community/english-contributor-entry
gpu-check-v0.1.0
Labels
Clear labels
No items
No labels
Milestone
Clear milestone
No items
No milestone
Assignees
Clear assignees
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".
No due date set.
Reference
R0Y00/Xbox2Windows#1087
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from R0Y00/Xbox2Windows. Originally posted by trick-ye on 2026-11-24T00:55:44Z.
Commit or build
I reproduced this on a clean checkout of
e5bfa0c97d5de01a81b02108b2a221b73396f85d, pulled frommainat 00:36 UTC on November 24, 2026, using the existing build directory from45ad903. The twoexe_tlstargets also failed at45ad903. Upstream advanced after that pull; as of 00:50:37 UTC,mainwas at31f9ebb0f01b98ee4581061ad221edde4e9b5643. I have not rebuilt on any later commit. Follow-up to https://github.com/R0Y00/Xbox2Windows/issues/1#issuecomment-7117804760.Reproduction
From the checkout root, in a Visual Studio 2022 x64 developer environment, with
out/pe-envcreated fromrequirements-dev.txt:cmake --preset devsucceeds. At45ad903, without-k 0, the build stopped after the two link failures present at that commit; I did not rune5bfa0cwithout-k 0.Expected behavior
All five fixture targets should link. The
Build and test on Windowsjob at7baa854used MSVC19.52.37029.0and linkedcpu_exe_tlsandcpu_exe_tls_early. That commit did not contain the threeslot0targets, so this job does not establish that they link on MSVC 19.52.Observed behavior
Five targets fail to link, all built from two sources with
/NODEFAULTLIB:cpu_exe_tlsandcpu_exe_tls_early(tests/cpu/exe_tls.cpp), andcpu_exe_tls_slot0,cpu_exe_tls_slot0_enrollandcpu_exe_tls_slot0_pause(tests/cpu/exe_tls_slot0.cpp). They are the onlyFAILED:entries in the keep-going build.Diagnostic for
cpu_exe_tls(the same four symbols forcpu_exe_tls_early):Diagnostic for
cpu_exe_tls_slot0(the same four symbols for the_enrolland_pausetargets):Full linker command for
cpu_exe_tls, as echoed by CMake'svs_link_exe:The other four commands are the same line with the target name replaced in the object directory,
/out:,/implib:and/pdb:(cpu_exe_tls_early,cpu_exe_tls_slot0,cpu_exe_tls_slot0_enroll,cpu_exe_tls_slot0_pause), and withtests\cpu\exe_tls_slot0.cpp.objas the object for the threeslot0targets. The compile flags forexe_tls.cpp.objinbuild.ninjaare/DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /GS- /Zl.What was measured and what is a hypothesis:
__declspec(thread)aggregate from aconstexprfunction (__declspec(thread) Span g_span = make_span();and__declspec(thread) Array t_array = make_array();), and the link errors showmake_spanandmake_arrayemitted as functions that need__chkstk.tests/cpu/exe_tls.cppby hand with this compiler and/O2 /Ob2 /DNDEBUG -MD /GS- /Zl, then linking with the same/ENTRY:exe_entry /NODEFAULTLIBoptions, also fails; there the unresolved references to__chkstkandmemcpycome fromvoid __cdecl `dynamic initializer for 'g_span''(void). I did not run thereleasepreset itself.g_spanfrom a namespace-scopeconstexpr Spanobject instead of the call still leaves__dyn_tls_on_demand_init,__tls_guardand__dyn_tls_initunresolved with the Debug flags, so that change alone is not a fix on this compiler.Not measured: I did not run the four CTest entries that take these executables as arguments (
cpu_native_exe_tls,cpu_native_exe_tls_slot0_windows,cpu_native_exe_tls_slot0,cpu_native_exe_tls_slot0_enroll); the executables do not exist in this build tree. The three smoke tests pass (100% tests passed, 0 tests failed out of 3at45ad903), and no_hardwareor_warptest had the resultNot Runat45ad903.Environment
clidentified by CMake asMSVC 19.42.34436.0Checklist
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by roansystemlabs on 2026-11-24T01:17:21Z.
I'll take the fix for this: reproduce the five unresolved
__dyn_tls_on_demand_initlinks on MSVC 19.42 and on the 19.44 toolset I have locally, find which compiler default pulls the on-demand TLS guard into the CRT-free fixtures, and propose a focused build change so all five targets link on older and current toolsets, with the TLS fixtures re-run on an RTX 3070 and WARP. No change to the fixtures' expected results.AI-assisted.
Imported from R0Y00/Xbox2Windows. Originally posted by iurysf on 2026-11-24T01:18:45Z.
@roansystemlabs, data for your fix: the 19.44 side of the comparison.
I built the
devpreset (Debug) with MSVC 19.44.35215.0 (toolset 14.44.35207, VS 2022 17.14.13, Windows SDK 10.0.26100.0) on Windows 11 build 26300.10075, atb9beb159and again atc77687bc; the TLS fixtures andtools/pe_map.cppare unchanged at the current main (2db96ba).cmake --build --preset dev -- -k 0: 2,103 steps, exit 0, noFAILED:entries. All five CRT-free TLS targets link (cpu_exe_tls,cpu_exe_tls_early,cpu_exe_tls_slot0,cpu_exe_tls_slot0_enroll,cpu_exe_tls_slot0_pause). The same result with Visual Studio's own CMake 3.31.6 and Ninja 1.12.1 (the PATH here has CMake 4.3.3 and Ninja 1.13.2).Linker command for
cpu_exe_tls(the other four differ only in the target name and, for the threeslot0targets, the objectexe_tls_slot0.cpp.obj):Running this exact command by hand for each of the five objects also exits 0 (only warning LNK4210). The compile flags for
exe_tls.cpp.objare the ones in the report (/Od /Ob0 /RTC1 -MDd /GS- /Zl).dumpbin /symbolsonexe_tls.cpp.objandexe_tls_slot0.cpp.objshows no reference to__dyn_tls_on_demand_init,__dyn_tls_init,__tls_guardor__chkstk. The four CTests that run these executables pass (cpu_native_exe_tls,cpu_native_exe_tls_slot0_windows,cpu_native_exe_tls_slot0,cpu_native_exe_tls_slot0_enroll), and so do the three smoke tests.So the five targets fail to link on 19.42.34436 (the report) and link on 19.44.35215 (here) and on 19.52.37029 (CI, on an older commit). My hypothesis, not tested beyond the symbols above, is that the compiler constant-initializes the thread-local aggregate from 19.44 on; I only have this one compiler, so I cannot say which release between 19.42 and 19.44 changed it. If so, Debug builds on 19.42 need either a newer toolset or a source change in the two fixtures.
AI-assisted (OpenBot team).
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-24T01:25:15Z.
I opened #1119 for this. Both arrays now come from the linked static TLS template, while C++ still performs the TLS reads and writes. All five fixture targets linked, and the four native/mapped checks passed in Debug and Release with MSVC 19.51. If you can rerun the build and CTest selection in the PR with 19.42, that will confirm the fix on the original toolset.
Imported from R0Y00/Xbox2Windows. Originally posted by trick-ye on 2026-11-24T03:54:04Z.
Reporter's host, MSVC 19.42: the fix from #1119 works here. At
59eb78126c2f31dc936c002b8cdb2d5629021383(mainwhen pulled at about 03:41 UTC on 2026-11-24, clean tree, existing build directory), thedevbuild has noFAILED:entry and all five targets link.Build log excerpts:
CTest, one run:
Expected: the five targets link and the four checks pass. Observed: both. I ran the
devpreset only, notrelease.One related failure remains on this compiler at the same commit, as already described for 19.42 in https://github.com/R0Y00/Xbox2Windows/pull/1119#issuecomment-7119734544. It is outside the five targets of this issue:
tests/cpu/tls_value.cppstill has__declspec(thread) Span g_span = make_span();. I ran that test once and did not try a change.Environment: Windows 11 Pro build 26200.9974; Visual Studio 2022, MSVC 19.42.34436 (toolset 14.42.34433); Windows SDK 10.0.26100.0; DXC 1.9.2602.17; Python 3.13.0. No graphics adapter is involved.
AI-assisted (Claude Code).
Imported from R0Y00/Xbox2Windows. Originally posted by triggered02 on 2026-11-26T04:02:10Z.
Fixed on main and verified by the reporter, so this can be closed: #1119 ("tests: keep CRT-free EXE templates in static TLS") merged at 2026-11-24T02:07:12Z. @trick-ye confirmed on the 19.42 toolset at
59eb7812that the dev build has no FAILED: entries and all five targets link, which is the reproduction this issue asked for.On current main the template supplies _tls_used/_tls_index and the .tls start/end markers itself ( ests/cpu/exe_tls.cpp:3-4 documents that contract), so the on-demand TLS guard no longer comes from a compiler default that MSVC 19.42 resolved differently.
I cannot close another author's issue from this account � @trick-ye or a maintainer can close it as completed; the fix and the independent confirmation are both in the thread.
Imported from R0Y00/Xbox2Windows. Originally posted by R0Y00 on 2026-11-26T04:23:45Z.
#1119 fixed the five CRT-free EXE targets. The original reporter confirmed on MSVC 19.42 that all five now link and that all four selected Debug TLS tests pass on main
59eb7812. The separate DLL TLS-template failure was tracked in #1465.Reporter’s verification