diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2022-05-31 22:56:39 -0700 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2022-05-31 22:56:39 -0700 |
| commit | cbb806da6e0b8f2f4d0d12ca57618c291acfa0c0 (patch) | |
| tree | 39ae80638ae38654145dd75d5e241301fdba626b /src/Compilation.zig | |
| parent | 8c0f4e6f54eefc56f69bf8def333ff8cf67c0783 (diff) | |
| download | zig-cbb806da6e0b8f2f4d0d12ca57618c291acfa0c0.tar.gz zig-cbb806da6e0b8f2f4d0d12ca57618c291acfa0c0.zip | |
stage2: -fbuild-id causes default linker to be LLD
until zig's self-hosted linker gains this functionality.
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index eb8b2b4d69..04e9d97719 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -975,6 +975,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { const unwind_tables = options.want_unwind_tables orelse (link_libunwind or target_util.needUnwindTables(options.target)); const link_eh_frame_hdr = options.link_eh_frame_hdr or unwind_tables; + const build_id = options.build_id orelse false; // Make a decision on whether to use LLD or our own linker. const use_lld = options.use_lld orelse blk: { @@ -1005,7 +1006,8 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { options.output_mode == .Lib or options.image_base_override != null or options.linker_script != null or options.version_script != null or - options.emit_implib != null) + options.emit_implib != null or + build_id) { break :blk true; } @@ -1640,7 +1642,7 @@ pub fn create(gpa: Allocator, options: InitOptions) !*Compilation { .skip_linker_dependencies = options.skip_linker_dependencies, .parent_compilation_link_libc = options.parent_compilation_link_libc, .each_lib_rpath = options.each_lib_rpath orelse options.is_native_os, - .build_id = options.build_id orelse false, + .build_id = build_id, .cache_mode = cache_mode, .disable_lld_caching = options.disable_lld_caching or cache_mode == .whole, .subsystem = options.subsystem, |
