[cfe-dev] Unable to conditionally compile ARM assember

Joerg Sonnenberger joerg at britannica.bec.de
Sat Nov 19 20:51:42 PST 2011


On Sat, Nov 19, 2011 at 02:14:55PM -0700, Stuart Carnie wrote:
> In gcc, I'd use the following code to conditionally compile a .s file (pure
> assembler) for ARM:
> 
> .set device, 0
> .set device, __arm__
> 
> .if device
> 
>> 
> .endif
> 
> This is failing with clang 3.0 / Xcode 4.2 for simulator builds.  You can
> typically do a clean, build and it works, but second time it fails.
> 
> Is there an alternative I am missing or another way to pass preprocessor
> directives to the assembler?

foo.s is pure assembler and not pre-processed. You want to use foo.S for
that. Alternatively, -x assembler-with-cpp should be usable.

Joerg



More information about the cfe-dev mailing list