Liste des Groupes | Revenir à cl c |
David Brown <david.brown@hesbynett.no> writes:On 25/06/2024 22:13, Keith Thompson wrote:>DFS <nospam@dfs.com> writes:>
[...]Can you use tcc to generate assembly from a .c source file?No, tcc has no such option.
>
similar to:
>
$ gcc -S sourcefile.c
I was able to get an assembly listing by running `tcc -c
sourcefile.c`
followed by `objdump -d sourcefile.o`.
<https://godbolt.org> has tcc on its list of C compilers, and it shows
the generated assembly. I don't know how it does this - perhaps using
this same method. If people are interested in looking at the code
generated by tcc (or vast numbers of other compilers, versions and
targets), then godbolt is usually the easiest way to get it.
>
And if anyone wants to know how they get the nice assembly out of the
compilers, the source code for godbolt is also freely available.
https://godbolt.org/z/3b18qno37
>
The assembly listing doesn't look like objdump output, and the output
window on the lower right looks like tcc itself generated
"/app/output.s". A quick look at the source code was unhelpful.
>
I've emailed Matt Goldbolt and asked him about this.
Les messages affichés proviennent d'usenet.