我需要使用 TCC 编译器来链接 GCC 生成的目标文件。但是MinGW中的GCC以COFF格式输出目标文件,而TCC只支持ELF格式。如何让 GCC 生成 ELF 目标文件?
$ cat test.c
int main(void)
{
return 0;
}
$ gcc -c test.c
$ file test.o
test.o: MS Windows COFF Intel 80386 object file
$ tcc -c test.c
$ file test.o
test.o: ELF 32-bit LSB relocatable, Intel 80386, version 1 (SYSV), not stripped