Repository navigation
--emit=exe finds gc.lib and the runtime beside tslang when no path is given - #1107
Merged
Merged
Conversation
…when no path is given With neither --gc-lib-path/GC_LIB_PATH nor --tslang-lib-path/TSLANG_LIB_PATH, the link named no library folder, so lld-link found gc.lib and the runtime only when run from tslang's own folder (the release package): from any other folder every program failed with "could not open 'gc.lib'". Now the folder tslang is in (or its ../lib, the Linux build) is used when it holds the target's library, as the default library and the JIT's runtime lookup already do. Co-Authored-By: Claude Opus 5.5 <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.
Running
tslang --emit=exe x.tsfrom any folder other than the release package's own failed:The link added a library folder only for
--gc-lib-path/GC_LIB_PATHand--tslang-lib-path/TSLANG_LIB_PATH. With neither set, lld-link searched only the current folder.getGCLibPath,getTslangLibPathand the static pathgetGCSharedLibPathderivesgcdllfrom now fall back to tslang's own folder, or its../libon Linux. The fallback is used only when the target's library is actually there, so a cross-compile still finds none, as before. The default library and the JIT's runtime lookup already used tslang's own folder.Checked on Windows: a program linked from
I:\Playground, with the release package's libraries beside a freshly built tslang and no lib env vars, builds and runs under gc, rc and own. The release tslang fails there with the errors above.🤖 Generated with Claude Code