tinycc-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Tinycc-devel] Error compiling musl (_Complex not supported): Waitin


From: Yao Zi
Subject: Re: [Tinycc-devel] Error compiling musl (_Complex not supported): Waiting for a release
Date: Mon, 25 Nov 2024 04:56:26 +0000

On Sun, Nov 24, 2024 at 05:51:59PM -0300, Brian Mayer wrote:
> Hello again.
> 
> > Very long ago I did similar tries. As a workaround, I rewrote the
> > syscall wrapper in musl[1].
> >
> > For the reason, I think there's something wrong in x86-64 asm constraint
> > computation, since r10 is always in a register. satisfying the
> > constraint.
> >
> > Cheers,
> > Yao Zi
> Thanks for the help, but It didn't work, I got the same error message.
> But I wasn't able to apply your change in exactly the same way,
> because I didn't find the file src/internal/x86_64/syscall.S, so I

Just create one ;)

> changed the file arch/x86_64/syscall_arch.h to add your assembly. So
> the function becomes:
> 
> static __inline long __syscall6(long n, long a1, long a2, long a3,
> long a4, long a5, long a6)
> {
>         unsigned long ret;
>         __asm__ __volatile__ (
>                 "movq %%rdi, %%rax\n"
>                 "movq %%rsi, %%rdi\n"
>                 "movq %%rdx, %%rsi\n"
>                 "movq %%rcx, %%rdx\n"
>                 "movq %%r8, %%r10\n"
>                 "movq %%r9, %%r8\n"
>                 "movq 8(%%rsp), %%r9\n"
>                 "syscall\n"
>                 : "=a"(ret)
>                 : "r"(n), "r"(a1), "r"(a2),
>                   "r"(a3), "r"(a4), "r"(a5), "r"(a6)
>                 : "rcx", "r11", "memory"                  // clobbers: rcx, 
> r11
>         );                   // <- line 69
>         return ret;
> }
> 
> I got the same error but now in line 69. Is this function correct?

I think there's something wrong with the register allocator and using
inline assembly hits the bug again and doesn't help. That's why I added
a seperate x86_64/syscall.S to work around it.

Cheers,
Yao Zi



reply via email to

[Prev in Thread] Current Thread [Next in Thread]