Skip to content

Commit 0974099

Browse files
committed
Revert "Switch to -ffunction-sections by default"
This reverts commit 65c5c7f. It unfortunately regresses the size of the target dir by a non-trivial amount. It could be re-enabled again once each subsection doesn't get a unique name anymore.
1 parent 92b5873 commit 0974099

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/driver/aot.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -333,7 +333,10 @@ 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-
builder.per_function_section(sess.opts.unstable_opts.function_sections.unwrap_or(true));
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));
337340
UnwindModule::new(ObjectModule::new(builder), true)
338341
}
339342

0 commit comments

Comments
 (0)