Skip to content

New project wizard Classic C++ for STM32F0xx and GCC 14 does not compile #651

@jonahgraham

Description

@jonahgraham

Screenshots with steps to reproduce. Tested with (what will be) 2026-03 RC1

  1. Create new C++ project
Image
  1. Create STM32F0xx with defaults
Image
  1. On toolchain page choose xpack version 14.xxxx:
Image
  1. Build project and get this error:
make all 
Building file: ../system/src/newlib/cxx.cpp
Invoking: GNU Arm Cross C++ Compiler
arm-none-eabi-g++ -mcpu=cortex-m0 -mthumb -Og -fmessage-length=0 -fsigned-char -ffunction-sections -fdata-sections -ffreestanding -fno-move-loop-invariants -Wall -Wextra -g3 -DDEBUG -DUSE_FULL_ASSERT -DTRACE -DOS_USE_TRACE_SEMIHOSTING_DEBUG -DSTM32F051x8 -DUSE_HAL_DRIVER -DHSE_VALUE=8000000 -I"../include" -I"../system/include" -I"../system/include/cmsis" -I"../system/include/stm32f0-hal" -std=gnu++11 -fabi-version=0 -fno-exceptions -fno-rtti -fno-use-cxa-atexit -fno-threadsafe-statics -MMD -MP -MF"system/src/newlib/cxx.d" -MT"system/src/newlib/cxx.o" -c -o "system/src/newlib/cxx.o" "../system/src/newlib/cxx.cpp"
../system/src/newlib/cxx.cpp: In function 'void __gnu_cxx::__verbose_terminate_handler()':
../system/src/newlib/cxx.cpp:51:5: error: 'abort' was not declared in this scope; did you mean 'std::abort'?
   51 |     abort();
      |     ^~~~~
      |     std::abort
In file included from ../system/src/newlib/cxx.cpp:35:
/home/jonah/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/14.2.1-1.1.1/.content/arm-none-eabi/include/c++/14.2.1/cstdlib:58:19: note: 'std::abort' declared here
   58 |   extern "C" void abort(void) _GLIBCXX_NOTHROW _GLIBCXX_NORETURN;
      |                   ^~~~~
../system/src/newlib/cxx.cpp: In function 'void __cxa_pure_virtual()':
../system/src/newlib/cxx.cpp:67:5: error: 'abort' was not declared in this scope; did you mean 'std::abort'?
   67 |     abort();
      |     ^~~~~
      |     std::abort
/home/jonah/.local/xPacks/@xpack-dev-tools/arm-none-eabi-gcc/14.2.1-1.1.1/.content/arm-none-eabi/include/c++/14.2.1/cstdlib:58:19: note: 'std::abort' declared here
   58 |   extern "C" void abort(void) _GLIBCXX_NOTHROW _GLIBCXX_NORETURN;
      |                   ^~~~~
../system/src/newlib/cxx.cpp: In function 'void __gnu_cxx::__verbose_terminate_handler()':
../system/src/newlib/cxx.cpp:52:3: warning: 'noreturn' function does return
   52 |   }
      |   ^
../system/src/newlib/cxx.cpp: In function 'void __cxa_pure_virtual()':
../system/src/newlib/cxx.cpp:68:3: warning: 'noreturn' function does return
   68 |   }
      |   ^
make: *** [system/src/newlib/subdir.mk:46: system/src/newlib/cxx.o] Error 1
"make all" terminated with exit code 2. Build might be incomplete.

11:32:20 Build Failed. 3 errors, 2 warnings. (took 138ms)

Using an older toolchain fixes the problem (such as 8.3.1-1.4.1). Also applying gcc's suggested change also fixes the problem.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions