Tweak wasm_base target spec to indicate linker is not GNU and update linker inferring logic for wasm-ld.#85920
Merged
bors merged 1 commit intorust-lang:masterfrom Jun 6, 2021
Merged
Conversation
…linker inferring logic for wasm-ld.
Contributor
|
(rust-highfive has picked a reviewer for you, use r? to override) |
Contributor
|
@bors r+ |
Collaborator
|
📌 Commit f667aca has been approved by |
bors
added a commit
to rust-lang-ci/rust
that referenced
this pull request
Jun 6, 2021
Rollup of 8 pull requests Successful merges: - rust-lang#85436 (Avoid cloning cache key) - rust-lang#85772 (Preserve metadata w/ Solaris-like linkers.) - rust-lang#85920 (Tweak wasm_base target spec to indicate linker is not GNU and update linker inferring logic for wasm-ld.) - rust-lang#85930 (Update standard library for IntoIterator implementation of arrays ) - rust-lang#85972 (Rustdoc html fixes) - rust-lang#86028 (Drop an `if let` that will always succeed) - rust-lang#86043 (don't clone attrs) - rust-lang#86047 (Don't fire `invalid_doc_attributes` on `extern crate` items) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Reported via Zulip: we try passing
--as-neededto the linker if it's GNU ld whichwasm-ldis not. Usually this isn't an issue for wasm as we would use the WasmLd linker driver but because the linker in question (wasm32-unknown-wasi-wasm-ld) ended with-ldour linker inferring logic used theGccLinkerimplementations. (UPD: The linker inferring logic actually didn't apply in this case because the linker is actually invoked through gcc in the reported issue. But it's still worth updating the logic I think.)This change then has 2 parts:
linker_is_gnu: falseplus a few additions oftarget.is_like_wasmto handle flagswasm-lddoes in fact support.We need to add the new
target.is_like_wasmbranches to handle the case where the "linker" used could be something like clang which would then under the hood call wasm-ld.