Open vladoshub opened 5 months ago
Known issue, the currently used TCC versions only support x86 properly. Support for AMD64 and other architectures is a post-1.0 goal.
Leaving this open to track this issue.
Yes, that's a bug in mescc
. It was actually much worth until recently and mescc couldn't even build tcc-mes but riscv64 bringup seems to have fixed a lot of 32-bit vs 64-bit issues, so now it builds tcc-mes on amd64 but there are still some miscompilation bugs... Probably just one or two bugs left but it's not easy to debug...
It does seem to work marginally better with latest mes/tinycc:
+> tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86_64 -o /usr/lib/mes/crt1.o lib/linux/x86_64-mes-gcc/crt1.c
+> catm /usr/lib/mes/crtn.o
+> catm /usr/lib/mes/crti.o
+> if match amd64 x86
+> tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86_64 -o unified-libc.o unified-libc.c
assert fail: ((ft & 0x000f /* mask for basic type */ ) == 0 /* integer type */ ) || ((ft & 0x000f /* mask for basic type */ ) == 12 /* 64 bit integer */ ) || ((ft & 0x000f /* mask for basic type */ ) == 4 /* pointer */ ) || ((ft & 0x000f /* mask for basic type */ ) == 5 /* enum definition */ ) || ((ft & 0x000f /* mask for basic type */ ) == 6 /* function type */ )
/usr/bin/tcc-mes abnormal termination, signal number = 11
core dumped
Steps for reproduction sudo ./rootfs.py -c -a amd64 --update-checksums Environment ubuntu 20.04 VM Virtual Box
build gets stuck on command: tcc-mes -c -D HAVE_CONFIG_H=1 -I include -I include/linux/x86_64 -o /usr/lib/mes/crt1.o lib/linux/x86_64-mes-gcc/crt1.c
I've been waiting for over 2 hours and nothing happens