Skip to content
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 and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Skip passing /natvis to lld-link until supported. #44626

Merged
merged 1 commit into from
Sep 20, 2017

Conversation

MaulingMonkey
Copy link
Contributor

Overview

Teaching rustc about MSVC's undocumented linker flag, /NATVIS, broke rustc's compatability with LLVM's lld-link frontend, as it does not recognize the flag. This pull request works around the problem by excluding lld-link by name. @retep998 discovered this regression.

Possible Issues

  • Other linkers that try to be compatible with the MSVC linker flavor may also be broken and in need of workarounds.
  • Warning about the workaround may be overkill for a minor reduction in debug functionality.
  • Depending on how long this workaround sticks around, it may eventually be preferred to version check lld-link instead of assuming all versions are incompatible.

Relevant issues

r? @michaelwoerister

LLVM 5.0.0's lld-link frontend errors out if passed /natvis.
LLVM 6 (maybe earlier?) should at least ignore the flag.
Hopefully LLVM will eventually support the flag, at which point
this workaround can perhaps be simply removed, if 6? is old enough.
@rust-highfive
Copy link
Collaborator

Thanks for the pull request, and welcome! The Rust team is excited to review your changes, and you should hear from @michaelwoerister (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

@carols10cents carols10cents added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label Sep 18, 2017
@michaelwoerister
Copy link
Member

@bors r+

Thanks a lot!

@bors
Copy link
Contributor

bors commented Sep 19, 2017

📌 Commit 995f0bd has been approved by michaelwoerister

@michaelwoerister
Copy link
Member

@bors rollup

GuillaumeGomez added a commit to GuillaumeGomez/rust that referenced this pull request Sep 19, 2017
…ssion-fix, r=michaelwoerister

Skip passing /natvis to lld-link until supported.

### Overview

Teaching rustc about MSVC's undocumented linker flag, /NATVIS, broke rustc's compatability with LLVM's `lld-link` frontend, as it does not recognize the flag.  This pull request works around the problem by excluding `lld-link` by name.  @retep998 discovered this regression.

### Possible Issues

- Other linkers that try to be compatible with the MSVC linker flavor may also be broken and in need of workarounds.
- Warning about the workaround may be overkill for a minor reduction in debug functionality.
- Depending on how long this workaround sticks around, it may eventually be preferred to version check `lld-link` instead of assuming all versions are incompatible.

### Relevant issues
* Broke in rust-lang#43221 Embed MSVC .natvis files into .pdbs and mangle debuginfo for &str, *T, and [T].
* LLVM patched in llvm-mirror/lld@27b9c42 to ignore the flag instead of erroring.

r? @michaelwoerister
@arielb1 arielb1 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 Sep 19, 2017
bors added a commit that referenced this pull request Sep 20, 2017
Rollup of 5 pull requests

- Successful merges: #44513, #44626, #44689, #44693, #44703
- Failed merges:
@bors bors merged commit 995f0bd into rust-lang:master Sep 20, 2017
@Boddlnagg
Copy link
Contributor

This seems to be supported in lld now: https://reviews.llvm.org/rL327895

@MaulingMonkey
Copy link
Contributor Author

MaulingMonkey commented Aug 16, 2019

Nice! I can create a new PR simply reverting this change if we're OK with dropping support for LLVM 5 lld-link? LLVM 6 was released 8 Mar 2018, and should at worst ignore /natvis...

Alternatively I can try to invoke lld-link.exe --version and parse that, but that seems like a lot of brittle hard to test code for minimal gain...

EDIT: Someone beat me to it: #59441 - rustc 1.35.0+ should start using the flag again and LLVM 7+ should actually embed the PDBs instead of just ignoring them like LLVM 6+.

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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants