diff options
| author | LinuxUserGD <hugegameartgd@gmail.com> | 2023-08-16 21:37:04 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-09-26 14:18:01 -0700 |
| commit | ceaae42e90b1f4ba4aa59328e76913cdde3dedb9 (patch) | |
| tree | ef18b9854a2d1c85c9a8ece40c12e9966dad281f /src | |
| parent | 1c726bcb321d03ac74d1bd646b690991ba356fd8 (diff) | |
| download | zig-ceaae42e90b1f4ba4aa59328e76913cdde3dedb9.tar.gz zig-ceaae42e90b1f4ba4aa59328e76913cdde3dedb9.zip | |
Add '--compress-debug-sections=zstd'
Diffstat (limited to 'src')
| -rw-r--r-- | src/link.zig | 2 | ||||
| -rw-r--r-- | src/link/Elf.zig | 1 | ||||
| -rw-r--r-- | src/main.zig | 7 |
3 files changed, 6 insertions, 4 deletions
diff --git a/src/link.zig b/src/link.zig index 844ddb7b40..6c3e31ce3e 100644 --- a/src/link.zig +++ b/src/link.zig @@ -281,7 +281,7 @@ pub const Options = struct { pub const HashStyle = enum { sysv, gnu, both }; -pub const CompressDebugSections = enum { none, zlib }; +pub const CompressDebugSections = enum { none, zlib, zstd }; /// The filesystem layout of darwin SDK elements. pub const DarwinSdkLayout = enum { diff --git a/src/link/Elf.zig b/src/link/Elf.zig index bf7bfaeb43..6efe8cad67 100644 --- a/src/link/Elf.zig +++ b/src/link/Elf.zig @@ -2230,6 +2230,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v switch (self.base.options.compress_debug_sections) { .none => {}, .zlib => try argv.append("--compress-debug-sections=zlib"), + .zstd => try argv.append("--compress-debug-sections=zstd"), } if (self.base.options.bind_global_refs_locally) { diff --git a/src/main.zig b/src/main.zig index e5e5eb0051..4193ab0b07 100644 --- a/src/main.zig +++ b/src/main.zig @@ -539,6 +539,7 @@ const usage_build_generic = \\ --compress-debug-sections=[e] Debug section compression settings \\ none No compression \\ zlib Compression with deflate/inflate + \\ zstd Compression with zstandard \\ --gc-sections Force removal of functions and data that are unreachable by the entry point or exported symbols \\ --no-gc-sections Don't force removal of unreachable functions and data \\ --sort-section=[value] Sort wildcard section patterns by 'name' or 'alignment' @@ -1110,7 +1111,7 @@ fn buildOutputType( } else if (mem.startsWith(u8, arg, "--compress-debug-sections=")) { const param = arg["--compress-debug-sections=".len..]; linker_compress_debug_sections = std.meta.stringToEnum(link.CompressDebugSections, param) orelse { - fatal("expected --compress-debug-sections=[none|zlib], found '{s}'", .{param}); + fatal("expected --compress-debug-sections=[none|zlib|zstd], found '{s}'", .{param}); }; } else if (mem.eql(u8, arg, "--compress-debug-sections")) { linker_compress_debug_sections = link.CompressDebugSections.zlib; @@ -1986,7 +1987,7 @@ fn buildOutputType( linker_compress_debug_sections = .zlib; } else { linker_compress_debug_sections = std.meta.stringToEnum(link.CompressDebugSections, it.only_arg) orelse { - fatal("expected [none|zlib] after --compress-debug-sections, found '{s}'", .{it.only_arg}); + fatal("expected [none|zlib|zstd] after --compress-debug-sections, found '{s}'", .{it.only_arg}); }; } }, @@ -2139,7 +2140,7 @@ fn buildOutputType( } else if (mem.eql(u8, arg, "--compress-debug-sections")) { const arg1 = linker_args_it.nextOrFatal(); linker_compress_debug_sections = std.meta.stringToEnum(link.CompressDebugSections, arg1) orelse { - fatal("expected [none|zlib] after --compress-debug-sections, found '{s}'", .{arg1}); + fatal("expected [none|zlib|zstd] after --compress-debug-sections, found '{s}'", .{arg1}); }; } else if (mem.startsWith(u8, arg, "-z")) { var z_arg = arg[2..]; |
