[cfe-dev] Compile ARM Assembler with Xcode 4.2 CLang?

Don Quixote de la Mancha quixote at dulcineatech.com
Wed Nov 9 02:21:57 PST 2011


> Somehow I managed to delete CellRun.s.  When I created a new version,
> I get no diagnostics at all.  Suspicious about this, I inserted
> several lines of clearly illegal syntax.  These still did not generate
> any diagnostics.  The build log in the Xcode IDE didn't have any lines
> for CellRun.s, so this time I don't think Xcode is attempting to
> compile it at all.
>
> I think it might work to use a Custom Build Phase but I am unclear as
> to how to do that.

I wasn't getting any diagnostics because I had created an empty Build
Phase script.  I didn't see how to get rid of the script entirely, so
I removed its contents.

I fixed this by opening my project bundle's project.pbxproj file and
removing all the lines that mentioned CellRun.s.  In doing so I came
across an empty build phase script, so I deleted that too.  After
that, Xcode 4.2 attempted but failed to compile my assembly source.

The -x argument on clang's command line tells clang what language to
treat the source file as.  Xcode 3.2.6 correctly uses "clang -x
asm-with-cpp" to assemble the source file after passing it through the
C preprocessor.  Xcode 4.2 tries to compile it as Objective-C by using
"clang -x objective-c".

It looks like I have found a bug in Xcode, but I can't fathom how this
could have slipped by Apple's own iOS developers, as they write more
arm assembly code than any of us do!

I will try creating a minimal test case.  If that still tries to
compile as Objective-C, I will file a bug report.
-- 
Don Quixote de la Mancha
Dulcinea Technologies Corporation
Software of Elegance and Beauty
http://www.dulcineatech.com
quixote at dulcineatech.com




More information about the cfe-dev mailing list