forked from rust-lang/rust
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Rollup merge of rust-lang#85595 - CDirkx:win-linkage, r=nagisa
Only register `WSACleanup` if `WSAStartup` is actually ever called Fix for rust-lang#85441. Because `WSACleanup` appears in `cleanup` currently `WS2_32.dll` is always linked, even if no network functionality is ever used. To prevent this, `WSACleanup` has to only appear in `init`, hence the workaround of registering it in a static. If anyone knows a cleaner solution, let me know.
- Loading branch information
Showing
3 changed files
with
21 additions
and
6 deletions.
There are no files selected for viewing
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
# only-windows | ||
|
||
-include ../../run-make-fulldeps/tools.mk | ||
|
||
# Tests that WS2_32.dll is not unnecessarily linked, see issue #85441 | ||
|
||
all: | ||
$(RUSTC) empty.rs | ||
objdump -p $(TMPDIR)/empty.exe | $(CGREP) -v -i "WS2_32.dll" |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
fn main() {} |