Skip to content

Conversation

@mflatt
Copy link
Contributor

@mflatt mflatt commented Nov 5, 2025

With pb, foreign calls in general use libffi, which does not provide support for union arguments and results. The binding in "c/ffi.c" approximates union handling by constructing a struct description that is likely to be treated the same in the platform's ABI. The approximation was wrong for s390x in the case of unions that contain only floating-point fields, so add a special case for s390x. There are surely other platforms that would need similar treatment, but s390x is relevant because there's no native-code backend for that architecture.

Related to #956

With pb, foreign calls in general use libffi, which does not provide
support for `union` arguments and results. The binding in "c/ffi.c"
approximates `union` handling by constructing a `struct` description
that is likely to be treated the same in the platform's ABI. The
approximation was wrong for s390x in the case of `union`s that contain
only floating-point fields, so add a special case for s390x. There are
surely other platforms that would need similar treatment, but s390x is
relevant because there's no native-code backend for that architecture.
@mflatt mflatt merged commit 0cd0ef0 into cisco:main Nov 7, 2025
16 checks passed
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