Static crt multithreaded#179
Merged
Merged
Conversation
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>
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.
Static crt multithreaded