Skip to content

Commit 74191f6

Browse files
committed
Disable the LTO warning for now
1 parent 7bdd2ba commit 74191f6

File tree

1 file changed

+14
-1
lines changed

1 file changed

+14
-1
lines changed

src/back/write.rs

+14-1
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,10 @@ pub(crate) unsafe fn codegen(
167167

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

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

189193
let lto_path = format!("{}.lto", path);
194+
//eprintln!("Before Executable");
195+
// FIXME: The LTO frontend generates the following warning:
196+
// ../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]
197+
// 150 | let (lo5, hi5) = POWER_OF_FIVE_128[index];
198+
// | ^
199+
// lto1: note: ‘_ZN4core3num7dec2flt5table17POWER_OF_FIVE_12817ha449a68fb31379e4E’ was previously declared here
200+
//
201+
// This option is to mute it to make the UI tests pass with LTO enabled.
202+
context.add_driver_option("-Wno-lto-type-mismatch");
190203
context.compile_to_file(OutputKind::Executable, &lto_path);
191-
//println!("****************************************************************************************************");
204+
//eprintln!("****************************************************************************************************");
192205

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

0 commit comments

Comments
 (0)