[cfe-dev] Unable to conditionally compile ARM assember

Stuart Carnie stuart.carnie at gmail.com
Sun Nov 20 12:13:21 PST 2011


I found that Xcode 4.2 does pass .s through the preprocessor, so #ifdef
__arm__ works just fine too.

*Stuart Carnie, CTO*
*manomio <http://manomio.com/> | in retro we trust!*


On Sat, Nov 19, 2011 at 9:51 PM, Joerg Sonnenberger <joerg at britannica.bec.de
> wrote:

> 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
> _______________________________________________
> cfe-dev mailing list
> cfe-dev at cs.uiuc.edu
> http://lists.cs.uiuc.edu/mailman/listinfo/cfe-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20111120/cb738749/attachment.html>


More information about the cfe-dev mailing list