Skip to content

Commit 9673536

Browse files
committed
Fix for m68k
1 parent 74191f6 commit 9673536

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/back/write.rs

+10-5
Original file line numberDiff line numberDiff line change
@@ -111,9 +111,12 @@ pub(crate) unsafe fn codegen(
111111
// TODO(antoyo): maybe we should call embed_bitcode to have the proper iOS fixes?
112112
//embed_bitcode(cgcx, llcx, llmod, &config.bc_cmdline, data);
113113

114-
context.add_command_line_option("-flto=auto");
115-
context.add_command_line_option("-flto-partition=one");
116-
context.add_command_line_option("-ffat-lto-objects");
114+
// TODO: check if this condition makes sense.
115+
if fat_lto {
116+
context.add_command_line_option("-flto=auto");
117+
context.add_command_line_option("-flto-partition=one");
118+
context.add_command_line_option("-ffat-lto-objects");
119+
}
117120
// 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).
118121
context.compile_to_file(
119122
OutputKind::ObjectFile,
@@ -220,8 +223,10 @@ pub(crate) unsafe fn codegen(
220223
// TODO TODO: check that LTO still does the optimizations across different
221224
// object files with this change.
222225
// TODO: this should probably be in a condition `if fat_lto`.
223-
context.add_driver_option("-x");
224-
context.add_driver_option("lto");
226+
if fat_lto {
227+
context.add_driver_option("-x");
228+
context.add_driver_option("lto");
229+
}
225230
context.add_driver_option("-fPIC"); // TODO TODO: only add this flag when necessary.
226231
context.add_driver_option(lto_path);
227232

0 commit comments

Comments
 (0)