macho: dead_strip defaults: off for debug, on for release

This commit is contained in:
Jakub Konka 2022-07-22 14:20:28 +02:00
parent 0901e4805c
commit f8458a549b
2 changed files with 2 additions and 3 deletions

View File

@ -712,7 +712,8 @@ fn linkOneShot(self: *MachO, comp: *Compilation, prog_node: *std.Progress.Node)
const is_dyn_lib = self.base.options.link_mode == .Dynamic and is_lib;
const is_exe_or_dyn_lib = is_dyn_lib or self.base.options.output_mode == .Exe;
const stack_size = self.base.options.stack_size_override orelse 0;
const gc_sections = self.base.options.gc_sections orelse false;
const is_debug_build = self.base.options.optimize_mode == .Debug;
const gc_sections = self.base.options.gc_sections orelse !is_debug_build;
const id_symlink_basename = "zld.id";

View File

@ -11,8 +11,6 @@ const MachO = @import("../MachO.zig");
const MatchingSection = MachO.MatchingSection;
pub fn gcAtoms(macho_file: *MachO) !void {
assert(macho_file.base.options.gc_sections.?);
const gpa = macho_file.base.allocator;
var arena_allocator = std.heap.ArenaAllocator.init(gpa);
defer arena_allocator.deinit();