mirror of
https://github.com/ziglang/zig.git
synced 2024-11-26 23:22:44 +00:00
parent
39f1d96a2f
commit
d7daf7c203
@ -240,6 +240,14 @@ fn _start() callconv(.Naked) noreturn {
|
||||
: [tos] "={rax}" (-> *std.os.plan9.Tos),
|
||||
);
|
||||
}
|
||||
switch (native_arch) {
|
||||
// https://github.com/ziglang/zig/issues/16799
|
||||
.riscv64 => @export(argc_argv_ptr, .{
|
||||
.name = "__zig_argc_argv_ptr",
|
||||
.visibility = .hidden,
|
||||
}),
|
||||
else => {},
|
||||
}
|
||||
asm volatile (switch (native_arch) {
|
||||
.x86_64 =>
|
||||
\\ xorl %%ebp, %%ebp
|
||||
@ -270,7 +278,8 @@ fn _start() callconv(.Naked) noreturn {
|
||||
.riscv64 =>
|
||||
\\ li s0, 0
|
||||
\\ li ra, 0
|
||||
\\ sd sp, %[argc_argv_ptr]
|
||||
\\ lui a0, %hi(__zig_argc_argv_ptr)
|
||||
\\ sd sp, %lo(__zig_argc_argv_ptr)(a0)
|
||||
\\ andi sp, sp, -16
|
||||
\\ tail %[posixCallMainAndExit]@plt
|
||||
,
|
||||
|
Loading…
Reference in New Issue
Block a user