Skip to content

error: options -C bitcode-in-rlib=no and -C lto are incompatible #71848

Closed
@chinedufn

Description

@chinedufn

I recently updated to the latest nightly a couple of days ago and started getting an error when trying to build a crate.

error: options `-C bitcode-in-rlib=no` and `-C lto` are incompatible

The build command that I'm using is:

RUSTFLAGS="-C lto" cargo build -p my-crate-name --target x86_64-unknown-linux-gnu --release

Version info (I've tried this on MacOS as well, also fails)

$ rustc -V
rustc 1.45.0-nightly (7f65393b9 2020-05-01)
$ cargo -V
cargo 1.45.0-nightly (258c89644 2020-04-30)
$ lsb_release -a
No LSB modules are available.
Distributor ID:	Debian
Description:	Debian GNU/Linux 9.8 (stretch)
Release:	9.8
Codename:	stretch

I see that there was some recent work around optimizing bitcode in rlibs (example: #66961 ), so that could be related but I'm not sure.


As far as I can tell I'm not setting -C bitcode-in-rlib=no anywhere - unless there's some way that it can be set by default in some scenarios?

Minimal Reproduction Steps

cargo new rlib-test
cd rlib-test
RUSTFLAGS="-C lto" cargo build --release
# error: options `-C bitcode-in-rlib=no` and `-C lto` are incompatible

Works fine on nightly-2020-03-01.
(I didn't check any other nightly releases in between March and May)

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.T-cargoRelevant to the cargo team, which will review and decide on the PR/issue.relnotesMarks issues that should be documented in the release notes of the next release.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions