Skip to content

Fix __PROGRAM_START definition for TI Arm Clang (tiarmclang) - #315

Merged
JonatanAntoni merged 3 commits into
mainfrom
copilot/fix-compile-failure-tiarmclang
Sep 2, 2026
Merged

Fix __PROGRAM_START definition for TI Arm Clang (tiarmclang)#315
JonatanAntoni merged 3 commits into
mainfrom
copilot/fix-compile-failure-tiarmclang

Conversation

Copilot AI commented Sep 1, 2026

Copy link
Copy Markdown
Contributor

CMSIS_6 routes tiarmclang through cmsis_clang.h/cmsis_clang_m.h, which unconditionally defines __PROGRAM_START as _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

  • In CMSIS/Core/Include/m-profile/cmsis_clang_m.h, define __PROGRAM_START as _c_int00 when __ti__ is defined (TI Arm Clang), falling back to _start for all other Clang-based compilers.
#ifndef __PROGRAM_START
#if defined (__ti__)
#define __PROGRAM_START           _c_int00
#else
#define __PROGRAM_START           _start
#endif
#endif

__ti__ is the identifier tiarmclang already defines and is used consistently elsewhere in the codebase (cmsis_compiler.h, various core_*.h files) to distinguish TI Arm Clang from other Clang-based toolchains.

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
Copilot AI requested a review from JonatanAntoni September 1, 2026 14:23
@JonatanAntoni
JonatanAntoni marked this pull request as ready for review September 1, 2026 14:25
@github-actions

github-actions Bot commented Sep 1, 2026

Copy link
Copy Markdown

Test Results

   644 files  ±0     644 suites  ±0   15m 4s ⏱️ + 3m 53s
    49 tests ±0      44 ✅ ±0       5 💤 ±0  0 ❌ ±0 
31 556 runs  ±0  20 156 ✅ ±0  11 400 💤 ±0  0 ❌ ±0 

Results for commit 1df8fc7. ± Comparison against base commit 8827df2.

♻️ This comment has been updated with latest results.

@JonatanAntoni
JonatanAntoni merged commit 7dc9932 into main Sep 2, 2026
9 checks passed
@JonatanAntoni
JonatanAntoni deleted the copilot/fix-compile-failure-tiarmclang branch September 2, 2026 11:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

compile failed when use tiarmclang 5.1.1

3 participants