Skip to content

Commit

Permalink
Revert "Switch to -ffunction-sections by default"
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bjorn3 committed Dec 5, 2024
1 parent 92b5873 commit 0974099
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/driver/aot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,10 @@ fn make_module(sess: &Session, name: String) -> UnwindModule<ObjectModule> {

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

Expand Down

0 comments on commit 0974099

Please sign in to comment.