diff options
| author | Jacob Young <jacobly0@users.noreply.github.com> | 2022-10-23 13:21:39 -0400 |
|---|---|---|
| committer | Jacob Young <jacobly0@users.noreply.github.com> | 2022-10-25 05:11:29 -0400 |
| commit | 15df64ade8e460141d6485340ca0f88d21f03c47 (patch) | |
| tree | 1ad5584aa242f04c28a118d656cec0888da22132 /lib/std/os/linux/x86_64.zig | |
| parent | 1bab8548688ec13d29abbf3820bb2f9723e09c66 (diff) | |
| download | zig-15df64ade8e460141d6485340ca0f88d21f03c47.tar.gz zig-15df64ade8e460141d6485340ca0f88d21f03c47.zip | |
std: add cbe hacks to more targets
These are needed because clang doesn't support anything in naked
functions, not even assembly register inputs.
Diffstat (limited to 'lib/std/os/linux/x86_64.zig')
| -rw-r--r-- | lib/std/os/linux/x86_64.zig | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/lib/std/os/linux/x86_64.zig b/lib/std/os/linux/x86_64.zig index 7f320c010a..90aae99082 100644 --- a/lib/std/os/linux/x86_64.zig +++ b/lib/std/os/linux/x86_64.zig @@ -109,11 +109,14 @@ pub const restore = restore_rt; pub fn restore_rt() callconv(.Naked) void { switch (@import("builtin").zig_backend) { - .stage2_c => return asm volatile (std.fmt.comptimePrint( - \\ movl ${d}, %%eax - \\ syscall - \\ retq - , .{@enumToInt(SYS.rt_sigreturn)}) ::: "rcx", "r11", "memory"), + .stage2_c => return asm volatile ( + \\ movl %[number], %%eax + \\ syscall + \\ retq + : + : [number] "i" (@enumToInt(SYS.rt_sigreturn)), + : "rcx", "r11", "memory" + ), else => return asm volatile ("syscall" : : [number] "{rax}" (@enumToInt(SYS.rt_sigreturn)), |
