@@ -67,7 +67,11 @@ pub(crate) unsafe fn codegen(
6767 ) ;
6868 context. add_command_line_option ( "-flto=auto" ) ;
6969 context. add_command_line_option ( "-flto-partition=one" ) ;
70- //context.add_command_line_option("-fno-use-linker-plugin");
70+ // FIXME FIXME FIXME: it seems that uncommenting "ADD_ARG ("-fno-use-linker-plugin")" in libgccjit
71+ // make the test fail (undefined symbol main).
72+ // TODO: Perhaps we're not sending this flag somewhere?
73+ context. add_command_line_option ( "-fno-use-linker-plugin" ) ;
74+ context. add_driver_option ( "-fno-use-linker-plugin" ) ;
7175 // TODO(antoyo): remove since we don't want fat objects when it is for Bitcode only.
7276 context. add_command_line_option ( "-ffat-lto-objects" ) ;
7377 context. compile_to_file (
@@ -86,7 +90,8 @@ pub(crate) unsafe fn codegen(
8690
8791 context. add_command_line_option ( "-flto=auto" ) ;
8892 context. add_command_line_option ( "-flto-partition=one" ) ;
89- //context.add_command_line_option("-fno-use-linker-plugin");
93+ context. add_command_line_option ( "-fno-use-linker-plugin" ) ;
94+ context. add_driver_option ( "-fno-use-linker-plugin" ) ;
9095 context. add_command_line_option ( "-ffat-lto-objects" ) ;
9196 // 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).
9297 context. compile_to_file (
@@ -175,7 +180,8 @@ pub(crate) unsafe fn codegen(
175180 context. add_command_line_option ( "-flto=auto" ) ;
176181 context. add_command_line_option ( "-flto-partition=one" ) ;
177182 //context.add_command_line_option("-ffat-lto-objects");
178- //context.add_command_line_option("-fno-use-linker-plugin");
183+ context. add_command_line_option ( "-fno-use-linker-plugin" ) ;
184+ context. add_driver_option ( "-fno-use-linker-plugin" ) ;
179185
180186 // FIXME FIXME FIXME:
181187 // /usr/bin/ld: warning: incremental linking of LTO and non-LTO objects; using -flinker-output=nolto-rel which will bypass whole program optimization
@@ -215,6 +221,8 @@ pub(crate) unsafe fn codegen(
215221 println ! ( "****************************************************************************************************" ) ;
216222
217223 let context = Context :: default ( ) ;
224+ context. add_command_line_option ( "-fno-use-linker-plugin" ) ;
225+ context. add_driver_option ( "-fno-use-linker-plugin" ) ;
218226 if cgcx. target_arch == "x86" || cgcx. target_arch == "x86_64" {
219227 // NOTE: it seems we need to use add_driver_option instead of
220228 // add_command_line_option here because we use the LTO frontend via gcc.
0 commit comments