Skip to content

Commit f889f8c

Browse files
committed
builtin: guard linux_bare amd64 syscalls with $if amd64
The amd64 Linux syscall layer in linux_bare was gated on `$if !i386`, which the C backend emits as `#if !defined(__V_i386)` -- true for arm/arm64/riscv/etc. Those targets then tried to compile `asm amd64 { syscall ... }`, failing with "impossible constraint in 'asm'" when cross-compiling -freestanding output (e.g. for bare-metal Cortex-M with arm-none-eabi-gcc). Gate it on `$if amd64` instead: the block uses the amd64 syscall ABI and the `syscall` instruction, i386 has its own linux_syscalls.i386.v, and this matches how arch-specific asm is guarded elsewhere in vlib. amd64 output is unchanged.
1 parent cc39afe commit f889f8c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

vlib/builtin/linux_bare/linux_syscalls.v

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -223,7 +223,7 @@ enum WiSiCode {
223223
cld_continued = 6 // stopped child has continued
224224
}
225225

226-
$if !i386 {
226+
$if amd64 {
227227
fn split_int_errno(rc_in u64) (i64, Errno) {
228228
rc := i64(rc_in)
229229
if rc < 0 {

0 commit comments

Comments
 (0)