Skip to content

linker: Allow MSVC to use import libraries following the Meson/MinGW convention#123436

Merged
bors merged 1 commit intorust-lang:masterfrom
amyspark:allow-msvc-to-use-meson-and-mingw-import-libraries
Sep 16, 2024
Merged

linker: Allow MSVC to use import libraries following the Meson/MinGW convention#123436
bors merged 1 commit intorust-lang:masterfrom
amyspark:allow-msvc-to-use-meson-and-mingw-import-libraries

Conversation

@amyspark
Copy link
Contributor

@amyspark amyspark commented Apr 3, 2024

Hi all,

This PR implements support for MsvcLinker to use import libraries following Meson and the MinGW toolchain's naming convention. Meson follows the libfoo.dll.a naming convention to disambiguate between static and import libraries.

This support already existed for static libraries (see #100101), but not for dynamic libraries. The latter case was added by duplicating the logic in native_libs::find_native_static_library, but a separate case was added in link_dylib_by_name for the Windows CRT libraries which must be handled by the linker itself.

See for prerequisites #129366, #126094, and #128370.

All feedback is appreciated!

Fixes #122455

cc @sdroege @nirbheek

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-compiler Relevant to the compiler team, which will review and decide on the PR/issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Rust can detect GNU/Meson style named libraries but the MSVC linker backend ignores them