Skip to content

Commit 4cc1c90

Browse files
committed
Use -ffunction-sections by default again
Cranelift now uses the same section name for all subsections which reduces the size overhead of -ffunction-sections.
1 parent 7f98f34 commit 4cc1c90

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

src/driver/aot.rs

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -333,10 +333,9 @@ 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(
337+
sess.opts.unstable_opts.function_sections.unwrap_or(sess.target.function_sections),
338+
);
340339
UnwindModule::new(ObjectModule::new(builder), true)
341340
}
342341

0 commit comments

Comments
 (0)