Skip to content

Commit 7d06bdd

Browse files
committed
set frame pointer elimination attribute for main
The rustc-generated function `main` should respect the same config for frame pointer elimination as the rest of code.
1 parent f9f45c6 commit 7d06bdd

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/librustc_trans/base.rs

+3
Original file line numberDiff line numberDiff line change
@@ -1196,6 +1196,9 @@ pub fn maybe_create_entry_wrapper(ccx: &CrateContext) {
11961196
}
11971197
let llfn = declare::declare_cfn(ccx, "main", llfty);
11981198

1199+
// `main` should respect same config for frame pointer elimination as rest of code
1200+
attributes::set_frame_pointer_elimination(ccx, llfn);
1201+
11991202
let llbb = unsafe {
12001203
llvm::LLVMAppendBasicBlockInContext(ccx.llcx(), llfn, "top\0".as_ptr() as *const _)
12011204
};

0 commit comments

Comments
 (0)