I am trying to use the latest gcc_arm_none_eabi package in order to gain access to c++20 features for a project I’m developing on the Teensy4.1. I am specifying the updated package via the platform_packages flag in my platformio.ini file, which looks like this:
This is a special lib compiled by Teensy devs and is located in their toolchain. I’m not sure that you can use another toolchain. You can try to pick that library and put it to your project and later link with build_flags = -L /path/to/arm_cortexM7lfsp_math/dir.
Unfortunately I think I will have to leave this for the moment as I haven’t had any luck and need get back to ‘real’ work However I will leave what I worked out so far here in the hope that it will help someone else in the future:
arm_cortexM7lfsp_math is a library made by ARM with pre-built binaries provided as part of CMSIS (Cortex Microcontroller System Interface Standard).
The to use these files place them in a folder like opt/lib in your project root, then add the following to Platformio.ini to link them:
; build_flags already contains `-larm_cortexM7lfsp_math` so no need to add that again
; we just need to tell the linker there is an additional directory where it can look for the library
build_flags = -Lopt/lib
The version of the compiler can then be overridden like:
Unfortunately this setup then results in a new error:
/Users/aarongough/.platformio/packages/toolchain-gccarmnoneeabi/bin/../lib/gcc/arm-none-eabi/10.3.1/../../../../arm-none-eabi/lib/thumb/v7e-m+dp/hard/libstdc++.a(eh_terminate.o):(.ARM.exidx.text._ZN10__cxxabiv112__unexpectedEPFvvE+0x4): additional relocation overflows omitted from the output
From my initial research it looks like something is doing a JUMP and trying to address a location that’s too far away? Unfortunately I am really NOT an embedded dev, or even a C/C++ dev so this is now at the point where I don’t think I have a hope of fixing it lol… If anyone else has ideas I’ll be happy to try them, if not then hopefully this helps someone in the future to get c++20 working!
There is also GCC 11.x available, maybe you can locally download it + add the package.json from <user>/.platformio/packages/toolchain-gccarmnoneeabi (with adapted version info) and reference it in platform_packages with `file://<path to downloaded GCC).