Look at cxx0x support matrix. ARM Linux supports most features in a standard way. It is possible that a particular machine may not support a feature. Ie, the gcc version, linux version and glibc version and CPU type could all come into play.
Test the define __VERSION__
to see if the compiler can support it. Very, very old Linux versions may have no way to support this with some CPU types; ARMv5 and older. Newer ARM CPUs have some bus locking instructions and can support this with out any or little OS support.
echo | g++ -dM -E - | grep -i atomic
Should give a list of defines. If you compile with -march=armv7
, you will have the most luck. However, with more recent Linux versions (and compiler/glibc targeting this version), even the -march=armv5
will work on non-SMP systems. I don't think an ARMv5 SMP system can exist.
As you can see there are many working parts and it is possible that some features may only be known to work at run time. It is probably impossible to provide a list; you need a gcc version with at least the support matrix for it to be possible that the feature works.
For example, with the same compiler but only -march=armv4
versus -march=armv6
,
armv4
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 1
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 1
#define __GCC_ATOMIC_LONG_LOCK_FREE 1
#define __GCC_ATOMIC_POINTER_LOCK_FREE 1
#define __GCC_ATOMIC_INT_LOCK_FREE 1
armv6
#define __GCC_ATOMIC_CHAR32_T_LOCK_FREE 2
#define __GCC_ATOMIC_POINTER_LOCK_FREE 2
#define __GCC_ATOMIC_INT_LOCK_FREE 2
#define __GCC_ATOMIC_WCHAR_T_LOCK_FREE 2
#define __GCC_ATOMIC_LONG_LOCK_FREE 2
Most modern smart phones with have armv7 or better.
-std=c++11
flag since it was released before the C++11 standard was published, but-std=c++0x
was supported. However you might find that GCC 4.6 doesn't fit your requirements. Your best bet would be to determine the minimal GCC version you need (with respect to the features you use) and enforce it in yourconfigure.ac
script. Note however that only GCC 4.8 has full C++11 core language support, but it doesn't even have full library support yet. – syam