Skip to content

[build] Update to GCC15 - #1342

Draft
salkinium wants to merge 2 commits into
modm-io:developfrom
salkinium:feat/gcc15
Draft

[build] Update to GCC15#1342
salkinium wants to merge 2 commits into
modm-io:developfrom
salkinium:feat/gcc15

Conversation

@salkinium

@salkinium salkinium commented Mar 7, 2026

Copy link
Copy Markdown
Member

GCC15 was released a while ago, let's see what breaks. Depends on modm-ext/docker-modm-build#34

  • avrlibstdc++ needs to be upgraded for GCC15. It is missing important pieces anyways (date stuff), so needs to be done anyways. big issue
  • osx-cross/homebrew-arm doesn't have v15 yet, lol! fixed, need to upgrade the macos CI
  • Something is wrong with modm::platform::detail::AdcChannel<modm::platform::detail::DataC4, (modm::platform::Peripheral)1> on Cortex-M fixed

Specialisations of AdcChannel and DacChannel variable templates were
defined in a header with external linkage but weren't inline variables.
This was causing linker errors with gcc 15.
@chris-durand

Copy link
Copy Markdown
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:

scons: building terminated because of errors.during RTL pass: ce1
modm/ext/cmsis/dsp/FastMathFunctions/arm_atan2_q31.c: In function 'arm_atan2_q31':
modm/ext/cmsis/dsp/FastMathFunctions/arm_atan2_q31.c:225:1: internal compiler error: Segmentation fault
  225 | }
      | ^
0x1b8ae85 diagnostic_context::diagnostic_impl(rich_location*, diagnostic_metadata const*, diagnostic_option_id, char const*, __va_list_tag (*) [1], diagnostic_t)
	???:0
0x1b9ae9f internal_error(char const*, ...)
	???:0
0x929c10 copy_to_mode_reg(machine_mode, rtx_def*)
	???:0
0xbd3b86 maybe_legitimize_operands(insn_code, unsigned int, unsigned int, expand_operand*)
	???:0
0xbd0f19 maybe_gen_insn(insn_code, unsigned int, expand_operand*)
	???:0
0xbd3000 emit_conditional_move(rtx_def*, rtx_comparison, rtx_def*, rtx_def*, machine_mode, int)
	???:0
Please submit a full bug report, with preprocessed source (by using -freport-bug).
Please include the complete backtrace with any bug report.
See <https://gcc.gnu.org/bugs/> for instructions.
scons: *** [build/scons-release/modm/ext/cmsis/dsp/FastMathFunctions/arm_atan2_q31.o] Error 1
==========================================================================================

Once we update to 15.3 the issue will go away.

@chris-durand

Copy link
Copy Markdown
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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Development

Successfully merging this pull request may close these issues.

2 participants