Skip to content

Fix calls to varargs C functions #23

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Merged
merged 1 commit into from
Jan 5, 2021
Merged

Fix calls to varargs C functions #23

merged 1 commit into from
Jan 5, 2021

Conversation

nrdmn
Copy link
Contributor

@nrdmn nrdmn commented Jan 5, 2021

The ccall calling convention doesn't support varargs functions, so
switch to capi instead. See
https://ghc.gitlab.haskell.org/ghc/doc/users_guide/exts/ffi.html#varargs-not-supported-by-ccall-calling-convention

@phadej
Copy link
Collaborator

phadej commented Jan 5, 2021

How this is manifests? Or where (on which architecture)?

@phadej
Copy link
Collaborator

phadej commented Jan 5, 2021

I'm asking because fcntl is ccall imported in many libraries https://hackage-search.serokell.io/?q=foreign+import.*fcntl, including base.

@nrdmn
Copy link
Contributor Author

nrdmn commented Jan 5, 2021

I've noticed that this breaks on the Elbrus 2000 architecture. This issue says that it also affects Darwin on AArch64.

@phadej
Copy link
Collaborator

phadej commented Jan 5, 2021

Ok. So the problem (on macOS) is open, as OFD & fcntl is linux only.

@phadej
Copy link
Collaborator

phadej commented Jan 5, 2021

For the record, CApiFFI is available since GHC-7.4

@phadej phadej merged commit b3b4ea7 into haskellari:master Jan 5, 2021
@phadej
Copy link
Collaborator

phadej commented Jan 5, 2021

Also, Haskell runs on Elbrus 2000? wow.

@phadej
Copy link
Collaborator

phadej commented Jan 6, 2021

Released in lukko-0.1.1.3

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants