Skip to content

from nightly-2021-04-26 started linking unneeded ws2_32.dll for x86_64-pc-windows-msvc target #85441

Closed
@klensy

Description

@klensy

For empty.rs:

fn main(){}

rustc +nightly-2021-04-25-x86_64-pc-windows-msvc empty.rs -O
don't use ws2_32.dll

 KERNEL32.dll
 VCRUNTIME140.dll
 api-ms-win-crt-runtime-l1-1-0.dll
 api-ms-win-crt-math-l1-1-0.dll
 api-ms-win-crt-stdio-l1-1-0.dll
 api-ms-win-crt-locale-l1-1-0.dll
 api-ms-win-crt-heap-l1-1-0.dll

rustc +nightly-2021-04-26-x86_64-pc-windows-msvc empty.rs -O
use ws2_32.dll

 WS2_32.dll
 KERNEL32.dll
 VCRUNTIME140.dll
 api-ms-win-crt-runtime-l1-1-0.dll
 api-ms-win-crt-math-l1-1-0.dll
 api-ms-win-crt-stdio-l1-1-0.dll
 api-ms-win-crt-locale-l1-1-0.dll
 api-ms-win-crt-heap-l1-1-0.dll

Can be checked for example via dumpbin.exe /dependents empty.exe

regressed between 42816d6...3709ae3, i'm thinking about #84115

Thing that imported from ws2_32 is WSACleanup

@rustbot label +O-windows +A-linkage

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-linkageArea: linking into static, shared libraries and binariesO-windowsOperating system: Windows

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions