Skip to content

Commit 65c5c7f

Browse files
committed
Switch to -ffunction-sections by default
With lld the perf difference is within noise while producing slightly (or in exceptional cases significantly) smaller binaries.
1 parent a767a10 commit 65c5c7f

File tree

1 file changed

+1
-4
lines changed

1 file changed

+1
-4
lines changed

src/driver/aot.rs

+1-4
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,7 @@ fn make_module(sess: &Session, name: String) -> UnwindModule<ObjectModule> {
333333

334334
let mut builder =
335335
ObjectBuilder::new(isa, name + ".o", cranelift_module::default_libcall_names()).unwrap();
336-
// Unlike cg_llvm, cg_clif defaults to disabling -Zfunction-sections. For cg_llvm binary size
337-
// is important, while cg_clif cares more about compilation times. Enabling -Zfunction-sections
338-
// can easily double the amount of time necessary to perform linking.
339-
builder.per_function_section(sess.opts.unstable_opts.function_sections.unwrap_or(false));
336+
builder.per_function_section(sess.opts.unstable_opts.function_sections.unwrap_or(true));
340337
UnwindModule::new(ObjectModule::new(builder), true)
341338
}
342339

0 commit comments

Comments
 (0)