On Mon, Oct 07, 2024 at 05:44:47PM -0300, Brian Mayer wrote:
> The program being compiled:
> 
> # cat main.c
> #include <stdio.h>
> 
> void main(void) {
>         printf("hello from lin0\n");
> }
> 
> I'm using musl-1.2.5 compiled on Arch Linux with GCC on x86_64 with
> static libs disabled.

Could you send the output of

        readelf --program-headers ./main

where main is TinyCC generated, segfaulting executable?

And could you try linking your program with musl statically? Maybe
something like

        tcc main.c -o main -static

Recent TinyCC may generate ELF binaries with a zero-lengthed LOAD
segment, which musl's dynamic linker doesn't handle correctly. I thought
it's a musl problem and a patch has been sent to musl upstream[1].

Cheers,
Yao Zi

[1]: https://www.openwall.com/lists/musl/2024/09/15/1

_______________________________________________
Tinycc-devel mailing list
Tinycc-devel@nongnu.org
https://lists.nongnu.org/mailman/listinfo/tinycc-devel

Reply via email to