0

As mentioned in this link http://www.delorie.com/djgpp/v2faq/faq8_20.html

How can I create a file where I can see the C code and its assembly translation together?

Res: If you want to see the C code together with the assembly it was converted to, use a command line like this:

    gcc -c -g -Wa,-a,-ad [other GCC options] foo.c > foo.lst

I tried to make the same thing in the Mac OSX Yosemite terminal and received the following errors:

    $ gcc -Wa,-a,-ad main.c > main.lst

    clang: error: unsupported argument '-a' to option 'Wa,'  
    clang: error: unsupported argument '-ad' to option 'Wa,'

So, I'm looking for a way to generate a file with the assembly +source approach in the clang compiler, if there's one.
Thanks in advance.

Community
  • 1
  • 1
Mike
  • 331
  • 4
  • 13
  • Your `gcc ` is just a link to clang. Maybe you want to install GCC (from Homebrew or MacPorts)? – usr1234567 Mar 24 '15 at 10:00
  • For solve the problem I made that, but I still want to know the clang compiler approach, specially for the general case with C++ and Objective C source files – Mike Mar 24 '15 at 10:04
  • possible duplicate of [clang interleaved source and assembly](http://stackoverflow.com/questions/24603910/clang-interleaved-source-and-assembly) – Mike Kinghan Mar 25 '15 at 15:41

0 Answers0