mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 13:54:21 +00:00
Riscv32e align stack to 4 bytes (#20673)
This commit is contained in:
parent
397be0c9cc
commit
01dc0d5a72
2 changed files with 4 additions and 2 deletions
|
|
@ -1967,7 +1967,6 @@ pub fn stackAlignment(target: Target) u16 {
|
||||||
.bpfel,
|
.bpfel,
|
||||||
.mips64,
|
.mips64,
|
||||||
.mips64el,
|
.mips64el,
|
||||||
.riscv32,
|
|
||||||
.riscv64,
|
.riscv64,
|
||||||
.sparc64,
|
.sparc64,
|
||||||
.x86_64,
|
.x86_64,
|
||||||
|
|
@ -1976,6 +1975,8 @@ pub fn stackAlignment(target: Target) u16 {
|
||||||
.wasm64,
|
.wasm64,
|
||||||
.loongarch64,
|
.loongarch64,
|
||||||
=> 16,
|
=> 16,
|
||||||
|
.riscv32,
|
||||||
|
=> if (Target.riscv.featureSetHas(target.cpu.features, .e)) 4 else 16,
|
||||||
.powerpc64,
|
.powerpc64,
|
||||||
.powerpc64le,
|
.powerpc64le,
|
||||||
=> switch (target.os.tag) {
|
=> switch (target.os.tag) {
|
||||||
|
|
|
||||||
|
|
@ -542,7 +542,8 @@ const DataLayoutBuilder = struct {
|
||||||
try self.typeAlignment(.float, 64, 64, 64, true, writer);
|
try self.typeAlignment(.float, 64, 64, 64, true, writer);
|
||||||
}
|
}
|
||||||
if (stack_abi != ptr_bit_width or self.target.cpu.arch == .msp430 or
|
if (stack_abi != ptr_bit_width or self.target.cpu.arch == .msp430 or
|
||||||
self.target.os.tag == .uefi or self.target.os.tag == .windows)
|
self.target.os.tag == .uefi or self.target.os.tag == .windows or
|
||||||
|
self.target.cpu.arch == .riscv32)
|
||||||
try writer.print("-S{d}", .{stack_abi});
|
try writer.print("-S{d}", .{stack_abi});
|
||||||
switch (self.target.cpu.arch) {
|
switch (self.target.cpu.arch) {
|
||||||
.hexagon, .ve => {
|
.hexagon, .ve => {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue