Re: [arm-gnu] Detecting M-profile target from C-preprocessor?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [arm-gnu] Detecting M-profile target from C-preprocessor?



On Wed, Mar 10, 2010 at 04:00:18PM +0100, Christophe LYON wrote:
> Hello,
> 
> I'd like to have some assembly source file pre-processed by cpp, and
> this asm code needs to be different for M-profile targets.
> 
> Is there any #define to help this?
> 
> __thumb__ and __thumb__2 are defined when -mthumb is used, but even
> when defined non-M-profile targets support ARM code, so an asm file
> can emit ARM code even when __thumb__ or __thumb2__ are defined.

You're looking for __ARM_ARCH_7M__.  There's also __ARM_ARCH_6M__, and
in the latest GCC __ARM_ARCH_7EM__.  There's no single #define.

-- 
Daniel Jacobowitz
CodeSourcery