Skip to content

Compiled the module manager C sources with GCC, as clang already did - #716

Merged
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
fdesbiens:feat/gcc-module-manager-c
Sep 10, 2026
Merged

Compiled the module manager C sources with GCC, as clang already did#716
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
fdesbiens:feat/gcc-module-manager-c

Conversation

@fdesbiens

Copy link
Copy Markdown
Contributor

#689 added the module manager stage to check_clang.sh alone. The GCC half was
never written, so the module manager C stayed unbuilt by the project's declared
default compiler: 28 files of portable module manager under common_modules,
plus the three to nine per-port files under
ports_module/<core>/gnu/module_manager/src, across nine Arm module ports.

The stage is deliberately check_clang.sh's, port for port and header for
header, because a port covered by one check and not the other implies a parity
the checks list does not have. The same two details the ports dictate carry
over: an SMP port's control blocks come from common_smp rather than common,
and the TrustZone ports need -mcmse for their cmse_nonsecure_entry
functions to be honoured rather than ignored. The clang-only waiver does not:
GCC implements the optimize attribute that tx_thread_secure_stack.c
carries, so nothing needs suppressing for that file.

One divergence is forced by the toolchain. txm_module_manager_absolute_load.c
carries a #pragma message steering callers to the extended entry point, and
the C stages treat any compiler output as a failure. check_clang.sh silences
it with -Wno-#pragma-messages; GCC has no equivalent, and neither
-Wno-pragmas nor any other -W option suppresses the note -- verified with
14.3.rel1. The note is therefore filtered out of the stage's output instead,
together with the source quote GCC prints beneath it. The filter stops at the
next line that begins a diagnostic of its own, so an error immediately
following a waived note is still reported; that case is what the
injected-defect run below checks.

The workflow needed no trigger change: #689 added common_modules/** to both
path lists in advance, for the stage that had yet to arrive. Its header comment
is brought in line with what the workflow now runs.

Verification

Run with the toolchain CI pins, arm-gnu-toolchain 14.3.rel1, both triples. The
full script passes and every port compiles every file, matching the counts
check_clang.sh reports for the same nine ports:

== Module manager C sources, one per Arm module port ==
  cortex_a35: 31 of 31 compiled
  cortex_a35_smp: 31 of 31 compiled
  cortex_a7: 34 of 34 compiled
  cortex_m0+: 33 of 33 compiled
  cortex_m23: 37 of 37 compiled
  cortex_m3: 33 of 33 compiled
  cortex_m33: 37 of 37 compiled
  cortex_m4: 33 of 33 compiled
  cortex_m7: 33 of 33 compiled

Verified that the stage fails as intended by injecting defects into a
throwaway worktree: one in common_modules on the line straight after the
waived pragma note, reported under all nine ports, and one in a single port's
own source, reported only under that port.

  FAIL: cortex_a35: common_modules/module_manager/src/txm_module_manager_absolute_load.c
        ...absolute_load.c:58:25: error: initialization of 'int' from 'char *' ...
  cortex_a35: 30 of 31 compiled
  ...
  FAIL: cortex_m4: ports_module/cortex_m4/gnu/module_manager/src/txm_module_manager_mm_register_setup.c
        ...mm_register_setup.c:1:24: error: initialization of 'int' from 'char *' ...
  cortex_m4: 31 of 33 compiled

eclipse-threadx#689 added the module manager stage to check_clang.sh alone. The GCC half was
never written, so the module manager C stayed unbuilt by the project's declared
default compiler: 28 files of portable module manager under common_modules,
plus the three to nine per-port files under
ports_module/<core>/gnu/module_manager/src, across nine Arm module ports.

The stage is deliberately check_clang.sh's, port for port and header for
header, because a port covered by one check and not the other implies a parity
the checks list does not have. The same two details the ports dictate carry
over: an SMP port's control blocks come from common_smp rather than common, and
the TrustZone ports need -mcmse for their cmse_nonsecure_entry functions to be
honoured rather than ignored. The clang-only waiver does not: GCC implements
the optimize attribute that tx_thread_secure_stack.c carries, so nothing needs
suppressing for that file.

One divergence is forced by the toolchain. txm_module_manager_absolute_load.c
carries a #pragma message steering callers to the extended entry point, and the
C stages treat any compiler output as a failure. check_clang.sh silences it with
-Wno-#pragma-messages; GCC has no equivalent, and neither -Wno-pragmas nor any
other -W option suppresses the note -- verified with 14.3.rel1. The note is
therefore filtered out of the stage's output instead, together with the source
quote GCC prints beneath it. The filter stops at the next line that begins a
diagnostic of its own, so an error immediately following a waived note is still
reported; that case is what the injected-defect run below checks.

The workflow needed no trigger change: eclipse-threadx#689 added common_modules/** to both
path lists in advance, for the stage that had yet to arrive. Its header comment
is brought in line with what the workflow now runs.

Verified with the toolchain CI pins, arm-gnu-toolchain 14.3.rel1, both triples.
The full script passes and every port compiles every file, matching the counts
check_clang.sh reports for the same nine ports:

  cortex_a35 31/31   cortex_a35_smp 31/31   cortex_a7 34/34
  cortex_m0+ 33/33   cortex_m23 37/37       cortex_m3 33/33
  cortex_m33 37/37   cortex_m4 33/33        cortex_m7 33/33

Verified that the stage fails as intended by injecting defects into a throwaway
worktree: one in common_modules on the line straight after the waived pragma
note, reported under all nine ports, and one in a single port's own source,
reported only under that port.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
@fdesbiens
fdesbiens merged commit 5e9d046 into eclipse-threadx:dev Sep 10, 2026
9 checks passed
@fdesbiens
fdesbiens deleted the feat/gcc-module-manager-c branch September 10, 2026 11:25
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.

1 participant