-
-
Notifications
You must be signed in to change notification settings - Fork 3k
Sema: Stop adding Windows implib link inputs for extern "..."
syntax.
#24146
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Conversation
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
mlugg
approved these changes
Jun 11, 2025
49ca419
to
b8fff6c
Compare
202754f
to
7226a16
Compare
andrewrk
approved these changes
Jun 25, 2025
💣 |
Techatrix
added a commit
to ziglibs/known-folders
that referenced
this pull request
Jul 8, 2025
Techatrix
added a commit
to ziglibs/known-folders
that referenced
this pull request
Jul 8, 2025
Techatrix
added a commit
to zigtools/zls
that referenced
this pull request
Jul 8, 2025
Techatrix
added a commit
to zigtools/zls
that referenced
this pull request
Jul 8, 2025
KurtWagner
added a commit
to KurtWagner/zlinter
that referenced
this pull request
Jul 8, 2025
``` error: lld-link: undefined symbol: SystemFunction036 ``` Requires explicit Advapi32.dll since ziglang/zig#24146
scheibo
added a commit
to pkmn/engine
that referenced
this pull request
Jul 8, 2025
required after ziglang/zig#24146 for RtlGenRandom used by crypto.tlcsprng.tlsCsprngFill
KurtWagner
added a commit
to KurtWagner/zlinter
that referenced
this pull request
Jul 8, 2025
Fixes `error: lld-link: undefined symbol: SystemFunction036` since ziglang/zig#24146
KurtWagner
added a commit
to KurtWagner/zlinter
that referenced
this pull request
Jul 8, 2025
Fixes `error: lld-link: undefined symbol: SystemFunction036` since ziglang/zig#24146
KurtWagner
added a commit
to KurtWagner/zlinter
that referenced
this pull request
Jul 8, 2025
Fixes `error: lld-link: undefined symbol: SystemFunction036` since ziglang/zig#24146
KurtWagner
added a commit
to KurtWagner/zlinter
that referenced
this pull request
Jul 8, 2025
Fixes `error: lld-link: undefined symbol: SystemFunction036` since ziglang/zig#24146
KurtWagner
added a commit
to KurtWagner/zlinter
that referenced
this pull request
Jul 8, 2025
Fixes `error: lld-link: undefined symbol: SystemFunction036` since ziglang/zig#24146
KurtWagner
added a commit
to KurtWagner/zlinter
that referenced
this pull request
Jul 8, 2025
Fixes `error: lld-link: undefined symbol: SystemFunction036` since ziglang/zig#24146
2 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
breaking
Implementing this issue could cause existing code to no longer compile or have different behavior.
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.
Closes #23971.
Release Notes
When encountering a declaration such as
the Zig compiler will no longer automatically add the import library for
ws2_32.dll
as a link input. Users will now need to manually linkws2_32
either by passing-lws2_32
on the command line, or by callingb.linkSystemLibrary("ws2_32")
in a build script (conditioned ontarget.os.tag == .windows
).This change was made because the old behavior obscured which DLLs a Windows binary actually depends on. Zig favors explicitness, and users are required to specify link dependencies explicitly for all other targets, making the old Windows behavior inconsistent. Finally, semantic analysis of Zig code having the ability to introduce new link inputs in the compilation pipeline imposed undesirable constraints on the compiler implementation.
Notably, there are two exceptions to this change:
ntdll.dll
andkernel32.dll
. As these DLLs are always loaded into Windows processes anyway, they are also implicitly linked by the compiler. These exceptions should mitigate the ecosystem breakage somewhat.