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

Cannot emit metadata,obj without link #81117

Closed
ojeda opened this issue Jan 17, 2021 · 0 comments · Fixed by #81118
Closed

Cannot emit metadata,obj without link #81117

ojeda opened this issue Jan 17, 2021 · 0 comments · Fixed by #81118
Labels
C-bug Category: This is a bug.

Comments

@ojeda
Copy link
Contributor

ojeda commented Jan 17, 2021

Requesting both metadata and obj without link fails:

$ echo | rustc --crate-type rlib --emit=metadata,obj -

The output files are created, but the compiler thinks it still has to build the archive:

error: failed to build archive: No such file or directory

The same behavior happens for other metadata + non-link combinations.

Meta

Both latest stable (1.49.0) and nightly exhibit the problem.

@ojeda ojeda added the C-bug Category: This is a bug. label Jan 17, 2021
bors added a commit to rust-lang-ci/rust that referenced this issue Jan 20, 2021
Skip linking if it is not required

This allows to use `--emit=metadata,obj` and other metadata + non-link combinations.

Fixes rust-lang#81117.
@bors bors closed this as completed in f9275e1 Jan 20, 2021
ojeda added a commit to Rust-for-Linux/linux that referenced this issue Jan 21, 2021
It allows us to save a bit of space, ignore the duplicate object files,
and the archiving steps; e.g.:

      643544 libcompiler_builtins.rlib
    64171752 libcore.rlib

vs.

      530004 libcompiler_builtins.rmeta
    63679866 libcore.rmeta

We couldn't do it right away in [1] because `rustc` required a fix [2,3].
The fix is now in [4] and available since the 2021-01-21 nightly, so now
we can go ahead and make the change.

Fixes #75.

[1] #52
[2] rust-lang/rust#81117
[3] rust-lang/rust#81118
[4] rust-lang/rust@f9275e1

Suggested-by: bjorn3
Signed-off-by: Miguel Ojeda <[email protected]>
ojeda added a commit to Rust-for-Linux/linux that referenced this issue Jan 21, 2021
It allows us to save a bit of space, ignore the duplicate object files,
and the archiving steps; e.g.:

      643544 libcompiler_builtins.rlib
    64171752 libcore.rlib

vs.

      530004 libcompiler_builtins.rmeta
    63679866 libcore.rmeta

We couldn't do it right away in [1] because `rustc` required a fix [2,3].
The fix is now in [4] and available since the 2021-01-21 nightly, so now
we can go ahead and make the change.

Fixes #75.

[1] #52
[2] rust-lang/rust#81117
[3] rust-lang/rust#81118
[4] rust-lang/rust@f9275e1

Suggested-by: bjorn3
Signed-off-by: Miguel Ojeda <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-bug Category: This is a bug.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant