Skip to content

Added bash A profile update scripts and restored ports_arch as their source - #592

Merged
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
fdesbiens:fix/armv7a-armv8a-source-sync
Aug 9, 2026
Merged

Added bash A profile update scripts and restored ports_arch as their source#592
fdesbiens merged 1 commit into
eclipse-threadx:devfrom
fdesbiens:fix/armv7a-armv8a-source-sync

Conversation

@fdesbiens

Copy link
Copy Markdown
Contributor

Gives the ARMv7-A and ARMv8-A ports the same bash tooling the M profile has, restores ports_arch as their source, and moves the cortex-a CI job off Windows.

Stacked on #591. Merge #590 and #591 first.

Bash equivalents of update.ps1

update.sh sits beside each update.ps1, with the same cores, compilers, copy sets and patches. --copy-example, --copy-validation-test and --copy-regression-test are accepted and ignored, exactly as in the PowerShell version, where they are declared but never consulted, so both take the same command line.

The two were compared by what each reports as drifted, against the last Windows run of the job. They agree exactly on all 63 files, and the bash version reports 12 more.

Those 12 files are a bug in update.ps1

The ARMv7-A patch table writes its two .cproject patterns differently:

('value=`"cortex-a7`"', 'value=`"cortex-$($core_short_lower)`"'),   # backticks, never matches
('Cortex-A7.NoFPU',     'Cortex-$($core_short_upper).NoFPU')        # plain, always worked

The shipped files show precisely that split:

Port CPU value FPU string
cortex_a5/ac6 value="cortex-a7" Cortex-A5.NoFPU
cortex_a9/ac6 value="cortex-a7" Cortex-A9.NoFPU
a8, a12, a15, a17 same same

So the AC6 Eclipse example builds for six Cortex-A cores have been naming cortex-a7 as their CPU since the script was written. ARMv8-A uses plain double quotes and works, which is why the bash version matched it perfectly. The bash scripts do what the PowerShell ones intended, so regenerating corrects those twelve files.

Restoring the source

One genuine revert hazard, the same shape as #590:

_tx_thread_smp_time_get had been implemented in the generated ports only. #555 replaced the stub with a real generic timer read in all 24 SMP ports, but never touched ports_arch/ARMv8-A/threadx_smp/common/src/tx_thread_smp_time_get.S, which still held:

    MOV     x0, #0          // FIXME: Get timer

Regenerating would have put that stub back in every ARMv8-A SMP port, replacing a working timer read. The implementation now lives in the source.

The rest is cosmetic and resolves in favour of the source, since these ports are generated: a trailing blank line removed from 38 copies of tx_thread_schedule.S, and comment spacing in one tx_port.h.

Correction to something I said on #591: I attributed the tx_thread_schedule.S drift to the Cortex-A VFP fix and said regeneration would revert it. Measuring it showed otherwise. That fix is already in ports_arch, was never at risk, and the drift in those 38 files is whitespace. The SMP timer above is the real hazard. #591's description has been corrected.

CI

  • The cortex-a job moves from windows-latest to ubuntu-24.04 and runs the bash scripts. It was the only job needing a Windows image, and only because of the tooling.
  • Every workflow is pinned to ubuntu-24.04. ubuntu-latest already resolves to that image, so nothing changes today; it means a future runner migration is a deliberate commit rather than something that happens underneath the -m32 builds.
  • scripts/check_ports.sh now runs the A profile generators too, so one local command covers both families.

A flaw found in the checker itself

While testing, check_ports.sh reported a clean pass on a tree where the generators were absent: their failure was swallowed by the output redirect, so nothing regenerated and nothing drifted. A check that goes green when it did not run is worse than no check. Generator failures are now caught and reported:

FAIL: generator failed: env -C ports_arch/ARMv7-A ./update.sh --port-sets tx ...

Verification

  • The bash scripts reproduce the PowerShell drift set exactly, 63 of 63, plus the 12 explained above.
  • After the sync, check_ports.sh passes and the generators are idempotent.
  • Every removed line across the 51 regenerated files was accounted for: the trailing blank lines, the four .cproject CPU option lines across six cores, the FIXME stub in the source, and one comment's spacing. Nothing else is lost.
  • The generator guard was verified by breaking a generator deliberately and confirming the run fails, then restoring it and confirming it passes.

@fdesbiens
fdesbiens force-pushed the fix/armv7a-armv8a-source-sync branch from ccb40fe to 2703db4 Compare August 9, 2026 14:45
…source

The ARMv7-A and ARMv8-A ports are generated by update.ps1, which needs
PowerShell, so the cortex-a job in ports_arch_check ran on a Windows image and
nobody could reproduce it locally on Linux. Add update.sh beside each
update.ps1, with the same cores, compilers, copy sets and patches, and move the
job to the same Linux image as everything else.

The bash scripts were checked against the PowerShell ones by comparing what
each reports as drifted. They agree exactly on the 63 files the Windows job
last reported, and differ on 12 more, which turn out to be a defect in
update.ps1 rather than in the port. Its two .cproject patterns are written as
'value=`"cortex-a7`"' with backticks that survive into the pattern, so that
replacement has never matched, while the neighbouring Cortex-A7.NoFPU pattern
has no backticks and always worked. The result is that the AC6 example builds
for the A5, A8, A9, A12, A15 and A17 cores name cortex-a7 as their CPU while
their FPU string is correct. The bash scripts do what the PowerShell ones
intended, so regenerating corrects those twelve files.

Restore ports_arch as the source for the rest. The implementation of
_tx_thread_smp_time_get from eclipse-threadx#555 was applied to the twenty four generated SMP
ports and never to ports_arch, which still held MOV x0, #0 with a FIXME
comment, so regenerating would have replaced a working generic timer read with
a stub. That implementation now lives in the source. The remaining differences
are cosmetic and resolve in favour of the source: a trailing blank line in 38
copies of tx_thread_schedule.S and comment spacing in one tx_port.h.

Note that the Cortex-A VFP fix is already present in ports_arch and was never
at risk, contrary to what the description of the port consistency checks change
said before this was measured.

Extend scripts/check_ports.sh to run the A profile generators too, and make it
fail when a generator fails or is missing rather than reporting a clean tree,
which would have been a false pass.

Pin every workflow to ubuntu-24.04. ubuntu-latest already resolves to that
image, so nothing changes today, but a future migration becomes a deliberate
commit rather than something that happens underneath the -m32 builds.

Assisted-by: Claude Code (Opus 5) <noreply@anthropic.com>
@fdesbiens
fdesbiens force-pushed the fix/armv7a-armv8a-source-sync branch from 2703db4 to f5a4707 Compare August 9, 2026 14:52
@fdesbiens
fdesbiens merged commit f23a180 into eclipse-threadx:dev Aug 9, 2026
3 checks passed
@fdesbiens
fdesbiens deleted the fix/armv7a-armv8a-source-sync branch August 9, 2026 14:55
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