File tree 2 files changed +13
-6
lines changed
2 files changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,9 @@ function jit_calc() {
70
70
object files when their content should have been changed by a change to cg_clif.</dd>
71
71
<dt>CG_CLIF_DISPLAY_CG_TIME</dt>
72
72
<dd>If "1", display the time it took to perform codegen for a crate</dd>
73
+ <dt>CG_CLIF_FUNCTION_SECTIONS</dt>
74
+ <dd>Use a single section for each function. This will often reduce the executable size at the
75
+ cost of making linking significantly slower.</dd>
73
76
</dl >
74
77
75
78
## Not yet supported
Original file line number Diff line number Diff line change @@ -186,13 +186,17 @@ pub(crate) type Backend =
186
186
impl cranelift_module:: Backend < Product : AddConstructor + Emit + WriteDebugInfo > ;
187
187
188
188
pub ( crate ) fn make_module ( sess : & Session , name : String ) -> Module < Backend > {
189
+ let mut builder = ObjectBuilder :: new (
190
+ crate :: build_isa ( sess, true ) ,
191
+ name + ".o" ,
192
+ cranelift_module:: default_libcall_names ( ) ,
193
+ )
194
+ . unwrap ( ) ;
195
+ if std:: env:: var ( "CG_CLIF_FUNCTION_SECTIONS" ) . is_ok ( ) {
196
+ builder. per_function_section ( true ) ;
197
+ }
189
198
let module: Module < ObjectBackend > = Module :: new (
190
- ObjectBuilder :: new (
191
- crate :: build_isa ( sess, true ) ,
192
- name + ".o" ,
193
- cranelift_module:: default_libcall_names ( ) ,
194
- )
195
- . unwrap ( ) ,
199
+ builder,
196
200
) ;
197
201
module
198
202
}
You can’t perform that action at this time.
0 commit comments