Skip to content

All function/callback calls triggers SIGILL on ARMv5 cpus without FPU #490

Description

@xakep666

PureGo Version

v0.10.2

Operating System

  • Windows
  • macOS
  • Linux
  • FreeBSD
  • NetBSD
  • Android
  • iOS

Go Version (go version)

1.26.5

What steps will reproduce the problem?

Run any example on ARMv5 CPU without FPU. I.e. Marwell Kirkwood which is used on NASes.

What is the expected result?

Examples are crashing with SIGILL

What happens instead?

Everything works, functions containing float32/64 arguments and return values can be called via RegisterFunc/RegisterCallback.

Anything else you feel useful to add?

Reason: all assembly trampolines in purego for 'arm' are unconditionally saving/restoring FP registers. Go runtime has special variable goarmsoftfp to detect soft-float usage and skip FP-related instructions.

Linux/ARM declared as Tier 2 supported target in README and IMHO should be supported equal to Go itself: recognize soft-float usage and act properly.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions