我如何编译使用gcc组装 [英] How can I compile to assembly with gcc

查看:82
本文介绍了我如何编译使用gcc组装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我如何编译,而不是组装用gcc的可执行文件。我知道有一个 -S 标记,但我在哪里使用它在makefile。例如,如果我用标志的 -O3 -o exe_name ,在那里我应该把-S标志?

How do I compile to assembly instead of an executable with gcc. I know there is an -S flag, but where do I use it in the makefile. For example, if I use flags -O3 -o exe_name, where should I put the -S flag?

推荐答案

我建议也在使用 -fverbose-ASM ,因为这样生成的汇编已经产生了一些意见这说明在code。

I suggest also using -fverbose-asm because then the generated assembler has some generated comments which "explains" the code.

和了解什么GCC的优化正在做的甚至可以尝试 -fdump树,所有(但这种产生的文件的数百的! )。

And to understand what the GCC optimizations are doing one could even try -fdump-tree-all (but this produces hundreds of files!).

这篇关于我如何编译使用gcc组装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆