Skip to content

Commit d378e0e

Browse files
committed
zld: disable LTO when targeting macOS
until we add linking of bitcode to the MachO backend.
1 parent 8211cef commit d378e0e

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/Compilation.zig

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -900,7 +900,10 @@ pub fn create(gpa: *Allocator, options: InitOptions) !*Compilation {
900900
};
901901

902902
const lto = blk: {
903-
if (options.want_lto) |explicit| {
903+
if (options.target.isDarwin()) {
904+
// TODO ability of zig ld MachO backend to link bitcode files
905+
break :blk false;
906+
} else if (options.want_lto) |explicit| {
904907
if (!use_lld)
905908
return error.LtoUnavailableWithoutLld;
906909
break :blk explicit;

0 commit comments

Comments
 (0)