Fix __PROGRAM_START definition for TI Arm Clang (tiarmclang) - #315
Merged
Conversation
Co-authored-by: JonatanAntoni <25795816+JonatanAntoni@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix compile failure when using tiarmclang 5.1.1
Fix __PROGRAM_START definition for TI Arm Clang (tiarmclang)
Sep 1, 2026
JonatanAntoni
marked this pull request as ready for review
September 1, 2026 14:25
JonatanAntoni
approved these changes
Sep 2, 2026
RobertRostohar
approved these changes
Sep 2, 2026
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.
CMSIS_6 routes
tiarmclangthroughcmsis_clang.h/cmsis_clang_m.h, which unconditionally defines__PROGRAM_STARTas_start. TI Arm Clang's actual C runtime entry point is_c_int00, so this causes link failures that didn't occur with CMSIS_5 (which special-cased tiarmclang correctly).Changes
CMSIS/Core/Include/m-profile/cmsis_clang_m.h, define__PROGRAM_STARTas_c_int00when__ti__is defined (TI Arm Clang), falling back to_startfor all other Clang-based compilers.__ti__is the identifier tiarmclang already defines and is used consistently elsewhere in the codebase (cmsis_compiler.h, variouscore_*.hfiles) to distinguish TI Arm Clang from other Clang-based toolchains.