I am writing an portable application which uses C++11
features like std::atomic
, std::threads
, etc. How do I verify that my ARM GCC cross compiler toolchain supports the C++11
standard?
I tried using arm-none-linux-gnueabi-g++ -v
and arm-none-linux-gnueabi-g++ --version
but it returned error when using -std=c++11
EDIT # arm-linux-gnueabi-g++ -std=c++11 dum.cpp
cc1plus: error: unrecognized command line option '-std=c++11'
Target: arm-linux-gnueabi
gcc version 4.6.2
What Is Arm Linux Gnueabi? cross-toolchain package for Linux’s architecture, is known as gcc-arm-linux-gnueabi.The toolchain implies EABI generated by gcc’s options -mfloat-abi = soft and -mfloat-abi = soft.For the context of the armhf architecture, there is gcc-arm-linux-gnueabihf, a toolchain for cross-platform programming.
cross-toolchain package for Linux’s architecture, is known as gcc-arm-linux-gnueabi.The toolchain implies EABI generated by gcc’s options -mfloat-abi = soft and -mfloat-abi = soft.For the context of the armhf architecture, there is gcc-arm-linux-gnueabihf, a toolchain for cross-platform programming. What Is Arm Linux Gnueabi?
Can Gcc Compile For Arm? A cross compiler is all you need.Your x86 machine produces machine code through an automatic cross compiler built to run when cross compile.Using the GNU arms embedded toolchain is a good choice for embedded Linux distribution. Can Gcc Cross-Compile?
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.
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
,
#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
#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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With