about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--src/back/write.rs9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/back/write.rs b/src/back/write.rs
index 1f4eab28574..37a59e51c4b 100644
--- a/src/back/write.rs
+++ b/src/back/write.rs
@@ -111,9 +111,12 @@ pub(crate) unsafe fn codegen(
                     // TODO(antoyo): maybe we should call embed_bitcode to have the proper iOS fixes?
                     //embed_bitcode(cgcx, llcx, llmod, &config.bc_cmdline, data);
 
-                    context.add_command_line_option("-flto=auto");
-                    context.add_command_line_option("-flto-partition=one");
-                    context.add_command_line_option("-ffat-lto-objects");
+                    // TODO: check if this condition makes sense.
+                    if fat_lto {
+                        context.add_command_line_option("-flto=auto");
+                        context.add_command_line_option("-flto-partition=one");
+                        context.add_command_line_option("-ffat-lto-objects");
+                    }
                     // 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).
                     context.compile_to_file(
                         OutputKind::ObjectFile,