Repository navigation
Add an armhf ABI for 32-bit ARM hard-float. - #22
Conversation
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.
| ║ 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 ║ |
There was a problem hiding this comment.
[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`. |
There was a problem hiding this comment.
[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."
| @@ -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 | |||
There was a problem hiding this comment.
[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.
32-bit ARM hard-float (
__ARM_PCS_VFP, thearm-linux-gnueabihftools) now selects its own ABI,armhf. The soft-floatarm32assembly is unchanged and still rejects a hard-float build.tools/abiname.shmatchesgnueabihfbeforegnueabi.stackman_switchspillsd8–d15.stackman_calldoes not. Linux CI gains anarmhfjob and runs the tests underqemu-arm.PLATFORM_PREFIXhas no trailing dash. The Makefile already appends-gcc, and the documented arm32, armhf, aarch64, and mingw examples now match that.qemu-armranbin/test,bin/test_cc,bin/test_static, andbin/test_asm.Floating-point status registers are a follow-up, stacked on this branch: kristjanvalur#5