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

Add support for -Cembed-bitcode=no #8066

Merged
merged 1 commit into from
Apr 3, 2020

Commits on Apr 1, 2020

  1. Add support for -Cembed-bitcode=no

    This commit is the Cargo half of support necessary for
    rust-lang/rust#70458. Today the compiler emits embedded bytecode in
    rlibs by default, but compresses it. This is both extraneous disk space
    and wasted build time for almost all builds, so the PR in question there
    is changing rustc to have a `-Cembed-bitcode` flag which, when enabled,
    places the bitcode in the object file rather than an auxiliary file (no
    extra compression), but also enables `-Cembed-bitcode=no` to disable
    bitcode emission entirely.
    
    This Cargo support changes Cargo to pass `-Cembed-bitcode=no` for almost
    all compilations. Cargo will keep `lto = true` and such working by not
    passing this flag (and thus allowing bitcode to get embedded), but by
    default `cargo build` and `cargo build --release` will no longer have
    any bitcode in rlibs which should result in speedier builds!
    
    Most of the changes here were around the test suite and various
    assertions about the `rustc` command lines we spit out. One test was
    hard-disabled until we can get `-Cembed-bitcode=no` into nightly, and
    then we can make it a nightly-only test. The test will then be stable
    again once `-Cembed-bitcode=no` hits stable.
    
    Note that this is intended to land before the upstream `-Cembed-bitcode`
    change. The thinking is that we'll land everything in rust-lang/rust all
    at once so there's no build time regressions for anyone. If we were to
    land the `-Cembed-bitcode` PR first then there would be a build time
    regression until we land Cargo changes because rustc would be emitting
    uncompressed bitcode by default and Cargo wouldn't be turning it off.
    alexcrichton committed Apr 1, 2020
    Configuration menu
    Copy the full SHA
    bac300b View commit details
    Browse the repository at this point in the history