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

rustc is unsure if lto is allowed for rlibs #86997

Closed
matklad opened this issue Jul 9, 2021 · 1 comment
Closed

rustc is unsure if lto is allowed for rlibs #86997

matklad opened this issue Jul 9, 2021 · 1 comment
Labels
A-LTO Area: Link-time optimization (LTO) C-bug Category: This is a bug.

Comments

@matklad
Copy link
Member

matklad commented Jul 9, 2021

$ bat -p main.rs 
pub extern "C" fn f() -> i32 { 92 }
$ rustc -C lto=fat --crate-type rlib main.rs
$ rustc -C lto=fat --crate-type cdylib main.rs
$ rustc -C lto=fat --crate-type rlib,cdylib main.rs
error: lto can only be run for executables, cdylibs and static library outputs

error: aborting due to previous error
$ rustc --version
rustc 1.54.0-beta.1 (bf62f4de3 2021-06-23)

As you see, rustc agrees to compile rlib and cdylib with lto separately, but refuses when they are both specified.

@ehuss
Copy link
Contributor

ehuss commented Jul 9, 2021

I think this is a duplicate of #51009.

@matklad matklad closed this as completed Jul 12, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-LTO Area: Link-time optimization (LTO) C-bug Category: This is a bug.
Projects
None yet
Development

No branches or pull requests

2 participants