commit 4a2a9e9d24b71bd0bea80aaf88205039ae77c8df (tree)
parent 41a617990513a0b6a0ad1f10ca8b78f9ea69cb28
Author: Matthew Lugg <mlugg@mlugg.co.uk>
Date: Tue, 2 Jun 2026 07:27:10 +0100
Compilation.Config: rename an error
The old error name didn't align with the actual message we emitted, and
kept confusing me.
Diffstat:
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/src/Compilation/Config.zig b/src/Compilation/Config.zig
@@ -130,7 +130,7 @@ pub const ResolveError = error{
ZigLacksTargetSupport,
EmittingBinaryRequiresLlvmLibrary,
LldIncompatibleObjectFormat,
- LldCannotIncrementallyLink,
+ LldIncompatibleWithSelfHostedBackend,
LtoRequiresLld,
SanitizeThreadRequiresLibCpp,
LibCRequiresLibUnwind,
@@ -400,10 +400,10 @@ pub fn resolve(options: Options) ResolveError!Config {
break :b true;
}
- // If there's no ZCU we aren't using the LLVM backend but
- // it shouldn't influence which linker we pick
- if (!use_llvm and options.have_zcu) {
- if (options.use_lld == true) return error.LldCannotIncrementallyLink;
+ // If we have Zig code (i.e. a ZCU) and are compiling with a self-hosted backend, then we
+ // also need to use a self-hosted linker.
+ if (options.have_zcu and !use_llvm) {
+ if (options.use_lld == true) return error.LldIncompatibleWithSelfHostedBackend;
break :b false;
}
diff --git a/src/main.zig b/src/main.zig
@@ -4115,7 +4115,7 @@ fn createModule(
error.ZigLacksTargetSupport => fatal("compiler backend unavailable for the specified target", .{}),
error.EmittingBinaryRequiresLlvmLibrary => fatal("producing machine code via LLVM requires using the LLVM library", .{}),
error.LldIncompatibleObjectFormat => fatal("using LLD to link {s} files is unsupported", .{@tagName(target.ofmt)}),
- error.LldCannotIncrementallyLink => fatal("self-hosted backends do not support linking with LLD", .{}),
+ error.LldIncompatibleWithSelfHostedBackend => fatal("self-hosted backends do not support linking with LLD", .{}),
error.LtoRequiresLld => fatal("LTO requires using LLD", .{}),
error.SanitizeThreadRequiresLibCpp => fatal("thread sanitization is (for now) implemented in C++, so it requires linking libc++", .{}),
error.LibCRequiresLibUnwind => fatal("libc of the specified target requires linking libunwind", .{}),