Skip to content

Commit 6d1124e

Browse files
committed
Only enable -ffunction-sections in release mode
1 parent 71f63d0 commit 6d1124e

File tree

1 file changed

+2
-1
lines changed
  • compiler/rustc_codegen_llvm/src/back

1 file changed

+2
-1
lines changed

compiler/rustc_codegen_llvm/src/back/write.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,8 @@ pub fn target_machine_factory(
128128
let (opt_level, _) = to_llvm_opt_settings(optlvl);
129129
let use_softfp = sess.opts.cg.soft_float;
130130

131-
let ffunction_sections = false;
131+
let ffunction_sections =
132+
sess.target.target.options.function_sections && optlvl != config::OptLevel::No;
132133
let fdata_sections = ffunction_sections;
133134

134135
let code_model = to_llvm_code_model(sess.code_model());

0 commit comments

Comments
 (0)