Skip to content

Generic-ELF: Add platform module to configure the .elf file extension

The .elf extension is a common convention used for embedded binaries. Both Arm and RISC-V use the ELF file format for executables. Configuring the .elf file extension is typically done incorrectly. Most embedded developers set this in toolchain files, which is not the correct place. This is typically accomplished through a hack by setting the individual language file extensions for C, CXX, and ASM. Multiple CMake issues in the past have been opened which are related to this.

A platform module makes it simpler and less error prone for developers targeting these ubiquitous bare-metal platforms. This PR attempts to solve this globally with a generic platform module Generic-ELF based off of the Generic module. This could also be solved by using more specific platform modules, such as one for each of bare-metal Arm and RISC-V.

Fixes: #22756 (closed)
Topic-rename: platform-generic-elf

Edited by Brad King

Merge request reports