[cmake-developers] ARMCC toolchain support

Brad King brad.king at kitware.com
Thu Oct 29 10:13:33 EDT 2015


On 10/29/2015 05:28 AM, Andersson, Joakim wrote:
> comes from what I can read in its documentation.

Thanks.  For reference, here are links to each that I found:

> armcc defines:
> * __ARMCC_VERSION (version)
> * __CC_ARM (1)
> * __GNUC__ (version) (only if --gnu is passed as a commad line option)

v4: http://infocenter.arm.com/help/topic/com.arm.doc.dui0491c/BABJFEFG.html
v5: http://infocenter.arm.com/help/topic/com.arm.doc.dui0472l/chr1359125007083.html

> armclang defines:
> * __ARMCC_VERSION (version)
> * __ARMCOMPILER_VERSION (version)
> * __GNUC__ (version)
> * Note that it does *not* define __clang__

v6: http://infocenter.arm.com/help/topic/com.arm.doc.dui0774c/chr1383660321827.html
__ARMCOMPILER_VERSION is a synonym for __ARMCC_VERSION.

The format of the version macros is documented as:

v4: PVVbbbb (decimal P=major, VV=minor, bbbb=build)
v5: PVVbbbb (decimal P=major, VV=minor, bbbb=build)
v6: nnnbbbb (decimal nnn=version, bbbb=build)
    6000654 = version 6.0 build 0654

The format for v6 looks plausibly the same as v4 and v5 but it is not clear.

According to their legacy RealView tools docs the format used to be different:

v3:  PVtbbb (decimal P=major, V=minor, t=patch, bbb=build)
     300503 = version 3.0.0 build 503
v4:  PVbbbb (decimal P=major, V=minor, bbbb=build)

Therefore if the value is not at least 1000000 then we must assume the
old format.  Please update your version extraction macros accordingly.

The corresponding command line option docs are:

 v4: http://infocenter.arm.com/help/topic/com.arm.doc.dui0491c/Cihbejbb.html
 v5: http://infocenter.arm.com/help/topic/com.arm.doc.dui0472l/chr1359124898004.html
 v6: http://infocenter.arm.com/help/topic/com.arm.doc.dui0774c/chr1383574213854.html

In v4 and v5 they refer to the compiler as `armcc` and in v6 they
refer to it as `armclang` and have a link to upstream LLVM/Clang.
It looks like they simply decided to change the underlying compiler.
Therefore I think we could use just `ARMCC` for both and make any
needed adaptations based on the version number.

> arm-linux-gnueabihf-gcc defines:
> * __GNUC__ (version)

That does look like plain GNU then.

> So if we're interested in giving support only to armcc, then we could
> use _CC_ARM to find out whether we are actually invoking it, and then
> after __ARMCC_VERSION to find out the actual compiler version.

Based on the above I think just using __ARMCC_VERSION is sufficient.
Please check the range to decide how to extract the version components.
We could also consider just not identifying it for < 1000000 and leave
support for legacy versions up to future development by anyone else
interested in them.

Thanks,
-Brad



More information about the cmake-developers mailing list