You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
WIP: Working state for having the test program to compile with LTO
This requires having the following line commented in libgccjit:
ADD_ARG ("-fno-use-linker-plugin");
And this also requires having the sysroot compiled with fat LTO.
let buffer = ModuleBuffer::new(PathBuf::from(path));
285
286
let llmod_id = CString::new(&module.name[..]).unwrap();
@@ -314,6 +315,20 @@ fn fat_lto(
314
315
save_temp_bitcode(cgcx,&module,"lto.input");
315
316
316
317
let int_type = module.module_llvm.context.new_type::<i32>();
318
+
/*
319
+
* TODO: Preserve the symbols via a linker script instead?
320
+
* TODO TODO: use the symbols in inline asm to keep them?
321
+
* ===> This seems to work and is easy.
322
+
*
323
+
* FIXME: main is not genarated in GIMPLE IR; it is generated as asm.
324
+
* ===> seems now fixed since I commented this line in libgccjit:
325
+
* ADD_ARG ("-fno-use-linker-plugin");
326
+
* FIXME: it seems "make install" doesn't copy liblto_plugin.so.
327
+
* ===> seems now fixed after a rebuild.
328
+
*
329
+
* TODO TODO TODO: add -fno-use-linker-plugin because:
330
+
* This option is enabled by default when LTO support in GCC is enabled and GCC was configured for use with a linker supporting plugins (GNU ld 2.21 or newer or gold).
// TODO(antoyo): Send -plugin/usr/lib/gcc/x86_64-pc-linux-gnu/11.1.0/liblto_plugin.so to linker (this should be done when specifying the appropriate rustc cli argument).
0 commit comments