如何生成汇编code。与英特尔的语法铛? [英] How to generate assembly code with clang in Intel syntax?

查看:120
本文介绍了如何生成汇编code。与英特尔的语法铛?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

作为<一个href=\"http://stackoverflow.com/questions/199966/how-do-you-use-gcc-to-generate-assembly-$c$c-in-intel-syntax\">this问题显示,与G ++,我能做的 G ++ -S -masm =英特尔TEST.CPP
此外,随着铿锵,我能做的铛++ -S TEST.CPP ,但 -masm =英特尔不支持铛(预警参数编译期间未使用:-masm =英特尔)。我如何铿锵得到Intel语法?

As this question shows, with g++, I can do g++ -S -masm=intel test.cpp. Also, with clang, I can do clang++ -S test.cpp, but -masm=intel is not supported by clang (warning argument unused during compilation: -masm=intel). How do I get intel syntax with clang?

推荐答案

这应该得到铛发出组装code。与英特尔的语法:

This should get clang to emit assembly code with Intel syntax:

clang++ -S -mllvm --x86-asm-syntax=intel test.cpp

您可以使用 -mllvm&LT;&ARG GT; 来从铿锵的命令行选项LLVM传递。可悲的是这个选项似乎并没有做到有据可查,因此,我只找到它通过LLVM的邮件列表进行浏览。

You can use -mllvm <arg> to pass in llvm options from the clang command line. Sadly this option doesn't appear to be well documented, and thus I only found it by browsing through the llvm mailing lists.

由于低于注意到@thakis 的,这里不再需要,因为它锵(3.5+)的新版本现在支持 -masm =英特尔语法。

As noted below by @thakis, this is no longer needed in newer versions of Clang (3.5+) as it now support the -masm=intel syntax.

这篇关于如何生成汇编code。与英特尔的语法铛?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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