[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: |
Wed, 13 Nov 2024 20:02:15 +0000 |
On Tue, Nov 12, 2024 at 07:08:47PM -0300, Brian Mayer wrote:
> >> After the release, i plan to work on the following C99/C11 items and see,
> >> what is needed to implement them:
> Great to hear that!
>
> Continuing on the subject: after moving away the complex folder the
> compilation went a bit more, until this error appeared:
>
> /home/lord/git/lin0/tools/bin/tcc -std=c99 -nostdinc -ffreestanding
> -fexcess-precision=standard -frounding-math -fno-strict-aliasing
> -Wa,--noexecstack -D_XOPEN_SOURCE=700 -I./arch/x86_64 -I./arch/generic
> -Iobj/src/internal -I./src/include -I./src/internal -Iobj/include
> -I./include -O2 -fno-align-jumps -fno-align-functions
> -fno-align-loops -fno-align-labels -fira-region=one
> -fira-hoist-pressure -freorder-blocks-algorithm=simple
> -fno-prefetch-loop-arrays -fno-tree-ch -pipe -fomit-frame-pointer
> -fno-unwind-tables -fno-asynchronous-unwind-tables -ffunction-sections
> -fdata-sections -Wno-pointer-to-int-cast
> -Werror=implicit-function-declaration -Werror=implicit-int
> -Werror=pointer-sign -Werror=pointer-arith -Werror=int-conversion
> -Werror=incompatible-pointer-types -Werror=discarded-qualifiers
> -Werror=discarded-array-qualifiers -Waddress -Warray-bounds
> -Wchar-subscripts -Wduplicate-decl-specifier -Winit-self -Wreturn-type
> -Wsequence-point -Wstrict-aliasing -Wunused-function -Wunused-label
> -Wunused-variable -fno-stack-protector -fPIC -c -o
> obj/src/env/__init_tls.lo src/env/__init_tls.c
> ./arch/x86_64/syscall_arch.h:60: error: asm constraint 6 ('r') could
> not be satisfied
> make: *** [Makefile:159: obj/src/env/__init_tls.lo] Error 1
>
> The file syscall_arch.h contains:
> [...]
> static __inline long __syscall6(long n, long a1, long a2, long a3,
> long a4, long a5, long a6)
> {
> unsigned long ret;
> register long r10 __asm__("r10") = a4;
> register long r8 __asm__("r8") = a5;
> register long r9 __asm__("r9") = a6;
> __asm__ __volatile__ ("syscall" : "=a"(ret) : "a"(n), "D"(a1),
> "S"(a2),
> /* line 60 here --->>> */
> "d"(a3), "r"(r10), "r"(r8), "r"(r9) : "rcx", "r11", "memory");
> return ret;
> }
>
> Well I don't know how to proceed now, I'm not familiar with the asm
> macro, can I get some help?
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
[1]:
https://github.com/GataOS/musl-tcc/blob/0071b35652703464ecdf8ad31c5ee51f07cddafc/src/internal/x86_64/syscall.S