Open trab0cch3tt0 opened 3 months ago
here more
/backup/projects/vnostd$ v -freestanding -o hello main.v -cg
/usr/lib/vlang/vlib/dlmalloc/dlmalloc.v:463:68: notice: ambiguous expression. use `()` to ensure correct order of operations
461 | } else {
462 | k := sizeof(usize) * 8 - 1 - usize_leading_zeros(x)
463 | return u32((k << 1) + (size >> (k + dlmalloc.tree_bin_shift - 1) & 1))
| ^
464 | }
465 | }
/tmp/v_1000/hello.01J3P8CF66CKRREXQZ3KQC5P5G.tmp.c:7399: warning: pointer/integer mismatch in comparison
/tmp/v_1000/hello.01J3P8CF66CKRREXQZ3KQC5P5G.tmp.c:14741: error: asm constraint 7 ('r') could not be satisfied
this seems like the output at which error
VV_LOCAL_SYMBOL u64 sys_call6(u64 scn, u64 arg1, u64 arg2, u64 arg3, u64 arg4, i64 arg5, u64 arg6) {
u64 res = ((u64)(0U));
__asm__ (
"mov %[arg4], %%r10;"
"mov %[arg5], %%r8;"
"mov %[arg6], %%r9;"
"syscall ;"
: [res] "=a" (res)
: [scn] "a" (scn),
[arg1] "D" (arg1),
[arg2] "S" (arg2),
[arg3] "d" (arg3),
[arg4] "r" (arg4),
[arg5] "r" (arg5),
[arg6] "r" (arg6)
: "r10",
"r8",
"r9"
);
return res;
}```
Error message related to asm inline are C compiler related. Try -cc gcc
to use GCC whichs has better support for such.
V doctor:
What did you do?
v -g -o vdbg cmd/v && vdbg main.v
What did you expect to see?
like some crazy 300b binary wuith no errors simple
What did you see instead?