about summary refs log tree commit diff
path: root/src/test/debuginfo/tuple-struct.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2020-05-22 11:32:25 +0200
committerGitHub <noreply@github.com>2020-05-22 11:32:25 +0200
commit1119421e26da4e8cb530e14557b49c96c025f7ff (patch)
tree1eb1bf66c68d7c5d4314a9e1d481dfbc30ed023f /src/test/debuginfo/tuple-struct.rs
parent62d4e9eedd384c3a32c55dad71dc04c8891d550e (diff)
parentcc91041f26fa90920cc96c13c431610153a61586 (diff)
downloadrust-1119421e26da4e8cb530e14557b49c96c025f7ff.tar.gz
rust-1119421e26da4e8cb530e14557b49c96c025f7ff.zip
Rollup merge of #72325 - alexcrichton:ignore-linker-plugin-lto, r=nnethercote
Always generated object code for `#![no_builtins]`

This commit updates the code generation for `#![no_builtins]` to always
produce object files instead of conditionally respecting
`-Clinker-plugin-lto` and sometimes producing bitcode. This is intended
to address rust-lang/cargo#8239.

The issue at hand here is that Cargo has tried to get "smarter" about
codegen in whole crate graph scenarios. When LTO is enabled it attempts
to avoid codegen on as many crates as possible, opting to pass
`-Clinker-plugin-lto` where it can to only generate bitcode. When this
is combined with `-Zbuild-std`, however, it means that
`compiler-builtins` only generates LLVM bitcode instead of object files.
Rustc's own LTO passes then explicitly skip `compiler-builtins` (because
it wouldn't work anyway) which means that LLVM bitcode gets sent to the
linker, which chokes most of the time.

The fix in this PR is to not actually respect `-Clinker-plugin-lto` for
`#![no_builtins]` crates. These crates, even if slurped up by the linker
rather than rustc, will not work with LTO. They define symbols which are
only referenced as part of codegen, so LTO's aggressive internalization
would trivially remove the symbols only to have the linker realize later
that the symbol is undefined. Since pure-bitcode never makes sense for
these libraries, the `-Clinker-plugin-lto` flag is silently ignored.
Diffstat (limited to 'src/test/debuginfo/tuple-struct.rs')
0 files changed, 0 insertions, 0 deletions