Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check arm-none-linux-gnueabi-g++ support for C++11

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

like image 436
manav m-n Avatar asked Dec 13 '13 19:12

manav m-n


People also ask

What is ARM Linux gnueabi?

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.

What is GCC-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. What Is Arm Linux Gnueabi?

Can GCC compile for arm?

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?

What features does ARM Linux support?

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.


1 Answers

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.

like image 115
artless noise Avatar answered Sep 17 '22 14:09

artless noise