Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add error message for -fno-llvm -flld #19810

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Compilation/Config.zig
Original file line number Diff line number Diff line change
Expand Up @@ -119,6 +119,7 @@ pub const ResolveError = error{
ZigLacksTargetSupport,
EmittingBinaryRequiresLlvmLibrary,
LldIncompatibleObjectFormat,
LldCannotIncrementallyLink,
LtoRequiresLld,
SanitizeThreadRequiresLibCpp,
LibCppRequiresLibUnwind,
Expand Down Expand Up @@ -257,6 +258,11 @@ pub fn resolve(options: Options) ResolveError!Config {
break :b true;
}

if (options.use_llvm == false) {
if (options.use_lld == true) return error.LldCannotIncrementallyLink;
break :b false;
}

if (options.use_lld) |x| break :b x;
break :b true;
};
Expand Down
1 change: 1 addition & 0 deletions src/main.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3931,6 +3931,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.LtoRequiresLld => fatal("LTO requires using LLD", .{}),
error.SanitizeThreadRequiresLibCpp => fatal("thread sanitization is (for now) implemented in C++, so it requires linking libc++", .{}),
error.LibCppRequiresLibUnwind => fatal("libc++ requires linking libunwind", .{}),
Expand Down