Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/Package/Module.zig
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,12 @@ pub fn create(arena: Allocator, options: CreateOptions) !*Package.Module {
const omit_frame_pointer = b: {
if (options.inherited.omit_frame_pointer) |x| break :b x;
if (options.parent) |p| break :b p.omit_frame_pointer;
if (optimize_mode == .ReleaseSmall) break :b true;
if (optimize_mode == .ReleaseSmall) {
// On x86, in most cases, keeping the frame pointer usually results in smaller binary size.
// This has to do with how instructions for memory access via the stack base pointer register (when keeping the frame pointer)
// are smaller than instructions for memory access via the stack pointer register (when omitting the frame pointer).
break :b !target.cpu.arch.isX86();
}
break :b false;
};

Expand Down