diff options
| author | David Gonzalez Martin <davidgm94.work@protonmail.com> | 2023-04-06 10:16:20 +0200 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2023-04-20 14:46:53 -0700 |
| commit | d026202a26e56e7e2ea20ca49509fdcf8b937020 (patch) | |
| tree | 12f872577f617312e9c6e68e0d53a29f1986d06e /src/Compilation.zig | |
| parent | fac120bc3ad58a10ab80952e42becd0084aec059 (diff) | |
| download | zig-d026202a26e56e7e2ea20ca49509fdcf8b937020.tar.gz zig-d026202a26e56e7e2ea20ca49509fdcf8b937020.zip | |
Expose an option for producing 64-bit DWARF format
This commit enables producing 64-bit DWARF format for Zig executables
that are produced through the LLVM backend. This is achieved by exposing
both command-line flags and CompileStep flags. The production of the
64-bit format only affects binaries that use the DWARF format and it is
disabled on MacOS due to it being problematic. This commit, despite
generating the interface for the Zig user to be able to tell the compile
which format is wanted, is just implemented for the LLVM backend, so
clang and the self-hosted backends will need this to be implemented in a
future commit.
This is an effort to work around #7962, since the emission of the 64-bit
format automatically produces 64-bit relocations. Further investigation
will be needed to make DWARF 32-bit format to emit bigger relocations
when needed and not make the linker angry.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index 48a0412b23..848b1594fa 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -620,6 +620,7 @@ pub const InitOptions = struct { test_name_prefix: ?[]const u8 = null, test_runner_path: ?[]const u8 = null, subsystem: ?std.Target.SubSystem = null, + dwarf_format: ?std.dwarf.Format = null, /// WASI-only. Type of WASI execution model ("command" or "reactor"). wasi_exec_model: ?std.builtin.WasiExecModel = null, /// (Zig compiler development) Enable dumping linker's state as JSON. @@ -1517,6 +1518,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { .disable_lld_caching = options.disable_lld_caching or cache_mode == .whole, .subsystem = options.subsystem, .is_test = options.is_test, + .dwarf_format = options.dwarf_format, .wasi_exec_model = wasi_exec_model, .hash_style = options.hash_style, .enable_link_snapshots = options.enable_link_snapshots, |
