authorgravatar for david@vortan.devDavid Rubin <david@vortan.dev> 2024-04-29 13:37:47-07:00
committergravatar for kubkon@jakubkonka.comJakub Konka <kubkon@jakubkonka.com> 2024-06-19 20:13:21+02:00
loge5a3a10a5a255cc01f3b9944a09a76753e32a8b7
tree436e0b48915dca5ddbaf723dc54b83991432631c
parenta154d8da8e39e5d0ed180b4a1e5150349699e5df

add error message for `-fno-llvm` `-flld`

We plan to remove all dependency on LLD either way, so this will not be a supported usecase.

2 files changed, 7 insertions(+), 0 deletions(-)

src/Compilation/Config.zig+6
......@@ -119,6 +119,7 @@ pub const ResolveError = error{
119119 ZigLacksTargetSupport,
120120 EmittingBinaryRequiresLlvmLibrary,
121121 LldIncompatibleObjectFormat,
122 LldCannotIncrementallyLink,
122123 LtoRequiresLld,
123124 SanitizeThreadRequiresLibCpp,
124125 LibCppRequiresLibUnwind,
......@@ -257,6 +258,11 @@ pub fn resolve(options: Options) ResolveError!Config {
257258 break :b true;
258259 }
259260
261 if (options.use_llvm == false) {
262 if (options.use_lld == true) return error.LldCannotIncrementallyLink;
263 break :b false;
264 }
265
260266 if (options.use_lld) |x| break :b x;
261267 break :b true;
262268 };
src/main.zig+1
......@@ -3949,6 +3949,7 @@ fn createModule(
39493949 error.ZigLacksTargetSupport => fatal("compiler backend unavailable for the specified target", .{}),
39503950 error.EmittingBinaryRequiresLlvmLibrary => fatal("producing machine code via LLVM requires using the LLVM library", .{}),
39513951 error.LldIncompatibleObjectFormat => fatal("using LLD to link {s} files is unsupported", .{@tagName(target.ofmt)}),
3952 error.LldCannotIncrementallyLink => fatal("self-hosted backends do not support linking with LLD", .{}),
39523953 error.LtoRequiresLld => fatal("LTO requires using LLD", .{}),
39533954 error.SanitizeThreadRequiresLibCpp => fatal("thread sanitization is (for now) implemented in C++, so it requires linking libc++", .{}),
39543955 error.LibCppRequiresLibUnwind => fatal("libc++ requires linking libunwind", .{}),