From 798d05dd02a1c350c1ae48b25b84c0b88db9f449 Mon Sep 17 00:00:00 2001 From: Vexu <15308111+Vexu@users.noreply.github.com> Date: Tue, 26 Nov 2019 21:36:57 +0200 Subject: [PATCH] add workaround for #3190 --- src-self-hosted/link.zig | 4 +++- src-self-hosted/type.zig | 4 +++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src-self-hosted/link.zig b/src-self-hosted/link.zig index 54835f9a0..67490b4e1 100644 --- a/src-self-hosted/link.zig +++ b/src-self-hosted/link.zig @@ -58,7 +58,8 @@ pub fn link(comp: *Compilation) !void { try ctx.args.append("lld"); if (comp.haveLibC()) { - ctx.libc = ctx.comp.override_libc orelse blk: { + // TODO https://github.com/ziglang/zig/issues/3190 + var libc = ctx.comp.override_libc orelse blk: { switch (comp.target) { Target.Native => { break :blk comp.zig_compiler.getNativeLibC() catch return error.LibCRequiredButNotProvidedOrFound; @@ -66,6 +67,7 @@ pub fn link(comp: *Compilation) !void { else => return error.LibCRequiredButNotProvidedOrFound, } }; + ctx.libc = libc; } try constructLinkerArgs(&ctx); diff --git a/src-self-hosted/type.zig b/src-self-hosted/type.zig index 2fce36aec..8b068150b 100644 --- a/src-self-hosted/type.zig +++ b/src-self-hosted/type.zig @@ -726,8 +726,10 @@ pub const Type = struct { switch (key.alignment) { .Abi => {}, .Override => |alignment| { + // TODO https://github.com/ziglang/zig/issues/3190 + var align_spill = alignment; const abi_align = try key.child_type.getAbiAlignment(comp); - if (abi_align == alignment) { + if (abi_align == align_spill) { normal_key.alignment = .Abi; } },