I am trying to convert my .c
file to a .s
file using TCC, however, I get the error: tcc: cannot specify multiple files with -c
tcc.exe main.c -c main.S
What should I do?
I am trying to convert my .c
file to a .s
file using TCC, however, I get the error: tcc: cannot specify multiple files with -c
tcc.exe main.c -c main.S
What should I do?
Copyright © 2021 Jogjafile Inc.
tcc
, as far as I can tell, does not have an option to generate an assembly listing.tcc -c foo.c
takes the C source filefoo.c
as input and generates a binary object filefoo.o
.It can also take assembly files as input:
tcc -c asm.S
preprocesses and assembles the assembly source in the existingasm.S
file and generates an object fileasm.o
.tcc -c asm.s
is similar, but it doesn't preprocess the input file before assembling it.The man page says:
If tcc had an option to generate an assembly listing, then surely it would use the same option that gcc (and many other Unix-based compilers) use, namely
-S
-- but:You can get an assembly listing of sorts using
objdump
:but as you can see you lose some information that you'd get from a compiler-generated assembly listing. (Playing with
objdump
options might give you more information.)I'm using tcc version 0.9.25 on a Linux x86_64 system.
(remyabel posted a similar but less detailed answer but deleted it, I'm not sure why.)