Is there any way to view Xcode's arm64 compiler output in the form of assembly language, either using Xcode, the command-line developer tools that come bundled with Xcode, other developer tools from Apple, or some 3rd party utility?
Asked
Active
Viewed 705 times
1
-
You can use `gcc -S`. – Jester Dec 08 '14 at 18:07
-
clang -arch arm64 -S ... seems to work for plain C files that contain no includes. But how does one get arm64 output for typical Xcode project source files that do contain imports and includes? – hotpaw2 Dec 08 '14 at 18:19
-
Should work just the same, as long as you use the same options as you would to compile them normally. Of course linked libraries won't be dumped (since they are already compiled). If you want that, you can run `objdump -d` on the binaries. – Jester Dec 08 '14 at 18:35
-
So how does one determine what options Xcode normally uses with clang to build arm64 apps? – hotpaw2 Dec 08 '14 at 20:09
-
Don't know (unless you want to set up a wrapper script that logs the command line). Alternatively, you might want to look in Xcode settings if you can supply additional arguments and stick the `-S` (or `-save-temps` if clang supports that) in there. – Jester Dec 08 '14 at 20:15
1 Answers
2
(Since no one else answered, I'll post what I ended up with...)
Using the command-line tools that came with the released (Mac App store) Xcode installation:
clang -arch arm64 -I /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneOS.platform/Developer/SDKs/iPhoneOS.sdk/usr/include -S my_source_file.c
produced an .s file containing arm64 assembly language.

hotpaw2
- 70,107
- 14
- 90
- 153