diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-06-07 13:08:22 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2025-06-07 13:08:22 -0400 |
| commit | 8b875b17ade95c4e0098c7c3b20134f03745aac3 (patch) | |
| tree | 02ee642b33451b453994f484a2204ddca42e4857 /src/Compilation.zig | |
| parent | 173bc4274446a14aca2eea128b70b35b0ba18ebe (diff) | |
| parent | 5a52da1b7a8c467087da8f3a20ab902ec8c1e25d (diff) | |
| download | zig-8b875b17ade95c4e0098c7c3b20134f03745aac3.tar.gz zig-8b875b17ade95c4e0098c7c3b20134f03745aac3.zip | |
Merge pull request #24072 from jacobly0/x86_64-default
Compilation: enable the x86_64 backend by default for debug builds
Diffstat (limited to 'src/Compilation.zig')
| -rw-r--r-- | src/Compilation.zig | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/src/Compilation.zig b/src/Compilation.zig index ba599d0207..81d150b03f 100644 --- a/src/Compilation.zig +++ b/src/Compilation.zig @@ -774,7 +774,7 @@ pub const Directories = struct { /// `comp.debug_incremental`. It is inline so that comptime-known `false` propagates to the caller, /// preventing debugging features from making it into release builds of the compiler. pub inline fn debugIncremental(comp: *const Compilation) bool { - if (!build_options.enable_debug_extensions) return false; + if (!build_options.enable_debug_extensions or builtin.single_threaded) return false; return comp.debug_incremental; } @@ -7225,7 +7225,7 @@ fn buildOutputFromZig( assert(out.* == null); out.* = crt_file; - comp.queueLinkTaskMode(crt_file.full_object_path, output_mode); + comp.queueLinkTaskMode(crt_file.full_object_path, &config); } pub const CrtFileOptions = struct { @@ -7349,7 +7349,7 @@ pub fn build_crt_file( try comp.updateSubCompilation(sub_compilation, misc_task_tag, prog_node); const crt_file = try sub_compilation.toCrtFile(); - comp.queueLinkTaskMode(crt_file.full_object_path, output_mode); + comp.queueLinkTaskMode(crt_file.full_object_path, &config); { comp.mutex.lock(); @@ -7359,11 +7359,14 @@ pub fn build_crt_file( } } -pub fn queueLinkTaskMode(comp: *Compilation, path: Cache.Path, output_mode: std.builtin.OutputMode) void { - comp.queueLinkTasks(switch (output_mode) { +pub fn queueLinkTaskMode(comp: *Compilation, path: Cache.Path, config: *const Compilation.Config) void { + comp.queueLinkTasks(switch (config.output_mode) { .Exe => unreachable, .Obj => &.{.{ .load_object = path }}, - .Lib => &.{.{ .load_archive = path }}, + .Lib => &.{switch (config.link_mode) { + .static => .{ .load_archive = path }, + .dynamic => .{ .load_dso = path }, + }}, }); } |
