Repository navigation
-Zno-link is broken #77857
Description
Activity
- addedrequires-nightlyThis issue requires a nightly compiler in some way. When possible, use a F-* label instead.This issue requires a nightly compiler in some way. When possible, use a F-* label instead.T-compilerRelevant to the compiler team, which will review and decide on the PR/issue.Relevant to the compiler team, which will review and decide on the PR/issue.
on Oct 12, 2020 - addedA-linkageArea: linking into static, shared libraries and binariesArea: linking into static, shared libraries and binariesA-metadataArea: Crate metadataArea: Crate metadata
on Oct 12, 2020 PR #73851 changed the encode/decode method of
DefIdto call the encode/decode method of its fieldpub index: DefIndex; however,DefIndexis only encodable in metadata. It panics if encoded anywhere else.When
no-linkwas implemented, the encode/decode ofDefIdwas purposely crafted to avoid calling the encode/decode method ofDefIndex. The most straightforward fix is to implementEncodable/DecodableforDefIndexto allow it be serialized outside of metadata.After that, may be now it is the time to re-think the way we store data in the
rlinkfile.What do you think @bjorn3 ?
I think
DefIdshould completely be avoided in the input of the linker function. One of the uses ifNativeLibin it'sforeign_modulefield. This field doesn't seem to be used by the linking code.Good suggestion, let me look into it.
@0dvictor are you still working on this?
Thank you for reminding and apologize for the delay. I did create a prototype but haven't got a chance polish it yet. I'll create the PR this week.
Reacted by bjorn3Sorry again about the delay. I've created PR #80187, which fixes this issue.
- added 4 commits that reference this issue
on Dec 23, 2020 - added a commit that references this issue
on Dec 25, 2020
I tried this command:
I expected to see this happen: An
.rlinkfile is generated.Instead, this happened:
Meta
rustc --version --verbose:Originally posted by @bjorn3 in #77795 (comment)
cc @0dvictor (original implementer of
-Zno-link