| author | |
| committer | |
| log | 8b3f15f21824e77e776336d8be5832502946621b |
| tree | 691781676c3ad9e7c4fad03a4b4f34a4be8853d2 |
| parent | da75eb0d7909b53aea78cbe5c9165f6621ccc9fa |
| parent | 2b99182e25e045109b090a794bb06295b09a0eeb |
| signature | Signed by PGP key 4AEE18F83AFDEB23 |
ELF: understand --compress-debug-sections6 files changed, 69 insertions(+), 18 deletions(-)
src/Compilation.zig+3| ... | @@ -881,6 +881,7 @@ pub const InitOptions = struct { | ... | @@ -881,6 +881,7 @@ pub const InitOptions = struct { |
| 881 | linker_nxcompat: bool = false, | 881 | linker_nxcompat: bool = false, |
| 882 | linker_dynamicbase: bool = false, | 882 | linker_dynamicbase: bool = false, |
| 883 | linker_optimization: ?u8 = null, | 883 | linker_optimization: ?u8 = null, |
| 884 | linker_compress_debug_sections: ?link.CompressDebugSections = null, | ||
| 884 | major_subsystem_version: ?u32 = null, | 885 | major_subsystem_version: ?u32 = null, |
| 885 | minor_subsystem_version: ?u32 = null, | 886 | minor_subsystem_version: ?u32 = null, |
| 886 | clang_passthrough_mode: bool = false, | 887 | clang_passthrough_mode: bool = false, |
| ... | @@ -1708,6 +1709,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { | ... | @@ -1708,6 +1709,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { |
| 1708 | .no_builtin = options.no_builtin, | 1709 | .no_builtin = options.no_builtin, |
| 1709 | .allow_shlib_undefined = options.linker_allow_shlib_undefined, | 1710 | .allow_shlib_undefined = options.linker_allow_shlib_undefined, |
| 1710 | .bind_global_refs_locally = options.linker_bind_global_refs_locally orelse false, | 1711 | .bind_global_refs_locally = options.linker_bind_global_refs_locally orelse false, |
| 1712 | .compress_debug_sections = options.linker_compress_debug_sections orelse .none, | ||
| 1711 | .import_memory = options.linker_import_memory orelse false, | 1713 | .import_memory = options.linker_import_memory orelse false, |
| 1712 | .import_table = options.linker_import_table, | 1714 | .import_table = options.linker_import_table, |
| 1713 | .export_table = options.linker_export_table, | 1715 | .export_table = options.linker_export_table, |
| ... | @@ -2480,6 +2482,7 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes | ... | @@ -2480,6 +2482,7 @@ fn addNonIncrementalStuffToCacheManifest(comp: *Compilation, man: *Cache.Manifes |
| 2480 | man.hash.add(comp.bin_file.options.z_now); | 2482 | man.hash.add(comp.bin_file.options.z_now); |
| 2481 | man.hash.add(comp.bin_file.options.z_relro); | 2483 | man.hash.add(comp.bin_file.options.z_relro); |
| 2482 | man.hash.add(comp.bin_file.options.hash_style); | 2484 | man.hash.add(comp.bin_file.options.hash_style); |
| 2485 | man.hash.add(comp.bin_file.options.compress_debug_sections); | ||
| 2483 | man.hash.add(comp.bin_file.options.include_compiler_rt); | 2486 | man.hash.add(comp.bin_file.options.include_compiler_rt); |
| 2484 | if (comp.bin_file.options.link_libc) { | 2487 | if (comp.bin_file.options.link_libc) { |
| 2485 | man.hash.add(comp.bin_file.options.libc_installation != null); | 2488 | man.hash.add(comp.bin_file.options.libc_installation != null); |
src/clang_options_data.zig+18-18| ... | @@ -2308,7 +2308,7 @@ flagpd1("compiler-options-dump"), | ... | @@ -2308,7 +2308,7 @@ flagpd1("compiler-options-dump"), |
| 2308 | .{ | 2308 | .{ |
| 2309 | .name = "compress-debug-sections", | 2309 | .name = "compress-debug-sections", |
| 2310 | .syntax = .flag, | 2310 | .syntax = .flag, |
| 2311 | .zig_equivalent = .other, | 2311 | .zig_equivalent = .compress_debug_sections, |
| 2312 | .pd1 = true, | 2312 | .pd1 = true, |
| 2313 | .pd2 = true, | 2313 | .pd2 = true, |
| 2314 | .psl = false, | 2314 | .psl = false, |
| ... | @@ -3834,7 +3834,7 @@ m("mavx512cd"), | ... | @@ -3834,7 +3834,7 @@ m("mavx512cd"), |
| 3834 | m("mavx512dq"), | 3834 | m("mavx512dq"), |
| 3835 | m("mavx512er"), | 3835 | m("mavx512er"), |
| 3836 | m("mavx512f"), | 3836 | m("mavx512f"), |
| 3837 | flagpd1("mavx512fp16"), | 3837 | m("mavx512fp16"), |
| 3838 | m("mavx512ifma"), | 3838 | m("mavx512ifma"), |
| 3839 | m("mavx512pf"), | 3839 | m("mavx512pf"), |
| 3840 | m("mavx512vbmi"), | 3840 | m("mavx512vbmi"), |
| ... | @@ -3867,7 +3867,7 @@ flagpd1("mconstructor-aliases"), | ... | @@ -3867,7 +3867,7 @@ flagpd1("mconstructor-aliases"), |
| 3867 | flagpd1("mcpu=?"), | 3867 | flagpd1("mcpu=?"), |
| 3868 | m("mcrbits"), | 3868 | m("mcrbits"), |
| 3869 | m("mcrc"), | 3869 | m("mcrc"), |
| 3870 | flagpd1("mcrc32"), | 3870 | m("mcrc32"), |
| 3871 | m("mcumode"), | 3871 | m("mcumode"), |
| 3872 | m("mcx16"), | 3872 | m("mcx16"), |
| 3873 | sepd1("mdebug-pass"), | 3873 | sepd1("mdebug-pass"), |
| ... | @@ -3892,8 +3892,8 @@ flagpd1("mfancy-math-387"), | ... | @@ -3892,8 +3892,8 @@ flagpd1("mfancy-math-387"), |
| 3892 | flagpd1("mfentry"), | 3892 | flagpd1("mfentry"), |
| 3893 | flagpd1("mfix4300"), | 3893 | flagpd1("mfix4300"), |
| 3894 | flagpd1("mfix-and-continue"), | 3894 | flagpd1("mfix-and-continue"), |
| 3895 | flagpd1("mfix-cmse-cve-2021-35465"), | 3895 | m("mfix-cmse-cve-2021-35465"), |
| 3896 | flagpd1("mfix-cortex-a53-835769"), | 3896 | m("mfix-cortex-a53-835769"), |
| 3897 | m("mfloat128"), | 3897 | m("mfloat128"), |
| 3898 | sepd1("mfloat-abi"), | 3898 | sepd1("mfloat-abi"), |
| 3899 | m("mfma"), | 3899 | m("mfma"), |
| ... | @@ -3913,8 +3913,8 @@ flagpd1("mglobal-merge"), | ... | @@ -3913,8 +3913,8 @@ flagpd1("mglobal-merge"), |
| 3913 | flagpd1("mgpopt"), | 3913 | flagpd1("mgpopt"), |
| 3914 | m("mhard-float"), | 3914 | m("mhard-float"), |
| 3915 | m("mhvx"), | 3915 | m("mhvx"), |
| 3916 | flagpd1("mhvx-ieee-fp"), | 3916 | m("mhvx-ieee-fp"), |
| 3917 | flagpd1("mhvx-qfloat"), | 3917 | m("mhvx-qfloat"), |
| 3918 | m("mhreset"), | 3918 | m("mhreset"), |
| 3919 | m("mhtm"), | 3919 | m("mhtm"), |
| 3920 | flagpd1("miamcu"), | 3920 | flagpd1("miamcu"), |
| ... | @@ -4005,7 +4005,7 @@ m("mno-avx512cd"), | ... | @@ -4005,7 +4005,7 @@ m("mno-avx512cd"), |
| 4005 | m("mno-avx512dq"), | 4005 | m("mno-avx512dq"), |
| 4006 | m("mno-avx512er"), | 4006 | m("mno-avx512er"), |
| 4007 | m("mno-avx512f"), | 4007 | m("mno-avx512f"), |
| 4008 | flagpd1("mno-avx512fp16"), | 4008 | m("mno-avx512fp16"), |
| 4009 | m("mno-avx512ifma"), | 4009 | m("mno-avx512ifma"), |
| 4010 | m("mno-avx512pf"), | 4010 | m("mno-avx512pf"), |
| 4011 | m("mno-avx512vbmi"), | 4011 | m("mno-avx512vbmi"), |
| ... | @@ -4019,7 +4019,7 @@ flagpd1("mno-backchain"), | ... | @@ -4019,7 +4019,7 @@ flagpd1("mno-backchain"), |
| 4019 | m("mno-bmi"), | 4019 | m("mno-bmi"), |
| 4020 | m("mno-bmi2"), | 4020 | m("mno-bmi2"), |
| 4021 | flagpd1("mno-branch-likely"), | 4021 | flagpd1("mno-branch-likely"), |
| 4022 | flagpd1("mno-bti-at-return-twice"), | 4022 | m("mno-bti-at-return-twice"), |
| 4023 | m("mno-bulk-memory"), | 4023 | m("mno-bulk-memory"), |
| 4024 | flagpd1("mno-check-zero-division"), | 4024 | flagpd1("mno-check-zero-division"), |
| 4025 | m("mno-cldemote"), | 4025 | m("mno-cldemote"), |
| ... | @@ -4032,7 +4032,7 @@ flagpd1("mno-constant-cfstrings"), | ... | @@ -4032,7 +4032,7 @@ flagpd1("mno-constant-cfstrings"), |
| 4032 | flagpd1("mno-constructor-aliases"), | 4032 | flagpd1("mno-constructor-aliases"), |
| 4033 | m("mno-crbits"), | 4033 | m("mno-crbits"), |
| 4034 | m("mno-crc"), | 4034 | m("mno-crc"), |
| 4035 | flagpd1("mno-crc32"), | 4035 | m("mno-crc32"), |
| 4036 | m("mno-cumode"), | 4036 | m("mno-cumode"), |
| 4037 | m("mno-cx16"), | 4037 | m("mno-cx16"), |
| 4038 | m("mno-dsp"), | 4038 | m("mno-dsp"), |
| ... | @@ -4044,8 +4044,8 @@ flagpd1("mnoexecstack"), | ... | @@ -4044,8 +4044,8 @@ flagpd1("mnoexecstack"), |
| 4044 | m("mno-execute-only"), | 4044 | m("mno-execute-only"), |
| 4045 | flagpd1("mno-extern-sdata"), | 4045 | flagpd1("mno-extern-sdata"), |
| 4046 | m("mno-f16c"), | 4046 | m("mno-f16c"), |
| 4047 | flagpd1("mno-fix-cmse-cve-2021-35465"), | 4047 | m("mno-fix-cmse-cve-2021-35465"), |
| 4048 | flagpd1("mno-fix-cortex-a53-835769"), | 4048 | m("mno-fix-cortex-a53-835769"), |
| 4049 | m("mno-float128"), | 4049 | m("mno-float128"), |
| 4050 | m("mno-fma"), | 4050 | m("mno-fma"), |
| 4051 | m("mno-fma4"), | 4051 | m("mno-fma4"), |
| ... | @@ -4058,8 +4058,8 @@ m("mno-ginv"), | ... | @@ -4058,8 +4058,8 @@ m("mno-ginv"), |
| 4058 | flagpd1("mno-global-merge"), | 4058 | flagpd1("mno-global-merge"), |
| 4059 | flagpd1("mno-gpopt"), | 4059 | flagpd1("mno-gpopt"), |
| 4060 | m("mno-hvx"), | 4060 | m("mno-hvx"), |
| 4061 | flagpd1("mno-hvx-ieee-fp"), | 4061 | m("mno-hvx-ieee-fp"), |
| 4062 | flagpd1("mno-hvx-qfloat"), | 4062 | m("mno-hvx-qfloat"), |
| 4063 | m("mno-hreset"), | 4063 | m("mno-hreset"), |
| 4064 | m("mno-htm"), | 4064 | m("mno-htm"), |
| 4065 | flagpd1("mno-iamcu"), | 4065 | flagpd1("mno-iamcu"), |
| ... | @@ -4137,7 +4137,7 @@ m("mno-reference-types"), | ... | @@ -4137,7 +4137,7 @@ m("mno-reference-types"), |
| 4137 | m("mno-relax"), | 4137 | m("mno-relax"), |
| 4138 | flagpd1("mno-relax-all"), | 4138 | flagpd1("mno-relax-all"), |
| 4139 | flagpd1("mno-relax-pic-calls"), | 4139 | flagpd1("mno-relax-pic-calls"), |
| 4140 | flagpd1("mno-relaxed-simd"), | 4140 | m("mno-relaxed-simd"), |
| 4141 | flagpd1("mno-restrict-it"), | 4141 | flagpd1("mno-restrict-it"), |
| 4142 | m("mno-retpoline"), | 4142 | m("mno-retpoline"), |
| 4143 | m("mno-retpoline-external-thunk"), | 4143 | m("mno-retpoline-external-thunk"), |
| ... | @@ -4259,7 +4259,7 @@ flagpd1("mrelax-pic-calls"), | ... | @@ -4259,7 +4259,7 @@ flagpd1("mrelax-pic-calls"), |
| 4259 | .pd2 = true, | 4259 | .pd2 = true, |
| 4260 | .psl = false, | 4260 | .psl = false, |
| 4261 | }, | 4261 | }, |
| 4262 | flagpd1("mrelaxed-simd"), | 4262 | m("mrelaxed-simd"), |
| 4263 | sepd1("mrelocation-model"), | 4263 | sepd1("mrelocation-model"), |
| 4264 | flagpd1("mrestrict-it"), | 4264 | flagpd1("mrestrict-it"), |
| 4265 | m("mretpoline"), | 4265 | m("mretpoline"), |
| ... | @@ -4323,7 +4323,7 @@ m("mv66"), | ... | @@ -4323,7 +4323,7 @@ m("mv66"), |
| 4323 | m("mv67"), | 4323 | m("mv67"), |
| 4324 | flagpd1("mv67t"), | 4324 | flagpd1("mv67t"), |
| 4325 | m("mv68"), | 4325 | m("mv68"), |
| 4326 | flagpd1("mv69"), | 4326 | m("mv69"), |
| 4327 | m("mvaes"), | 4327 | m("mvaes"), |
| 4328 | m("mvirt"), | 4328 | m("mvirt"), |
| 4329 | m("mvpclmulqdq"), | 4329 | m("mvpclmulqdq"), |
| ... | @@ -5087,7 +5087,7 @@ joinpd1("msign-return-address-key="), | ... | @@ -5087,7 +5087,7 @@ joinpd1("msign-return-address-key="), |
| 5087 | .{ | 5087 | .{ |
| 5088 | .name = "compress-debug-sections=", | 5088 | .name = "compress-debug-sections=", |
| 5089 | .syntax = .joined, | 5089 | .syntax = .joined, |
| 5090 | .zig_equivalent = .other, | 5090 | .zig_equivalent = .compress_debug_sections, |
| 5091 | .pd1 = true, | 5091 | .pd1 = true, |
| 5092 | .pd2 = true, | 5092 | .pd2 = true, |
| 5093 | .psl = false, | 5093 | .psl = false, |
src/link.zig+3| ... | @@ -123,6 +123,7 @@ pub const Options = struct { | ... | @@ -123,6 +123,7 @@ pub const Options = struct { |
| 123 | nxcompat: bool, | 123 | nxcompat: bool, |
| 124 | dynamicbase: bool, | 124 | dynamicbase: bool, |
| 125 | linker_optimization: u8, | 125 | linker_optimization: u8, |
| 126 | compress_debug_sections: CompressDebugSections, | ||
| 126 | bind_global_refs_locally: bool, | 127 | bind_global_refs_locally: bool, |
| 127 | import_memory: bool, | 128 | import_memory: bool, |
| 128 | import_table: bool, | 129 | import_table: bool, |
| ... | @@ -219,6 +220,8 @@ pub const Options = struct { | ... | @@ -219,6 +220,8 @@ pub const Options = struct { |
| 219 | 220 | ||
| 220 | pub const HashStyle = enum { sysv, gnu, both }; | 221 | pub const HashStyle = enum { sysv, gnu, both }; |
| 221 | 222 | ||
| 223 | pub const CompressDebugSections = enum { none, zlib }; | ||
| 224 | |||
| 222 | pub const File = struct { | 225 | pub const File = struct { |
| 223 | tag: Tag, | 226 | tag: Tag, |
| 224 | options: Options, | 227 | options: Options, |
src/link/Elf.zig+6| ... | @@ -1351,6 +1351,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v | ... | @@ -1351,6 +1351,7 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v |
| 1351 | link.hashAddSystemLibs(&man.hash, self.base.options.system_libs); | 1351 | link.hashAddSystemLibs(&man.hash, self.base.options.system_libs); |
| 1352 | man.hash.add(allow_shlib_undefined); | 1352 | man.hash.add(allow_shlib_undefined); |
| 1353 | man.hash.add(self.base.options.bind_global_refs_locally); | 1353 | man.hash.add(self.base.options.bind_global_refs_locally); |
| 1354 | man.hash.add(self.base.options.compress_debug_sections); | ||
| 1354 | man.hash.add(self.base.options.tsan); | 1355 | man.hash.add(self.base.options.tsan); |
| 1355 | man.hash.addOptionalBytes(self.base.options.sysroot); | 1356 | man.hash.addOptionalBytes(self.base.options.sysroot); |
| 1356 | man.hash.add(self.base.options.linker_optimization); | 1357 | man.hash.add(self.base.options.linker_optimization); |
| ... | @@ -1754,6 +1755,11 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v | ... | @@ -1754,6 +1755,11 @@ fn linkWithLLD(self: *Elf, comp: *Compilation, prog_node: *std.Progress.Node) !v |
| 1754 | try argv.append("--allow-shlib-undefined"); | 1755 | try argv.append("--allow-shlib-undefined"); |
| 1755 | } | 1756 | } |
| 1756 | 1757 | ||
| 1758 | switch (self.base.options.compress_debug_sections) { | ||
| 1759 | .none => {}, | ||
| 1760 | .zlib => try argv.append("--compress-debug-sections=zlib"), | ||
| 1761 | } | ||
| 1762 | |||
| 1757 | if (self.base.options.bind_global_refs_locally) { | 1763 | if (self.base.options.bind_global_refs_locally) { |
| 1758 | try argv.append("-Bsymbolic"); | 1764 | try argv.append("-Bsymbolic"); |
| 1759 | } | 1765 | } |
src/main.zig+31| ... | @@ -443,6 +443,9 @@ const usage_build_generic = | ... | @@ -443,6 +443,9 @@ const usage_build_generic = |
| 443 | \\ -dynamic Force output to be dynamically linked | 443 | \\ -dynamic Force output to be dynamically linked |
| 444 | \\ -static Force output to be statically linked | 444 | \\ -static Force output to be statically linked |
| 445 | \\ -Bsymbolic Bind global references locally | 445 | \\ -Bsymbolic Bind global references locally |
| 446 | \\ --compress-debug-sections=[e] Debug section compression settings | ||
| 447 | \\ none No compression | ||
| 448 | \\ zlib Compression with deflate/inflate | ||
| 446 | \\ --subsystem [subsystem] (Windows) /SUBSYSTEM:<subsystem> to the linker | 449 | \\ --subsystem [subsystem] (Windows) /SUBSYSTEM:<subsystem> to the linker |
| 447 | \\ --stack [size] Override default stack size | 450 | \\ --stack [size] Override default stack size |
| 448 | \\ --image-base [addr] Set base address for executable image | 451 | \\ --image-base [addr] Set base address for executable image |
| ... | @@ -657,6 +660,7 @@ fn buildOutputType( | ... | @@ -657,6 +660,7 @@ fn buildOutputType( |
| 657 | var version_script: ?[]const u8 = null; | 660 | var version_script: ?[]const u8 = null; |
| 658 | var disable_c_depfile = false; | 661 | var disable_c_depfile = false; |
| 659 | var linker_gc_sections: ?bool = null; | 662 | var linker_gc_sections: ?bool = null; |
| 663 | var linker_compress_debug_sections: ?link.CompressDebugSections = null; | ||
| 660 | var linker_allow_shlib_undefined: ?bool = null; | 664 | var linker_allow_shlib_undefined: ?bool = null; |
| 661 | var linker_bind_global_refs_locally: ?bool = null; | 665 | var linker_bind_global_refs_locally: ?bool = null; |
| 662 | var linker_import_memory: ?bool = null; | 666 | var linker_import_memory: ?bool = null; |
| ... | @@ -938,6 +942,13 @@ fn buildOutputType( | ... | @@ -938,6 +942,13 @@ fn buildOutputType( |
| 938 | install_name = args_iter.next() orelse { | 942 | install_name = args_iter.next() orelse { |
| 939 | fatal("expected parameter after {s}", .{arg}); | 943 | fatal("expected parameter after {s}", .{arg}); |
| 940 | }; | 944 | }; |
| 945 | } else if (mem.startsWith(u8, arg, "--compress-debug-sections=")) { | ||
| 946 | const param = arg["--compress-debug-sections=".len..]; | ||
| 947 | linker_compress_debug_sections = std.meta.stringToEnum(link.CompressDebugSections, param) orelse { | ||
| 948 | fatal("expected --compress-debug-sections=[none|zlib], found '{s}'", .{param}); | ||
| 949 | }; | ||
| 950 | } else if (mem.eql(u8, arg, "--compress-debug-sections")) { | ||
| 951 | linker_compress_debug_sections = link.CompressDebugSections.zlib; | ||
| 941 | } else if (mem.eql(u8, arg, "-pagezero_size")) { | 952 | } else if (mem.eql(u8, arg, "-pagezero_size")) { |
| 942 | const next_arg = args_iter.next() orelse { | 953 | const next_arg = args_iter.next() orelse { |
| 943 | fatal("expected parameter after {s}", .{arg}); | 954 | fatal("expected parameter after {s}", .{arg}); |
| ... | @@ -1640,6 +1651,15 @@ fn buildOutputType( | ... | @@ -1640,6 +1651,15 @@ fn buildOutputType( |
| 1640 | .weak_library => try system_libs.put(it.only_arg, .{ .weak = true }), | 1651 | .weak_library => try system_libs.put(it.only_arg, .{ .weak = true }), |
| 1641 | .weak_framework => try frameworks.put(gpa, it.only_arg, .{ .weak = true }), | 1652 | .weak_framework => try frameworks.put(gpa, it.only_arg, .{ .weak = true }), |
| 1642 | .headerpad_max_install_names => headerpad_max_install_names = true, | 1653 | .headerpad_max_install_names => headerpad_max_install_names = true, |
| 1654 | .compress_debug_sections => { | ||
| 1655 | if (it.only_arg.len == 0) { | ||
| 1656 | linker_compress_debug_sections = .zlib; | ||
| 1657 | } else { | ||
| 1658 | linker_compress_debug_sections = std.meta.stringToEnum(link.CompressDebugSections, it.only_arg) orelse { | ||
| 1659 | fatal("expected [none|zlib] after --compress-debug-sections, found '{s}'", .{it.only_arg}); | ||
| 1660 | }; | ||
| 1661 | } | ||
| 1662 | }, | ||
| 1643 | } | 1663 | } |
| 1644 | } | 1664 | } |
| 1645 | // Parse linker args. | 1665 | // Parse linker args. |
| ... | @@ -1776,6 +1796,15 @@ fn buildOutputType( | ... | @@ -1776,6 +1796,15 @@ fn buildOutputType( |
| 1776 | linker_global_base = parseIntSuffix(arg, "--global-base=".len); | 1796 | linker_global_base = parseIntSuffix(arg, "--global-base=".len); |
| 1777 | } else if (mem.startsWith(u8, arg, "--export=")) { | 1797 | } else if (mem.startsWith(u8, arg, "--export=")) { |
| 1778 | try linker_export_symbol_names.append(arg["--export=".len..]); | 1798 | try linker_export_symbol_names.append(arg["--export=".len..]); |
| 1799 | } else if (mem.eql(u8, arg, "--compress-debug-sections")) { | ||
| 1800 | i += 1; | ||
| 1801 | if (i >= linker_args.items.len) { | ||
| 1802 | fatal("expected linker arg after '{s}'", .{arg}); | ||
| 1803 | } | ||
| 1804 | const arg1 = linker_args.items[i]; | ||
| 1805 | linker_compress_debug_sections = std.meta.stringToEnum(link.CompressDebugSections, arg1) orelse { | ||
| 1806 | fatal("expected [none|zlib] after --compress-debug-sections, found '{s}'", .{arg1}); | ||
| 1807 | }; | ||
| 1779 | } else if (mem.eql(u8, arg, "-z")) { | 1808 | } else if (mem.eql(u8, arg, "-z")) { |
| 1780 | i += 1; | 1809 | i += 1; |
| 1781 | if (i >= linker_args.items.len) { | 1810 | if (i >= linker_args.items.len) { |
| ... | @@ -2849,6 +2878,7 @@ fn buildOutputType( | ... | @@ -2849,6 +2878,7 @@ fn buildOutputType( |
| 2849 | .linker_nxcompat = linker_nxcompat, | 2878 | .linker_nxcompat = linker_nxcompat, |
| 2850 | .linker_dynamicbase = linker_dynamicbase, | 2879 | .linker_dynamicbase = linker_dynamicbase, |
| 2851 | .linker_optimization = linker_optimization, | 2880 | .linker_optimization = linker_optimization, |
| 2881 | .linker_compress_debug_sections = linker_compress_debug_sections, | ||
| 2852 | .major_subsystem_version = major_subsystem_version, | 2882 | .major_subsystem_version = major_subsystem_version, |
| 2853 | .minor_subsystem_version = minor_subsystem_version, | 2883 | .minor_subsystem_version = minor_subsystem_version, |
| 2854 | .link_eh_frame_hdr = link_eh_frame_hdr, | 2884 | .link_eh_frame_hdr = link_eh_frame_hdr, |
| ... | @@ -4599,6 +4629,7 @@ pub const ClangArgIterator = struct { | ... | @@ -4599,6 +4629,7 @@ pub const ClangArgIterator = struct { |
| 4599 | weak_library, | 4629 | weak_library, |
| 4600 | weak_framework, | 4630 | weak_framework, |
| 4601 | headerpad_max_install_names, | 4631 | headerpad_max_install_names, |
| 4632 | compress_debug_sections, | ||
| 4602 | }; | 4633 | }; |
| 4603 | 4634 | ||
| 4604 | const Args = struct { | 4635 | const Args = struct { |
tools/update_clang_options.zig+8| ... | @@ -460,6 +460,14 @@ const known_options = [_]KnownOpt{ | ... | @@ -460,6 +460,14 @@ const known_options = [_]KnownOpt{ |
| 460 | .name = "headerpad_max_install_names", | 460 | .name = "headerpad_max_install_names", |
| 461 | .ident = "headerpad_max_install_names", | 461 | .ident = "headerpad_max_install_names", |
| 462 | }, | 462 | }, |
| 463 | .{ | ||
| 464 | .name = "compress-debug-sections", | ||
| 465 | .ident = "compress_debug_sections", | ||
| 466 | }, | ||
| 467 | .{ | ||
| 468 | .name = "compress-debug-sections=", | ||
| 469 | .ident = "compress_debug_sections", | ||
| 470 | }, | ||
| 463 | }; | 471 | }; |
| 464 | 472 | ||
| 465 | const blacklisted_options = [_][]const u8{}; | 473 | const blacklisted_options = [_][]const u8{}; |