rustc: add ability to output regular LTO bitcode modules

Adding the option to control from rustc CLI
if the resulted ".o" bitcode module files are with
thinLTO info or regular LTO info.

Allows using "-lto-embed-bitcode=optimized" during linkage
correctly.

Signed-off-by: Ziv Dunkelman <ziv.dunkelman@nextsilicon.com>
This commit is contained in:
Ziv Dunkelman 2022-06-08 17:30:16 +03:00
parent 0ed9c64c3e
commit 724c91234d
10 changed files with 32 additions and 7 deletions

View file

@ -99,6 +99,7 @@ pub struct ModuleConfig {
pub emit_ir: bool,
pub emit_asm: bool,
pub emit_obj: EmitObj,
pub emit_thin_lto: bool,
pub bc_cmdline: String,
// Miscellaneous flags. These are mostly copied from command-line
@ -218,6 +219,7 @@ impl ModuleConfig {
false
),
emit_obj,
emit_thin_lto: sess.opts.unstable_opts.emit_thin_lto,
bc_cmdline: sess.target.bitcode_llvm_cmdline.to_string(),
verify_llvm_ir: sess.verify_llvm_ir(),