diff --git a/src/back/write.rs b/src/back/write.rs index beae99708b0..6927cdf4fc4 100644 --- a/src/back/write.rs +++ b/src/back/write.rs @@ -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"); } @@ -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, <o_path); - //println!("****************************************************************************************************"); + //eprintln!("****************************************************************************************************"); let context = Context::default(); // TODO: might need to set some other flags from new_context. //context.add_driver_option("-v");