I have a Colibri T20, yocto, BSP 2.8:
BB_VERSION = "1.36.0"
BUILD_SYS = "x86_64-linux"
NATIVELSBSTRING = "ubuntu-18.04"
TARGET_SYS = "arm-angstrom-linux-gnueabi"
MACHINE = "colibri-t20"
DISTRO = "angstrom"
DISTRO_VERSION = "v2017.12"
TUNE_FEATURES = "arm armv7a vfp thumb callconvention-hard"
TARGET_FPU = "hard"
The BSP comes with gcc 7.3. I have a custom application that need to compile with CXX_FEATURES = -std=c++20, i.e. it must be compiled with gcc 8.x.
Is there a way to tell yocto to use gcc 8.2 ?
Thanks for writing to the Toradex Community!
Usually the Yocto version defines the version of Toolchain and software components. Making changes to any of these is not recommended.
I still have not found a solution for the problem: I need to compile my application (in a separate recipe) with a newer gcc compiler (at least 8.2).
A solution would be Adding a secondary toolchain. But I’m a little confused how to do this.
Maybe someone could point me to en example?
Unfortunately, we currently have no documentation/support for adding a second toolchain.
Also, mixing different toolchains is something hard to accomplish, and probably the OpenEmbedded documentation link that you shared is the way to go.
On the other hand, we can think about some workarounds (and all of them have pitfalls):
What if you try to statically link the dependencies to your application (including libc/libc++ here)? This way your application would be independent of the libs present in the module’s OS. Also, you will need to maintain two different build environments (one using Yocto, for your OS, and the other for your application).
Another way would be to get rid of the C++20 specific features on your application. You could take a look at whichever C++ revision (17, 14, 11, …) is compatible with the toolchain on BSP 2.8.7 and use only its features.
Thanks for the answer.
Get rid of the C++20 specific features isn’t an option. The application is an open-source project and I haven’t control over the C++ features. Statically link may be the easiest way to go.
Hi @ubx !
If the workaround is suitable for your needs, please mark the message as the solution.