zld: error out if LTO is requested targeting Darwin
This commit is contained in:
@@ -929,7 +929,9 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
|
||||
if (!use_lld and !options.target.isDarwin())
|
||||
return error.LtoUnavailableWithoutLld;
|
||||
break :blk explicit;
|
||||
} else if (!use_lld and !options.target.isDarwin()) {
|
||||
} else if (!use_lld) {
|
||||
// TODO zig ld LTO support
|
||||
// See https://github.com/ziglang/zig/issues/8680
|
||||
break :blk false;
|
||||
} else if (options.c_source_files.len == 0) {
|
||||
break :blk false;
|
||||
|
||||
@@ -1648,7 +1648,13 @@ fn buildOutputType(
|
||||
|
||||
if (use_lld) |opt| {
|
||||
if (opt and cross_target.isDarwin()) {
|
||||
fatal("-fLLD requested with Mach-O object format. Only the self-hosted linker is supported for this target.", .{});
|
||||
fatal("LLD requested with Mach-O object format. Only the self-hosted linker is supported for this target.", .{});
|
||||
}
|
||||
}
|
||||
|
||||
if (want_lto) |opt| {
|
||||
if (opt and cross_target.isDarwin()) {
|
||||
fatal("LTO is not yet supported with the Mach-O object format. More details: https://github.com/ziglang/zig/issues/8680", .{});
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user