Skip to content

Commit

Permalink
llvm: Add some missing fnptr alignment specifications in DataLayoutBu…
Browse files Browse the repository at this point in the history
…ilder.
  • Loading branch information
alexrp committed Oct 20, 2024
1 parent 4334483 commit 6c1e306
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions src/codegen/llvm.zig
Original file line number Diff line number Diff line change
Expand Up @@ -458,10 +458,15 @@ const DataLayoutBuilder = struct {
if (idx != size) try writer.print(":{d}", .{idx});
}
}
if (self.target.cpu.arch.isArmOrThumb()) try writer.writeAll("-Fi8") // for thumb interwork
if (self.target.cpu.arch.isArmOrThumb())
try writer.writeAll("-Fi8") // for thumb interwork
else if (self.target.cpu.arch == .powerpc64 and
self.target.os.tag != .freebsd and self.target.abi != .musl)
self.target.os.tag != .freebsd and
self.target.os.tag != .openbsd and
!self.target.abi.isMusl())
try writer.writeAll("-Fi64")
else if (self.target.cpu.arch.isPowerPC() and self.target.os.tag == .aix)
try writer.writeAll(if (self.target.cpu.arch.isPowerPC64()) "-Fi64" else "-Fi32")
else if (self.target.cpu.arch.isPowerPC())
try writer.writeAll("-Fn32");
if (self.target.cpu.arch != .hexagon) {
Expand Down Expand Up @@ -573,6 +578,8 @@ const DataLayoutBuilder = struct {
self.target.os.tag == .uefi or self.target.os.tag == .windows or
self.target.cpu.arch == .riscv32)
try writer.print("-S{d}", .{stack_abi});
if (self.target.cpu.arch.isAARCH64())
try writer.writeAll("-Fn32");
switch (self.target.cpu.arch) {
.hexagon, .ve => {
try self.typeAlignment(.vector, 32, 128, 128, true, writer);
Expand Down

0 comments on commit 6c1e306

Please sign in to comment.