Skip to content

Add an armhf ABI for 32-bit ARM hard-float. - #22

Merged
kristjanvalur merged 4 commits into
stackless-dev:masterfrom
kristjanvalur:armhf
Oct 14, 2026
Merged

kristjanvalur merged 4 commits into
stackless-dev:masterfrom
kristjanvalur:armhf

Conversation

@kristjanvalur

@kristjanvalur kristjanvalur commented Oct 14, 2026 •

Copy link
Copy Markdown
Collaborator

32-bit ARM hard-float (__ARM_PCS_VFP, the arm-linux-gnueabihf tools) now selects its own ABI, armhf. The soft-float arm32 assembly is unchanged and still rejects a hard-float build. tools/abiname.sh matches gnueabihf before gnueabi.

stackman_switch spills d8–d15. stackman_call does not. Linux CI gains an armhf job and runs the tests under qemu-arm.

PLATFORM_PREFIX has no trailing dash. The Makefile already appends -gcc, and the documented arm32, armhf, aarch64, and mingw examples now match that.

qemu-arm ran bin/test, bin/test_cc, bin/test_static, and bin/test_asm.

Floating-point status registers are a follow-up, stacked on this branch: kristjanvalur#5

A __ARM_PCS_VFP build includes switch_armhf_gcc.h and reports the ABI
name armhf. The soft-float header still rejects that macro, and softfp
still builds as arm32. CI, the release archive, and the ABI probe know
the new name. The checked-in assembly is not in this commit.
Generated with arm-linux-gnueabihf-gcc -S -marm from switch_armhf_gcc.h.
stackman_switch saves d8-d15 before the callback sees the stack pointer
and reloads them after the restore callback. stackman_call does not
touch those registers. qemu-arm ran the four test programs.
The Makefile appends -gcc to PLATFORM_PREFIX. The examples already
included that dash, so the documented command looked up a compiler
named arm-linux-gnueabihf--gcc.
Comment thread README.md
║ Do you have a stack? Stackman is here to help. ║
║ ║
║ v1.2.5 • 10 platforms • Stack switching simplified ║
║ v1.2.5 • 11 platforms • Stack switching simplified ║

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] The banner now says 11 platforms and the ABI list adds armhf, but two later sections of the same README were not updated. Line 192 still says pre-built libraries cover "9 ABIs total: 4 Linux, 2 macOS, 3 Windows" (actual set is 6 Linux + 2 macOS + 3 Windows). Line 222 still says CI builds "all 9 supported platforms" and lists Linux as AMD64, i386, ARM32, and ARM64, omitting both armhf and riscv64.

Suggestion: Update those two sentences to the same 11-ABI set the banner, the platform list, and create-release now use, including armhf in the Linux CI list.

## Roadmap

Two items from the audit are still open.
SME lazy save is still open. The ARM32 hard-float port is `armhf`.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[suggestion] The roadmap now says the ARM32 hard-float port is armhf, but earlier sections of this file still describe that port as future work. The findings table (line 161) says "armhf is not a configured ABI." The soft-float applied fix (line 359) says "A separate hard-float port is on the roadmap." Those sentences now contradict the roadmap and platform.h.

Suggestion: Leave the original soft-float findings in place, and add a short applied-fix note that __ARM_PCS_VFP now selects armhf (switch_armhf_gcc.S spills d8–d15; FPSCR is still not spilled). Drop or qualify "on the roadmap" / "not a configured ABI."

Comment thread stackman/platforms/switch_armhf_gcc.h Outdated
@@ -0,0 +1,132 @@
/* Switch function for 32-bit ARM hard-float (AAPCS-VFP, gnueabihf).
* The soft-float file switch_arm_gcc.S stays as it is. platform.h

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

[nit] The new file header narrates this change ("The soft-float file switch_arm_gcc.S stays as it is. platform.h includes this header only when __ARM_PCS_VFP is set") instead of only stating a constraint. The following notes (why the empty d8–d15 clobber must run before the published sp, why FPSCR is intentionally absent, why r11 must not be adjusted, and the -marm regenerate command) are the part a later editor needs. The long omit-frame-pointer essay copied from switch_arm_gcc.h (around line 53, "it turns out that this version actually runs") is the same kind of history.

Suggestion: Keep the softfp footgun, the spill/FPSCR/r11 constraints, and the regenerate command. Drop the "stays as it is" / dispatch narration, and trim the copied essay to the omit-frame-pointer and -O reasons.

The README counts now match the 11 ABIs, including armhf and riscv64.
The audit keeps the soft-float findings and records that __ARM_PCS_VFP
selects armhf, which spills d8-d15 and still does not spill FPSCR.
The armhf header keeps the spill, FPSCR, r11, and softfp constraints.
@kristjanvalur
kristjanvalur merged commit 6b12eb9 into stackless-dev:master Oct 14, 2026
14 checks passed
@kristjanvalur
kristjanvalur deleted the armhf branch October 14, 2026 20:38
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