diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-07-11 14:18:56 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-07-11 14:18:56 -0700 |
| commit | 2b99182e25e045109b090a794bb06295b09a0eeb (patch) | |
| tree | 4cbb93210359b2b1f7e8359752807c8eb4dcf353 /src/link/Elf.zig | |
| parent | 1f410b500c8dbe33191a54a4ae02a6fb0febec46 (diff) | |
| download | zig-2b99182e25e045109b090a794bb06295b09a0eeb.tar.gz zig-2b99182e25e045109b090a794bb06295b09a0eeb.zip | |
stage2: cleanups to --compress-debug-sections
* make the setting in the linker backend be non-optional; by this time
all defaults are supposed to be resolved.
* integrate with `zig cc`
* change the CLI parsing to match C compiler parsing, allowing
`--compress-debug-sections` alone to choose a default encoding of
zlib.
Diffstat (limited to 'src/link/Elf.zig')
| -rw-r--r-- | src/link/Elf.zig | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/link/Elf.zig b/src/link/Elf.zig index bab7fb44cc..3e9b1ab3ed 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -1351,7 +1351,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v link.hashAddSystemLibs(&man.hash, self.base.options.system_libs); man.hash.add(allow_shlib_undefined); man.hash.add(self.base.options.bind_global_refs_locally); - man.hash.addOptional(self.base.options.compress_debug_sections); + man.hash.add(self.base.options.compress_debug_sections); man.hash.add(self.base.options.tsan); man.hash.addOptionalBytes(self.base.options.sysroot); man.hash.add(self.base.options.linker_optimization); @@ -1755,9 +1755,9 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v try argv.append("--allow-shlib-undefined"); } - if (self.base.options.compress_debug_sections) |how| { - const arg = try std.fmt.allocPrint(arena, "--compress-debug-sections={s}", .{@tagName(how)}); - try argv.append(arg); + switch (self.base.options.compress_debug_sections) { + .none => {}, + .zlib => try argv.append("--compress-debug-sections=zlib"), } if (self.base.options.bind_global_refs_locally) { |
