Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Request for comments: pthread dependency #32

Closed
wants to merge 1 commit into from

Conversation

edsko
Copy link

@edsko edsko commented Apr 24, 2024

Note

I don't know what the right answer is here. Perhaps this PR should be just be closed as wrong.

In crypton.cabal we have

if os(linux)
        extra-libraries: pthread

This was introduced in haskell-crypto#184 . I don't understand the issue well enough at all, perhaps this is actually required in some setups (perhaps only when the gold linker is used?). However, on my machine at least, this line does not appear to be necessary (both with and without -threaded), and https://stackoverflow.com/a/62561519/742991 suggests that -lpthread is deprecated.

It's causing some issues in some circumstances (e.g., see my trace-foreign-calls plugin), when ghc tries to load crypton dynamically, resulting in something like

<command line>: User-specified static library could not be loaded (/usr/lib/gcc/x86_64-linux-gnu/13/../../../x86_64-linux-gnu/libpthread.a)
Loading static libraries is not supported in this configuration.
Try using a dynamic library instead.

Related: https://gitlab.haskell.org/ghc/ghc/-/issues/12816 (which adds the dependency, to be clear, not remove it).

@edsko
Copy link
Author

edsko commented Apr 24, 2024

After having discussed this with a colleague, I believe the better approach is #33. Closing this.

@edsko edsko closed this Apr 24, 2024
@kazu-yamamoto kazu-yamamoto self-requested a review April 24, 2024 23:36
@edsko edsko reopened this Apr 25, 2024
kazu-yamamoto added a commit that referenced this pull request Apr 25, 2024
@kazu-yamamoto
Copy link
Owner

I made a mistake.
I accidentally merged #33, so reverted it, and merge this PR by hand.

@edsko
Copy link
Author

edsko commented Apr 25, 2024

Ok, perfect, then I'll delete my branch. Thanks!

@edsko edsko deleted the edsko/remove-pthread-dep branch April 25, 2024 09:20
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.

2 participants