linker: MSVC supports linking static libraries as a whole archive by petrochenkov · Pull Request #72785 · rust-lang/rust (original) (raw)

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 andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation5 Commits1 Checks0 Files changed

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

[ Show hidden characters]({{ revealButtonHref }})

petrochenkov

@petrochenkov

@rust-highfive

r? @matthewjasper

(rust_highfive has picked a reviewer for you, use r? to override)

@matthewjasper

@bors

📌 Commit d1c275b has been approved by matthewjasper

@bors bors added S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.

and removed S-waiting-on-review

Status: Awaiting review from the assignee but also interested parties.

labels

Jun 11, 2020

RalfJung added a commit to RalfJung/rust that referenced this pull request

Jun 12, 2020

@RalfJung

…sper

linker: MSVC supports linking static libraries as a whole archive

bors added a commit to rust-lang-ci/rust that referenced this pull request

Jun 19, 2020

@bors

@kornelski

@petrochenkov There has been a user report that this change broke MSVC builds:

cl
Compilateur d'optimisation Microsoft (R) C/C++ version 19.26.28806 pour x64
Copyright (C) Microsoft Corporation. Tous droits réservés.

link
Microsoft (R) Incremental Linker Version 14.26.28806.0
Copyright (C) Microsoft Corporation. All rights reserved.

@petrochenkov

@kornelski
Thanks for reporting.
Details like this are not really documented so it's hard to rely on them and promise stability.
Once rust-lang/compiler-team#356 is approved and implemented, it will provide explicit control over behavior of --whole-archive//WHOLEARCHIVE, and we'll document the defaults as well.
This PR at least makes those defaults consistent across platforms.

FaultyRAM added a commit to FaultyRAM/windres-rs that referenced this pull request

Feb 26, 2021

@FaultyRAM

rust-lang/rust#72785 introduced a breaking change for MSVC targets that causes linking against a static library to fail when using cargo:rustc-link-lib=static. As a workaround, remove =static from the MSVC code until Rust allows disabling whole archive linking.

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request

May 7, 2021

@Dylan-DPC

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request

May 7, 2021

@Dylan-DPC

Dylan-DPC-zz pushed a commit to Dylan-DPC-zz/rust that referenced this pull request

May 7, 2021

@Dylan-DPC

Labels

S-waiting-on-bors

Status: Waiting on bors to run and complete tests. Bors will change the label on completion.