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

#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.

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>
This commit is contained in:
Frédéric Desbiens
2026-09-10 07:25:37 -04:00
committed by GitHub
parent 7f6e496233
commit 5e9d046b12
2 changed files with 112 additions and 11 deletions
+8 -6
View File
@@ -1,10 +1,11 @@
name: gcc_check
# Builds the Arm ports with the Arm GNU toolchain, in five stages: assemble
# Builds the Arm ports with the Arm GNU toolchain, in six stages: assemble
# every assembly source of every Arm gnu port, assemble again the parts guarded
# by feature macros, compile the common C sources for one core per architecture
# profile, then link the example builds, both the script-driven ones and those
# driven by CMake.
# profile, compile the module manager C sources once per Arm module port, then
# link the example builds, both the script-driven ones and those driven by
# CMake.
#
# Why this exists: GCC is the project's declared default compiler (AGENTS.md,
# "The default compiler for the project is GCC 14 on Linux") and until this
@@ -13,9 +14,10 @@ name: gcc_check
# guarded than the GNU one, on ports whose directory is literally named gnu.
#
# What it covers: 840 assembly sources across 40 port families, 469 of them
# again behind feature macros, common/src for nine cores, 42 script-driven
# example links and the five Cortex-R52 CMake images. Every skip is printed by
# name with a reason -- run scripts/check_gcc.sh --help, or read its header.
# again behind feature macros, common/src for nine cores, 302 module manager C
# files across the nine Arm module ports, 42 script-driven example links and
# the five Cortex-R52 CMake images. Every skip is printed by name with a reason
# -- run scripts/check_gcc.sh --help, or read its header.
#
# What it does not cover: it compiles and links and **executes nothing**. The
# Cortex-R52 FVP ctest suite is not part of it. RISC-V, MIPS, RX and ARC are