Skip to content

Commit

Permalink
add workaround for ziglang#3190
Browse files Browse the repository at this point in the history
  • Loading branch information
Vexu committed Nov 26, 2019
1 parent 1280344 commit b44baae
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
4 changes: 3 additions & 1 deletion src-self-hosted/link.zig
Original file line number Diff line number Diff line change
Expand Up @@ -58,14 +58,16 @@ 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;
},
else => return error.LibCRequiredButNotProvidedOrFound,
}
};
ctx.libc = libc;
}

try constructLinkerArgs(&ctx);
Expand Down
6 changes: 5 additions & 1 deletion src-self-hosted/type.zig
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
},
Expand Down Expand Up @@ -764,6 +766,8 @@ pub const Type = struct {
.Volatile => "volatile ",
.Non => "",
};
// var align_3 = self.key.alignment;
// const name = switch (align_3) {
const name = switch (self.key.alignment) {
.Abi => try std.fmt.allocPrint(
comp.gpa(),
Expand Down

0 comments on commit b44baae

Please sign in to comment.