Skip to content

strip debug info from ReleaseSmall builds by default #6676

@atipls

Description

@atipls

Repro code:

const std = @import("std");
const linux = std.os.linux;

pub fn exit() void {
    _ = linux.syscall1(.exit, 0);
}

pub fn main() void {
    exit();
}

Running zig build-exe main.zig -target arm-linux-none -O ReleaseSmall for arm produces an executable that is 707KB in size. However, running zig build-exe main.zig -target arm-linux-none -O ReleaseSmall for i386 produces an executable that is just 61KB.

Appending --strip "fixes" the issue as the executables become 5KB and 3KB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    acceptedThis proposal is planned.breakingImplementing this issue could cause existing code to no longer compile or have different behavior.proposalThis issue suggests language modifications. If it also has the "accepted" label then it is planned.

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions