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
trick-ye commented 2026-11-24 00:55:44 +00:00 (Migrated from github.com)
Contributor

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 from main at 00:36 UTC on November 24, 2026, using the existing build directory from 45ad903. The two exe_tls targets also failed at 45ad903. Upstream advanced after that pull; as of 00:50:37 UTC, main was at 31f9ebb0f01b98ee4581061ad221edde4e9b5643. 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-env created from requirements-dev.txt:

cmake --preset dev
cmake --build --preset dev -- -k 0

cmake --preset dev succeeds. At 45ad903, without -k 0, the build stopped after the two link failures present at that commit; I did not run e5bfa0c without -k 0.

Expected behavior

All five fixture targets should link. The Build and test on Windows job at 7baa854 used MSVC 19.52.37029.0 and linked cpu_exe_tls and cpu_exe_tls_early. That commit did not contain the three slot0 targets, 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_tls and cpu_exe_tls_early (tests/cpu/exe_tls.cpp), and cpu_exe_tls_slot0, cpu_exe_tls_slot0_enroll and cpu_exe_tls_slot0_pause (tests/cpu/exe_tls_slot0.cpp). They are the only FAILED: entries in the keep-going build.

Diagnostic for cpu_exe_tls (the same four symbols for cpu_exe_tls_early):

exe_tls.cpp.obj : error LNK2019: unresolved external symbol __dyn_tls_on_demand_init referenced in function "unsigned int __cdecl `anonymous namespace'::span_changed(void)" (?span_changed@?A0x66730db5@@YAIXZ)
exe_tls.cpp.obj : error LNK2019: unresolved external symbol __chkstk referenced in function "struct A0x66730db5::Span __cdecl `anonymous namespace'::make_span(void)" (?make_span@?A0x66730db5@@YA?AUSpan@1@XZ)
exe_tls.cpp.obj : error LNK2001: unresolved external symbol __tls_guard
exe_tls.cpp.obj : error LNK2001: unresolved external symbol __dyn_tls_init
cpu_exe_tls.exe : fatal error LNK1120: 4 unresolved externals

Diagnostic for cpu_exe_tls_slot0 (the same four symbols for the _enroll and _pause targets):

exe_tls_slot0.cpp.obj : error LNK2019: unresolved external symbol __dyn_tls_on_demand_init referenced in function "bool __cdecl `anonymous namespace'::template_intact(void)" (?template_intact@?A0x40db4b15@@YA_NXZ)
exe_tls_slot0.cpp.obj : error LNK2019: unresolved external symbol __chkstk referenced in function "struct A0x40db4b15::Array __cdecl `anonymous namespace'::make_array(void)" (?make_array@?A0x40db4b15@@YA?AUArray@1@XZ)
exe_tls_slot0.cpp.obj : error LNK2001: unresolved external symbol __tls_guard
exe_tls_slot0.cpp.obj : error LNK2001: unresolved external symbol __dyn_tls_init
cpu_exe_tls_slot0.exe : fatal error LNK1120: 4 unresolved externals

Full linker command for cpu_exe_tls, as echoed by CMake's vs_link_exe:

C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cpu_exe_tls.dir\tests\cpu\exe_tls.cpp.obj /out:cpu_exe_tls.exe /implib:cpu_exe_tls.lib /pdb:cpu_exe_tls.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console /ENTRY:exe_entry /NODEFAULTLIB /SUBSYSTEM:CONSOLE /DYNAMICBASE /INCREMENTAL:NO kernel32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1

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 with tests\cpu\exe_tls_slot0.cpp.obj as the object for the three slot0 targets. The compile flags for exe_tls.cpp.obj in build.ninja are /DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /GS- /Zl.

What was measured and what is a hypothesis:

  • Measured: both sources initialize a __declspec(thread) aggregate from a constexpr function (__declspec(thread) Span g_span = make_span(); and __declspec(thread) Array t_array = make_array();), and the link errors show make_span and make_array emitted as functions that need __chkstk.
  • Measured, outside the build: compiling a copy of tests/cpu/exe_tls.cpp by hand with this compiler and /O2 /Ob2 /DNDEBUG -MD /GS- /Zl, then linking with the same /ENTRY:exe_entry /NODEFAULTLIB options, also fails; there the unresolved references to __chkstk and memcpy come from void __cdecl `dynamic initializer for 'g_span''(void). I did not run the release preset itself.
  • Measured, outside the build: a local variant that initializes g_span from a namespace-scope constexpr Span object instead of the call still leaves __dyn_tls_on_demand_init, __tls_guard and __dyn_tls_init unresolved with the Debug flags, so that change alone is not a fix on this compiler.
  • Hypothesis, not tested: MSVC 19.52 constant-initializes these thread-local objects and 19.42 emits a dynamic initializer for them. I have one compiler version here.

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 3 at 45ad903), and no _hardware or _warp test had the result Not Run at 45ad903.

Environment

  • Windows 11 Pro, build 26200.9974
  • Visual Studio 2022 Community, MSVC 19.42.34436 (toolset 14.42.34433), cl identified by CMake as MSVC 19.42.34436.0
  • Windows SDK 10.0.26100.0, DXC 1.9.2602.17, CMake and Ninja from Visual Studio, Python 3.13.0
  • No graphics adapter is involved in this failure.

Checklist

  • I reproduced this on a source-built input.
  • I did not include game files, dumps, distribution links or credentials.

AI-assisted (Claude Code).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:issue:6572117419 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1094). Originally posted by [trick-ye](https://github.com/trick-ye) on 2026-11-24T00:55:44Z. --- ### Commit or build I reproduced this on a clean checkout of `e5bfa0c97d5de01a81b02108b2a221b73396f85d`, pulled from `main` at 00:36 UTC on November 24, 2026, using the existing build directory from `45ad903`. The two `exe_tls` targets also failed at `45ad903`. Upstream advanced after that pull; as of 00:50:37 UTC, `main` was at `31f9ebb0f01b98ee4581061ad221edde4e9b5643`. 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-env` created from `requirements-dev.txt`: ```powershell cmake --preset dev cmake --build --preset dev -- -k 0 ``` `cmake --preset dev` succeeds. At `45ad903`, without `-k 0`, the build stopped after the two link failures present at that commit; I did not run `e5bfa0c` without `-k 0`. ### Expected behavior All five fixture targets should link. The `Build and test on Windows` job at `7baa854` used MSVC `19.52.37029.0` and linked `cpu_exe_tls` and `cpu_exe_tls_early`. That commit did not contain the three `slot0` targets, 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_tls` and `cpu_exe_tls_early` (`tests/cpu/exe_tls.cpp`), and `cpu_exe_tls_slot0`, `cpu_exe_tls_slot0_enroll` and `cpu_exe_tls_slot0_pause` (`tests/cpu/exe_tls_slot0.cpp`). They are the only `FAILED:` entries in the keep-going build. Diagnostic for `cpu_exe_tls` (the same four symbols for `cpu_exe_tls_early`): ```text exe_tls.cpp.obj : error LNK2019: unresolved external symbol __dyn_tls_on_demand_init referenced in function "unsigned int __cdecl `anonymous namespace'::span_changed(void)" (?span_changed@?A0x66730db5@@YAIXZ) exe_tls.cpp.obj : error LNK2019: unresolved external symbol __chkstk referenced in function "struct A0x66730db5::Span __cdecl `anonymous namespace'::make_span(void)" (?make_span@?A0x66730db5@@YA?AUSpan@1@XZ) exe_tls.cpp.obj : error LNK2001: unresolved external symbol __tls_guard exe_tls.cpp.obj : error LNK2001: unresolved external symbol __dyn_tls_init cpu_exe_tls.exe : fatal error LNK1120: 4 unresolved externals ``` Diagnostic for `cpu_exe_tls_slot0` (the same four symbols for the `_enroll` and `_pause` targets): ```text exe_tls_slot0.cpp.obj : error LNK2019: unresolved external symbol __dyn_tls_on_demand_init referenced in function "bool __cdecl `anonymous namespace'::template_intact(void)" (?template_intact@?A0x40db4b15@@YA_NXZ) exe_tls_slot0.cpp.obj : error LNK2019: unresolved external symbol __chkstk referenced in function "struct A0x40db4b15::Array __cdecl `anonymous namespace'::make_array(void)" (?make_array@?A0x40db4b15@@YA?AUArray@1@XZ) exe_tls_slot0.cpp.obj : error LNK2001: unresolved external symbol __tls_guard exe_tls_slot0.cpp.obj : error LNK2001: unresolved external symbol __dyn_tls_init cpu_exe_tls_slot0.exe : fatal error LNK1120: 4 unresolved externals ``` Full linker command for `cpu_exe_tls`, as echoed by CMake's `vs_link_exe`: ```text C:\PROGRA~1\MICROS~2\2022\COMMUN~1\VC\Tools\MSVC\1442~1.344\bin\Hostx64\x64\link.exe /nologo CMakeFiles\cpu_exe_tls.dir\tests\cpu\exe_tls.cpp.obj /out:cpu_exe_tls.exe /implib:cpu_exe_tls.lib /pdb:cpu_exe_tls.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console /ENTRY:exe_entry /NODEFAULTLIB /SUBSYSTEM:CONSOLE /DYNAMICBASE /INCREMENTAL:NO kernel32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1 ``` 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 with `tests\cpu\exe_tls_slot0.cpp.obj` as the object for the three `slot0` targets. The compile flags for `exe_tls.cpp.obj` in `build.ninja` are `/DWIN32 /D_WINDOWS /EHsc /Zi /Ob0 /Od /RTC1 -MDd /GS- /Zl`. What was measured and what is a hypothesis: - Measured: both sources initialize a `__declspec(thread)` aggregate from a `constexpr` function (`__declspec(thread) Span g_span = make_span();` and `__declspec(thread) Array t_array = make_array();`), and the link errors show `make_span` and `make_array` emitted as functions that need `__chkstk`. - Measured, outside the build: compiling a copy of `tests/cpu/exe_tls.cpp` by hand with this compiler and `/O2 /Ob2 /DNDEBUG -MD /GS- /Zl`, then linking with the same `/ENTRY:exe_entry /NODEFAULTLIB` options, also fails; there the unresolved references to `__chkstk` and `memcpy` come from ``void __cdecl `dynamic initializer for 'g_span''(void)``. I did not run the `release` preset itself. - Measured, outside the build: a local variant that initializes `g_span` from a namespace-scope `constexpr Span` object instead of the call still leaves `__dyn_tls_on_demand_init`, `__tls_guard` and `__dyn_tls_init` unresolved with the Debug flags, so that change alone is not a fix on this compiler. - Hypothesis, not tested: MSVC 19.52 constant-initializes these thread-local objects and 19.42 emits a dynamic initializer for them. I have one compiler version here. 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 3` at `45ad903`), and no `_hardware` or `_warp` test had the result `Not Run` at `45ad903`. ### Environment - Windows 11 Pro, build 26200.9974 - Visual Studio 2022 Community, MSVC 19.42.34436 (toolset 14.42.34433), `cl` identified by CMake as `MSVC 19.42.34436.0` - Windows SDK 10.0.26100.0, DXC 1.9.2602.17, CMake and Ninja from Visual Studio, Python 3.13.0 - No graphics adapter is involved in this failure. ### Checklist - [x] I reproduced this on a source-built input. - [x] I did not include game files, dumps, distribution links or credentials. AI-assisted (Claude Code).
roansystemlabs commented 2026-11-24 06:50:01 +00:00 (Migrated from github.com)
Author
Contributor

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_init links 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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7118951715 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1094#issuecomment-7118951715). Originally posted by [roansystemlabs](https://github.com/roansystemlabs) on 2026-11-24T01:17:21Z. --- I'll take the fix for this: reproduce the five unresolved `__dyn_tls_on_demand_init` links 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.
iurysf commented 2026-11-24 06:50:01 +00:00 (Migrated from github.com)
Author
Contributor

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 dev preset (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, at b9beb159 and again at c77687bc; the TLS fixtures and tools/pe_map.cpp are unchanged at the current main (2db96ba). cmake --build --preset dev -- -k 0: 2,103 steps, exit 0, no FAILED: 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 three slot0 targets, the object exe_tls_slot0.cpp.obj):

"<VS 2022>\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\link.exe" /nologo CMakeFiles\cpu_exe_tls.dir\tests\cpu\exe_tls.cpp.obj /out:cpu_exe_tls.exe /implib:cpu_exe_tls.lib /pdb:cpu_exe_tls.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console /ENTRY:exe_entry /NODEFAULTLIB /SUBSYSTEM:CONSOLE /DYNAMICBASE /INCREMENTAL:NO kernel32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1

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.obj are the ones in the report (/Od /Ob0 /RTC1 -MDd /GS- /Zl). dumpbin /symbols on exe_tls.cpp.obj and exe_tls_slot0.cpp.obj shows no reference to __dyn_tls_on_demand_init, __dyn_tls_init, __tls_guard or __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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7118975188 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1094#issuecomment-7118975188). Originally posted by [iurysf](https://github.com/iurysf) on 2026-11-24T01:18:45Z. --- @roansystemlabs, data for your fix: the 19.44 side of the comparison. I built the `dev` preset (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, at `b9beb159` and again at `c77687bc`; the TLS fixtures and `tools/pe_map.cpp` are unchanged at the current main (`2db96ba`). `cmake --build --preset dev -- -k 0`: 2,103 steps, exit 0, no `FAILED:` 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 three `slot0` targets, the object `exe_tls_slot0.cpp.obj`): ```text "<VS 2022>\VC\Tools\MSVC\14.44.35207\bin\Hostx64\x64\link.exe" /nologo CMakeFiles\cpu_exe_tls.dir\tests\cpu\exe_tls.cpp.obj /out:cpu_exe_tls.exe /implib:cpu_exe_tls.lib /pdb:cpu_exe_tls.pdb /version:0.0 /machine:x64 /debug /INCREMENTAL /subsystem:console /ENTRY:exe_entry /NODEFAULTLIB /SUBSYSTEM:CONSOLE /DYNAMICBASE /INCREMENTAL:NO kernel32.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib /MANIFEST:EMBED,ID=1 ``` 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.obj` are the ones in the report (`/Od /Ob0 /RTC1 -MDd /GS- /Zl`). `dumpbin /symbols` on `exe_tls.cpp.obj` and `exe_tls_slot0.cpp.obj` shows no reference to `__dyn_tls_on_demand_init`, `__dyn_tls_init`, `__tls_guard` or `__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).
R0Y00 commented 2026-11-24 06:50:02 +00:00 (Migrated from github.com)
Author
Contributor

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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7119082418 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1094#issuecomment-7119082418). Originally posted by [R0Y00](https://github.com/R0Y00) on 2026-11-24T01:25:15Z. --- I opened [#1119](https://github.com/R0Y00/Xbox2Windows/pull/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.
trick-ye commented 2026-11-24 06:50:16 +00:00 (Migrated from github.com)
Author
Contributor

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 (main when pulled at about 03:41 UTC on 2026-11-24, clean tree, existing build directory), the dev build has no FAILED: entry and all five targets link.

cmake --preset dev
cmake --build --preset dev -- -k 0
ctest --preset dev --no-tests=error -R '^cpu_native_exe_tls($|_slot0)' -V

Build log excerpts:

[1322/1360] Linking CXX executable cpu_exe_tls.exe
[1323/1360] Linking CXX executable cpu_exe_tls_early.exe
[1325/1360] Linking CXX executable cpu_exe_tls_slot0.exe
[1327/1360] Linking CXX executable cpu_exe_tls_slot0_pause.exe
[1328/1360] Linking CXX executable cpu_exe_tls_slot0_enroll.exe

CTest, one run:

1/4 Test #415: cpu_native_exe_tls .................   Passed    1.40 sec
2/4 Test #416: cpu_native_exe_tls_slot0_windows ...   Passed    0.14 sec
3/4 Test #417: cpu_native_exe_tls_slot0 ...........   Passed    0.25 sec
4/4 Test #418: cpu_native_exe_tls_slot0_enroll ....   Passed    0.18 sec
100% tests passed, 0 tests failed out of 4

Expected: the five targets link and the four checks pass. Observed: both. I ran the dev preset only, not release.

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:

ctest --preset dev --no-tests=error -R '^cpu_native_tls_value$' -V
AssertionError: cpu_tls_value.dll: the 8 KiB array is not in the TLS template
0% tests passed, 1 tests failed out of 1

tests/cpu/tls_value.cpp still 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).

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7121524592 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1094#issuecomment-7121524592). Originally posted by [trick-ye](https://github.com/trick-ye) on 2026-11-24T03:54:04Z. --- Reporter's host, MSVC 19.42: the fix from #1119 works here. At `59eb78126c2f31dc936c002b8cdb2d5629021383` (`main` when pulled at about 03:41 UTC on 2026-11-24, clean tree, existing build directory), the `dev` build has no `FAILED:` entry and all five targets link. ```powershell cmake --preset dev cmake --build --preset dev -- -k 0 ctest --preset dev --no-tests=error -R '^cpu_native_exe_tls($|_slot0)' -V ``` Build log excerpts: ```text [1322/1360] Linking CXX executable cpu_exe_tls.exe [1323/1360] Linking CXX executable cpu_exe_tls_early.exe [1325/1360] Linking CXX executable cpu_exe_tls_slot0.exe [1327/1360] Linking CXX executable cpu_exe_tls_slot0_pause.exe [1328/1360] Linking CXX executable cpu_exe_tls_slot0_enroll.exe ``` CTest, one run: ```text 1/4 Test #415: cpu_native_exe_tls ................. Passed 1.40 sec 2/4 Test #416: cpu_native_exe_tls_slot0_windows ... Passed 0.14 sec 3/4 Test #417: cpu_native_exe_tls_slot0 ........... Passed 0.25 sec 4/4 Test #418: cpu_native_exe_tls_slot0_enroll .... Passed 0.18 sec 100% tests passed, 0 tests failed out of 4 ``` Expected: the five targets link and the four checks pass. Observed: both. I ran the `dev` preset only, not `release`. 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: ```powershell ctest --preset dev --no-tests=error -R '^cpu_native_tls_value$' -V ``` ```text AssertionError: cpu_tls_value.dll: the 8 KiB array is not in the TLS template 0% tests passed, 1 tests failed out of 1 ``` `tests/cpu/tls_value.cpp` still 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).
triggered02 commented 2026-11-26 04:04:43 +00:00 (Migrated from github.com)
Author
Contributor

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 59eb7812 that 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.

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182237013 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1094#issuecomment-7182237013). Originally posted by [triggered02](https://github.com/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 59eb7812 that 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.
R0Y00 commented 2026-11-26 05:02:25 +00:00 (Migrated from github.com)
Author
Contributor

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

<!-- greyfinch-sync:R0Y00/Xbox2Windows:comment:7182556907 --> Imported from [R0Y00/Xbox2Windows](https://github.com/R0Y00/Xbox2Windows/issues/1094#issuecomment-7182556907). Originally posted by [R0Y00](https://github.com/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](https://github.com/R0Y00/Xbox2Windows/issues/1094#issuecomment-7121524592)
Sign in to join this conversation.
No labels
No milestone
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
No description provided.