Skip to content

Commit

Permalink
Disable the LTO warning for now
Browse files Browse the repository at this point in the history
  • Loading branch information
antoyo committed Jan 10, 2025
1 parent 7bdd2ba commit 74191f6
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion src/back/write.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,10 @@ pub(crate) unsafe fn codegen(

// NOTE: without -fuse-linker-plugin, we get the following error:
// lto1: internal compiler error: decompressed stream: Destination buffer is too small
// TODO: since we do not do LTO when the linker is invoked anymore, perhaps
// the following flag is not necessary anymore.
// TODO: also, perhaps compiling the gcc driver in the CI is not necessary
// anymore.
context.add_driver_option("-fuse-linker-plugin");
}

Expand All @@ -187,8 +191,17 @@ pub(crate) unsafe fn codegen(
let path = obj_out.to_str().expect("path to str");

let lto_path = format!("{}.lto", path);
//eprintln!("Before Executable");
// FIXME: The LTO frontend generates the following warning:
// ../build_sysroot/sysroot_src/library/core/src/num/dec2flt/lemire.rs:150:15: warning: type of ‘_ZN4core3num7dec2flt5table17POWER_OF_FIVE_12817ha449a68fb31379e4E’ does not match original declaration [-Wlto-type-mismatch]
// 150 | let (lo5, hi5) = POWER_OF_FIVE_128[index];
// | ^
// lto1: note: ‘_ZN4core3num7dec2flt5table17POWER_OF_FIVE_12817ha449a68fb31379e4E’ was previously declared here
//
// This option is to mute it to make the UI tests pass with LTO enabled.
context.add_driver_option("-Wno-lto-type-mismatch");
context.compile_to_file(OutputKind::Executable, &lto_path);
//println!("****************************************************************************************************");
//eprintln!("****************************************************************************************************");

let context = Context::default(); // TODO: might need to set some other flags from new_context.
//context.add_driver_option("-v");
Expand Down

0 comments on commit 74191f6

Please sign in to comment.