[cmake-developers] ARMCC toolchain support

Brad King brad.king at kitware.com
Wed Oct 28 11:20:22 EDT 2015


On 10/28/2015 05:56 AM, Andersson, Joakim wrote:
> So that means that ARM actually has at least 3 different compilers,

Thank you for the explanation.

> and my patches only cover ARM Compiler 5 (armcc). This is the only
> compiler I have access to and a license for and the only one that
> is used in my projects.

Okay.  We don't need to implement support for any other compiler now,
but I'd like to choose the compiler ids now in case they need to be
distinct.

> So in my opinion we either use a single compiler ID for all of the
> ARM-provided toolchains (something like ARMCT) or we use different
> compiler IDs per toolchain (ARMC5, ARMC6 and ARMGCC).

Each compiler id corresponds to a particular stream of versions of
that compiler along with expectation that particular flags exist.
Given the compiler id one should know what CMAKE_C_COMPILER_VERSION
components mean.  This is why `Clang` and `AppleClang` are different
ids: their version numbers differ.

Currently you're detecting the compiler with:

   /* __ARMCC_VERSION = PVVbbbb */
 # define @PREFIX at COMPILER_VERSION_MAJOR @MACRO_DEC@(__ARMCC_VERSION/1000000)
 # define @PREFIX at COMPILER_VERSION_MINOR @MACRO_DEC@(__ARMCC_VERSION/10000 % 100)
 # define @PREFIX at COMPILER_VERSION_PATCH @MACRO_DEC@(__ARMCC_VERSION     % 10000)")

Do all the compilers define that?  Are they different?  Is there
another preprocessor definition that distinguishes them?  Do they
also define __GNUC__ and/or __clang__?

> It's likely that the ARM GCC toolchain doesn't actually require a
> new ID and may work directly with the current CMake support.

Yes, it is probably fine to identify it as "GNU".  Does it define
the __ARMCC_VERSION macro?

Thanks,
-Brad



More information about the cmake-developers mailing list