Skip to content

Commit

Permalink
stage2: fix building for 32-bit targets
Browse files Browse the repository at this point in the history
  • Loading branch information
andrewrk committed Sep 9, 2022
1 parent 0ac88fe commit 0d70c04
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
5 changes: 3 additions & 2 deletions lib/std/zig/system/NativeTargetInfo.zig
Original file line number Diff line number Diff line change
Expand Up @@ -485,8 +485,9 @@ fn glibcVerFromSoFile(file: fs.File) !std.builtin.Version {
var buf: [40000]u8 = undefined;
if (buf.len < dynstr.size) return error.InvalidGnuLibCVersion;

const dynstr_bytes = buf[0..dynstr.size];
_ = try preadMin(file, dynstr_bytes, dynstr.offset, dynstr.size);
const dynstr_size = @intCast(usize, dynstr.size);
const dynstr_bytes = buf[0..dynstr_size];
_ = try preadMin(file, dynstr_bytes, dynstr.offset, dynstr_size);
var it = mem.split(u8, dynstr_bytes, &.{0});
var max_ver: std.builtin.Version = .{ .major = 2, .minor = 2, .patch = 5 };
while (it.next()) |s| {
Expand Down
2 changes: 1 addition & 1 deletion src/codegen/llvm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -3870,7 +3870,7 @@ pub const DeclGen = struct {
var b: usize = 0;
for (parent_ty.structFields().values()[0..field_index]) |field| {
if (field.is_comptime or !field.ty.hasRuntimeBitsIgnoreComptime()) continue;
b += field.ty.bitSize(target);
b += @intCast(usize, field.ty.bitSize(target));
}
break :b b;
};
Expand Down

0 comments on commit 0d70c04

Please sign in to comment.