From 6c1ee83fa99c634dd5c3503c40f725bef4dadd59 Mon Sep 17 00:00:00 2001 From: ASDAlexander77 Date: Fri, 25 Sep 2026 11:13:15 +0100 Subject: [PATCH 1/2] Stop shipping LLVMSupport and LLVMDemangle in the release packages Since #333 no compiled program links an LLVM library: the linker never gets the --llvm-lib-path folder, only the default-lib build environment and the cmake/vscode templates do. Drop LLVMSupport.lib from the Windows zip and libLLVMSupport.a/libLLVMDemangle.a from the Linux tarballs, and from the memory-model measuring script's link line. Co-Authored-By: Claude Opus 5.5 (1M context) --- .github/workflows/create-release.yml | 8 +++----- scripts/measure_memory_model.ps1 | 5 ++--- 2 files changed, 5 insertions(+), 8 deletions(-) diff --git a/.github/workflows/create-release.yml b/.github/workflows/create-release.yml index 0128c09fc..60c149bff 100644 --- a/.github/workflows/create-release.yml +++ b/.github/workflows/create-release.yml @@ -184,8 +184,8 @@ jobs: GC_SHARED_LIB_PATH: ${{github.workspace}}/3rdParty/gcdll/x64/release/lib LLVM_LIB_PATH: ${{github.workspace}}/3rdParty/llvm/x64/release/lib TSLANG_LIB_PATH: ${{github.workspace}}/__build/tslang/msbuild/x64/release/lib - # This package ships only release-CRT (/MT) builds of TypeScriptAsyncRuntime.lib, gc.lib - # and LLVMSupport.lib, so the debug archive has to be /MT too or a `--di` program cannot + # This package ships only release-CRT (/MT) builds of TypeScriptAsyncRuntime.lib and + # gc.lib, so the debug archive has to be /MT too or a `--di` program cannot # link with them (LNK2038). It keeps its debug info. See DefaultLib's build_core.bat. TSLANG_DEBUG_CRT: /MT run: | @@ -230,7 +230,7 @@ jobs: run: | New-Item -ItemType Directory -Force -Path .\gcdll_stage\gcdll | Out-Null Copy-Item -Path ..\3rdParty\gcdll\x64\release\lib\gc.lib, ..\3rdParty\gcdll\x64\release\bin\gc.dll -Destination .\gcdll_stage\gcdll -ErrorAction Stop - Get-ChildItem -Path .\tslang\msbuild\x64\release\bin\tslang.exe, .\tslang\msbuild\x64\release\bin\TypeScriptRuntime.dll, .\tslang\msbuild\x64\release\bin\gc.dll, .\gc\msbuild\x64\release\${{ env.BUILD_TYPE }}\gc.lib, .\tslang\msbuild\x64\release\lib\TypeScriptAsyncRuntime.lib, ..\3rdParty\llvm\x64\release\lib\LLVMSupport.lib, ..\3rdParty\llvm\x64\release\bin\wasm-ld.exe, ..\TypeScriptCompilerDefaultLib\__build, .\gcdll_stage | Compress-Archive -DestinationPath ..\${{ env.ASSET_NAME }}-windows-x64.zip + Get-ChildItem -Path .\tslang\msbuild\x64\release\bin\tslang.exe, .\tslang\msbuild\x64\release\bin\TypeScriptRuntime.dll, .\tslang\msbuild\x64\release\bin\gc.dll, .\gc\msbuild\x64\release\${{ env.BUILD_TYPE }}\gc.lib, .\tslang\msbuild\x64\release\lib\TypeScriptAsyncRuntime.lib, ..\3rdParty\llvm\x64\release\bin\wasm-ld.exe, ..\TypeScriptCompilerDefaultLib\__build, .\gcdll_stage | Compress-Archive -DestinationPath ..\${{ env.ASSET_NAME }}-windows-x64.zip shell: pwsh - name: Archive Zip of Windows Asset @@ -435,8 +435,6 @@ jobs: cp ./gc/ninja/release/libgc.a ./__stage/ cp ./tslang/ninja/release/lib/libTypeScriptAsyncRuntime.a ./__stage/ cp ../3rdParty/llvm/release/bin/wasm-ld ./__stage/ - cp ../3rdParty/llvm/release/lib/libLLVMSupport.a ./__stage/ - cp ../3rdParty/llvm/release/lib/libLLVMDemangle.a ./__stage/ # Add the default library as a whole tree so its per-build, per-memory-model # subfolders are preserved: defaultlib/{dll,lib}/{debug,release}/{gc,rc,none}, # defaultlib/*.d.ts, defaultlib/generics/ diff --git a/scripts/measure_memory_model.ps1 b/scripts/measure_memory_model.ps1 index 08a65a21c..d1ca00797 100644 --- a/scripts/measure_memory_model.ps1 +++ b/scripts/measure_memory_model.ps1 @@ -54,13 +54,12 @@ public static class PeakWs { $bin = "I:/TypeScriptCompiler/__build/tslang/windows-msbuild-2026-release/bin" $lib = "I:/TypeScriptCompiler/__build/tslang/windows-msbuild-2026-release/lib" $lld = "I:/TypeScriptCompiler/tslang/../3rdParty/llvm/x64/release/bin" -$llvmlib = "I:/TypeScriptCompiler/tslang/../3rdParty/llvm/x64/release/lib" $gclib = "I:/TypeScriptCompiler/3rdParty/gc/x64/release/lib" $vclib = "C:/Program Files/Microsoft Visual Studio/18/Professional/VC/Tools/MSVC/14.51.36231/lib/x64" $sdk = "C:/Program Files (x86)/Windows Kits/10/Lib/10.0.28000.0/um/x64" $ucrt = "C:/Program Files (x86)/Windows Kits/10/Lib/10.0.28000.0/ucrt/x64" -$libs = "libcmt.lib libvcruntime.lib libucrt.lib ntdll.lib TypeScriptAsyncRuntime.lib gc.lib LLVMSupport.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" +$libs = "libcmt.lib libvcruntime.lib libucrt.lib ntdll.lib TypeScriptAsyncRuntime.lib gc.lib kernel32.lib user32.lib gdi32.lib winspool.lib shell32.lib ole32.lib oleaut32.lib uuid.lib comdlg32.lib advapi32.lib" $stem = [System.IO.Path]::GetFileNameWithoutExtension($Source) $work = Join-Path $env:TEMP "measure-$stem" @@ -84,7 +83,7 @@ foreach ($m in $Models) { } $link = & "$lld/lld.exe" -flavor link $objs "/out:$exe" $libs.Split(' ') ` - "/libpath:$gclib" "/libpath:$llvmlib" "/libpath:$lib" "/libpath:$vclib" "/libpath:$sdk" "/libpath:$ucrt" 2>&1 + "/libpath:$gclib" "/libpath:$lib" "/libpath:$vclib" "/libpath:$sdk" "/libpath:$ucrt" 2>&1 if ($LASTEXITCODE -ne 0) { "{0,-5} LINK FAILED ({1})" -f $m, $LASTEXITCODE; $link | Select-Object -Last 3; continue } $p = Start-Process -FilePath $exe -PassThru -NoNewWindow -RedirectStandardOutput "$work\$stem-$m.out" -RedirectStandardError "$work\$stem-$m.err" From 7fd838035c96a3f9d8f0a520319795b716f34773 Mon Sep 17 00:00:00 2001 From: ASDAlexander77 Date: Fri, 25 Sep 2026 11:25:32 +0100 Subject: [PATCH 2/2] Stop passing the LLVM lib path into the project templates #333 took LLVMSupport, LLVMDemangle and ntdll out of the CMake template's link libraries, but --cmake and --new still read the LLVM lib path into an LLVM_LIB_PATH substitution. No CMake template uses it, and the VSCode tasks and launch configurations passed it only as --llvm-lib-path, which tslang ignores. Drop the substitution and those arguments. Co-Authored-By: Claude Opus 5.5 (1M context) --- tslang/include/TypeScript/VSCodeTemplate/Files.h | 6 ------ tslang/tslang/cmake.cpp | 3 --- tslang/tslang/vscode.cpp | 3 --- 3 files changed, 12 deletions(-) diff --git a/tslang/include/TypeScript/VSCodeTemplate/Files.h b/tslang/include/TypeScript/VSCodeTemplate/Files.h index 3cd39dce9..46a3df18d 100644 --- a/tslang/include/TypeScript/VSCodeTemplate/Files.h +++ b/tslang/include/TypeScript/VSCodeTemplate/Files.h @@ -81,7 +81,6 @@ const auto TASKS_JSON_DATA = R"raw( "type": "shell", "args": [ "--gc-lib-path=<>", - "--llvm-lib-path=<>", "--tslang-lib-path=<>", "--default-lib-path=<>", "--di", @@ -104,7 +103,6 @@ const auto TASKS_JSON_DATA = R"raw( "type": "shell", "args": [ "--gc-lib-path=<>", - "--llvm-lib-path=<>", "--tslang-lib-path=<>", "--default-lib-path=<>", "--opt", @@ -127,7 +125,6 @@ const auto TASKS_JSON_DATA = R"raw( "type": "shell", "args": [ "--gc-lib-path=<>", - "--llvm-lib-path=<>", "--tslang-lib-path=<>", "--default-lib-path=<>", "--di", @@ -150,7 +147,6 @@ const auto TASKS_JSON_DATA = R"raw( "type": "shell", "args": [ "--gc-lib-path=<>", - "--llvm-lib-path=<>", "--tslang-lib-path=<>", "--default-lib-path=<>", "--opt", @@ -216,7 +212,6 @@ const auto LAUNCH_JSON_DATA_WIN32 = R"raw( "args": [ "--shared-libs=<>\\TypeScriptRuntime.dll", "--gc-lib-path=<>", - "--llvm-lib-path=<>", "--tslang-lib-path=<>", "--default-lib-path=<>", "--no-default-lib", @@ -278,7 +273,6 @@ const auto LAUNCH_JSON_DATA_LINUX = R"raw( "args": [ "--shared-libs=<>/libTypeScriptRuntime.so", "--gc-lib-path=<>", - "--llvm-lib-path=<>", "--tslang-lib-path=<>", "--default-lib-path=<>", "--opt", diff --git a/tslang/tslang/cmake.cpp b/tslang/tslang/cmake.cpp index 45c6c8a49..67cb79844 100644 --- a/tslang/tslang/cmake.cpp +++ b/tslang/tslang/cmake.cpp @@ -22,7 +22,6 @@ int substitute(StringRef data, StringMap &values, SmallString<128> &r string getExecutablePath(const char *); string fixpath(string, const SmallVectorImpl&); string getGCLibPath(); -string getLLVMLibPath(); string getTslangLibPath(); string getDefaultLibPath(); @@ -66,7 +65,6 @@ int createCMakeFolder(int argc, char **argv) auto tslangCmd = fixpath(driverPath, appPath); auto gcLibPath = fixpath(getGCLibPath(), appPath); - auto llvmLibPath = fixpath(getLLVMLibPath(), appPath); auto tslangLibPath = fixpath(getTslangLibPath(), appPath); auto defaultLibPath = fixpath(getDefaultLibPath(), appPath); // hint for finding tslang app (same logic as in createVSCodeFolder) @@ -74,7 +72,6 @@ int createCMakeFolder(int argc, char **argv) vals["TSLANG_CMD"] = tslangCmd; vals["GC_LIB_PATH"] = gcLibPath; - vals["LLVM_LIB_PATH"] = llvmLibPath; vals["TSLANG_LIB_PATH"] = tslangLibPath; vals["DEFAULT_LIB_PATH"] = defaultLibPath; vals["TSLANG_APP_PATH"] = tslangAppPath; diff --git a/tslang/tslang/vscode.cpp b/tslang/tslang/vscode.cpp index ad16369d3..90ae951bd 100644 --- a/tslang/tslang/vscode.cpp +++ b/tslang/tslang/vscode.cpp @@ -34,7 +34,6 @@ int substitute(StringRef data, StringMap &values, SmallString<128> &r string getExecutablePath(const char *); string getGCLibPath(); -string getLLVMLibPath(); string getTslangLibPath(); string getDefaultLibPath(); string fixpath(string, const SmallVectorImpl&); @@ -84,7 +83,6 @@ int createVSCodeFolder(int argc, char **argv) auto tslangCmd = fixpath(driverPath, appPath); auto gcLibPath = fixpath(getGCLibPath(), appPath); - auto llvmLibPath = fixpath(getLLVMLibPath(), appPath); auto tslangLibPath = fixpath(getTslangLibPath(), appPath); auto defaultLibPath = fixpath(getDefaultLibPath(), appPath); // hint for finding tslang app (same logic as in createVSCodeFolder) @@ -92,7 +90,6 @@ int createVSCodeFolder(int argc, char **argv) vals["TSLANG_CMD"] = tslangCmd; vals["GC_LIB_PATH"] = gcLibPath; - vals["LLVM_LIB_PATH"] = llvmLibPath; vals["TSLANG_LIB_PATH"] = tslangLibPath; vals["DEFAULT_LIB_PATH"] = defaultLibPath; vals["TSLANG_APP_PATH"] = tslangAppPath;