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 file foo.c as input and generates a binary object file foo.o.
It can also take assembly files as input:
tcc -c asm.S preprocesses and assembles the assembly source in the existing asm.S file and generates an object file asm.o.
tcc -c asm.s is similar, but it doesn't preprocess the input file before assembling it.
The man page says:
TCC options are a very much like gcc options. The main difference is
that TCC can also execute directly the resulting program and give it
runtime arguments.
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:
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.
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.)