Skip to content

Static crt multithreaded#179

Merged
ASDAlexander77 merged 3 commits into
mainfrom
static-crt-multithreaded
Jun 30, 2026
Merged

Static crt multithreaded#179
ASDAlexander77 merged 3 commits into
mainfrom
static-crt-multithreaded

Conversation

@ASDAlexander77

Copy link
Copy Markdown
Owner

Static crt multithreaded

ASDAlexander77 and others added 3 commits June 29, 2026 23:54
The generated exe/dll previously linked the dynamic CRT (ucrt[d] +
msvcrt[d]) while the prebuilt LLVM/MLIR libs, the TypeScript runtime
libs and gc.lib all use the static CRT (/MT[d]). Mixing the two gives
the generated program a separate heap and stdout buffer from those
libs, crashing at startup/teardown (0xC0000005), notably for
-emit=dll/-shared and import tests.

Switch the Windows AOT link to the static CRT import names
(libucrt[d] + libcmt[d] + libvcruntime[d]) to match, and drop the
msvcrt[d] DLL-resolution branch that is no longer needed once the
GC/runtime libs are linked statically.

NOTE: requires the 3rdParty gc and LLVM packages to be the /MT builds.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
The Windows shared-test bat wrote fixed-name artifacts (<stem>.obj,
<stem>.dll, <stem>.lib) directly in the shared test/tester cwd, while
the imported-module stem is not unique across test variants - e.g.
decl_class.ts feeds the -shared, -compile-time and -jit variants, and
export_vars2.ts feeds two variants. Under `ctest -j` these run
concurrently and stomp/delete each other's artifacts, causing random
failures (e.g. test-compile-shared-decl-emit-class,
test-compile-shared-export-import-vars-2).

Port the per-test WORKDIR isolation the Linux branch already uses:
create a unique <tempname>_wd dir, cd into it, build/link/run there
(the shared lib keeps its real <stem> name needed for import
resolution but can no longer collide), write .txt/.err to the parent
dir the runner reads from, then remove the dir.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@ASDAlexander77 ASDAlexander77 merged commit 6920b9c into main Jun 30, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant