diff options
| author | Motiejus Jakštys <motiejus@jakstys.lt> | 2022-05-09 09:44:14 +0300 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-09-08 22:30:32 -0400 |
| commit | a833bdcd7e6fcfee6e9cc33a3f7de78b16a36941 (patch) | |
| tree | 5b45c1662789e9743d328356167b3dce72495bfd /src/Compilation.zig | |
| parent | ab4b26d8a6a36ccf75af8e25f0a1f7b88063b76f (diff) | |
| download | zig-a833bdcd7e6fcfee6e9cc33a3f7de78b16a36941.tar.gz zig-a833bdcd7e6fcfee6e9cc33a3f7de78b16a36941.zip | |
[ld] add --print-* for diagnostics
This adds the following for passthrough to lld:
- `--print-gc-sections`
- `--print-icf-sections`
- `--print-map`
I am not adding these to the cache manifest, since it does not change
the produced artifacts.
Tested with an example from #11398: it successfully prints the resulting
map and the GC'd sections.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index c1321e40cf..597f5cffff 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -878,6 +878,9 @@ pub const InitOptions = struct { linker_shared_memory: bool = false, linker_global_base: ?u64 = null, linker_export_symbol_names: []const []const u8 = &.{}, + linker_print_gc_sections: bool = false, + linker_print_icf_sections: bool = false, + linker_print_map: bool = false, each_lib_rpath: ?bool = null, build_id: ?bool = null, disable_c_depfile: bool = false, @@ -1727,6 +1730,9 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { .shared_memory = options.linker_shared_memory, .global_base = options.linker_global_base, .export_symbol_names = options.linker_export_symbol_names, + .print_gc_sections = options.linker_print_gc_sections, + .print_icf_sections = options.linker_print_icf_sections, + .print_map = options.linker_print_map, .z_nodelete = options.linker_z_nodelete, .z_notext = options.linker_z_notext, .z_defs = options.linker_z_defs, |
