Repository navigation
[build] Update to GCC15 - #1342
Merged
Merged
Conversation
Member
|
I've fixed the linker error due to duplicate symbols. That was all that was needed to compile my STM32 modm code at work with gcc 15.3. This CI image has gcc 15.2 which crashes trying to build CMSIS-DSP for Cortex-M: Once we update to 15.3 the issue will go away. |
Member
|
Having to update libstdc++ for avr on every gcc release seems a bit unsustainable. A lot of internals change every time. It seems the best way forward would be to somehow build avr-gcc with libstdc++ and require that toolchain. It looks like some people have managed. |
salkinium
force-pushed
the
feat/gcc15
branch
from
September 28, 2026 12:11
faeef18 to
2b71295
Compare
This was referenced Sep 28, 2026
salkinium
force-pushed
the
feat/gcc15
branch
4 times, most recently
from
September 28, 2026 17:23
0bf353a to
274a244
Compare
salkinium
marked this pull request as ready for review
September 28, 2026 18:03
salkinium
force-pushed
the
feat/gcc15
branch
6 times, most recently
from
September 29, 2026 19:24
13e4ec0 to
323d11c
Compare
The 2026-09-28 Docker images ship avr-gcc 15.3 and Arm GCC 15.3. Windows downloads Arm GCC 15.3 from the modm-io/avr-gcc release, since the runners are sometimes blocked by the Arm servers, and avr-gcc 15.2 from Zak Kemble. macOS installs the GCC 15 formulas from Homebrew, which the hosted Makefile also uses now.
The delay functions use ceil() and fabs(), which was previously only transitively included via the old avr-libstdcpp headers.
avr-libstdcpp now provides header sets for avr-gcc 8 to 15, generated from the libstdc++ sources of the GCC releases and configured for avr-libc. modm only uses the set for avr-gcc 14 and 15 and provides its own runtime, so only its headers and library sources are copied. The throw helpers for bad_optional_access, bad_variant_access and bad_any_cast are defined inline in their headers, so they must not be defined anymore. Add the missing helpers for out_of_range_fmt and bad_array_new_length. Fail early with older avr-gcc versions.
Extensionless headers such as modm/ext/gcc/atomic are listed in the dependency files. Since they keep their old mtime when copied, GNU make applies its built-in `%: %.cpp` rule on incremental builds and tries to compile modm/ext/gcc/atomic.cpp into the header path.
The SAB_ACTION() initializer uses a reinterpret_cast of a member function pointer, which is not a constant expression, so the documented FLASH_STORAGE action list fails to compile on AVR. The unittest worked around this by keeping the list in RAM while still reading it through modm::accessor::asFlash(), which reads from program memory on AVR and never matched any command. The slave now takes a plain const Action pointer instead.
int_fast16_t is 16-bit on AVR and overflowed when running more than 32767 tests, printing "Passed -30600 tests".
AVR cannot detect whether it runs inside an interrupt, so a contended static initialization guard always asserts instead of yielding.
The combined C image did not run on hardware. The processing tests alone already use over 80% of the 8kB RAM for fiber stacks, so they now run separately in D.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
GCC15 was released a while ago, let's see what breaks. Depends on modm-ext/docker-modm-build#34 and modm-io/avr-libstdcpp#44.
The old avr-libstdcpp was a hand-patched GCC10 port, which avr-gcc 15 refuses to compile (
-Wtemplate-bodyerrors instl_iterator.h). It is now generated from the actual libstdc++ sources, configured for avr-libc. modm only uses the header set for avr-gcc 14 and 15 and keeps its own runtime, so this is mostly a submodule update.<math.h>in the AVR delay, it's not included transitively anymoreFLASH_STORAGEone never compiled and the test read RAM as flashmega-2560-pro_Cinto C and D, the combined image ran out of RAM for fiber stacksosx-cross/homebrew-arm doesn't have v15 yet, lol!fixed, need to upgrade the macos CISomething is wrong withfixedmodm::platform::detail::AdcChannel<modm::platform::detail::DataC4, (modm::platform::Peripheral)1>on Cortex-MWe now have the entire C++ library up to C++26 on AVR, including the date stuff. Anything that needs the compiled libstdc++ (iostreams, locales,
<format>) still won't link, obviously.Flash and RAM of all AVR examples, both compiled with avr-gcc 14, since develop doesn't compile with 15 at all:
arduino_uno/basic/blinkavr/display/dogm128/textavr/display/dogm128/benchmarkavr/timerThe savings are mostly from
<chrono>not pulling in a 64-bit multiplication formodm::delay()anymore. The +10 bytes arestd::fillinMonochromeGraphicDisplay::clear()generating a slightly different loop, meh.The avr-libstdcpp work was done with the help of Opus 5.5, but thoroughly reviewed and tested by me.