[cfe-dev] clang as an x64 assembler

Mike Benfield via cfe-dev cfe-dev at lists.llvm.org
Mon Jun 12 14:24:08 PDT 2017


I'm interested in using clang as an x64 assembler, partly because it
together with lldb seems to be the only way to debug assembly on a Mac. I
wondered if someone could answer a few questions.

I can't find any documentation about clang and assembly. Through
experimentation, I have discovered that this works:

$ clang -g -c -x assembler hello.s
$ clang hello.o -o hello
$ ./hello
Hello, world!

Are these commands (and other relevant command line options) documented
somewhere? Is the supported assembly syntax documented somewhere (it seems
to support GAS syntax; is it reasonable to use the GAS manual as a
reference?)?

Is this recommended? That is, is the integrated assembler intended to be
used to write assembly code for a production system in this way, and is it
reasonable to rely on it continuing to work in the future?

Thanks.

Mike
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20170612/1da3c83b/attachment.html>


More information about the cfe-dev mailing list