How to switch off LLVM's integrated assembler?

强颜欢笑 提交于 2019-11-26 21:31:15

问题


I have a project involving hand-written assembly—AT&T syntax, works fine with GCC, but not done by me plus I know very little about assembly—which exhibits a weird problem when trying to build it with Clang.

LLVM documentation mentions that "most X86 targets" use LLVM's integrated assembler as opposed to the system assembler; as a possible workaround I would like to explicitly use the latter. I (well, Google) haven't been successful in finding information on how to do this.

Question: Is there a way to ask or rather force Clang / LLVM to use the system assembler instead of the integrated one?

(I know I could always go and Read The Source™, but I want to know whether there's a documented approach.)


回答1:


Turns out I completely missed this in the man page:

-integrated-as -no-integrated-as

Used to enable and disable, respectively, the use of the integrated assembler. Whether the integrated assembler is on by default is target dependent.

To disable it at compiler invocation:

clang -no-integrated-as -c foo.c

Or:

export CC="clang -no-integrated-as"
make


来源:https://stackoverflow.com/questions/11118887/how-to-switch-off-llvms-integrated-assembler

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!