-
Notifications
You must be signed in to change notification settings - Fork 9
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
Build a statically linked Haskell library with ghc-musl #28
Comments
Now when I do
wonder is it not possible to link the remaining 3 libraries as well. EDIT |
Hi! I have not built static libraries before. I tried your example and get the same results. I think that your second set of commands is the most promising, and the error message seems to match the following documentation in the Shared libraries that export a C API section of the GHC User's Guide:
Perhaps it would work if
I am out of time today, but perhaps I will get a chance to try again this weekend. |
@TravisCardwell Thanks for looking into it. One thing I noticed is that when building GHC if it is configured with Also, do you have any directives or instructions on how to compile ghc with musl? |
We are using GHCUp to install an official binary package. There is likely a script somewhere that specifies exactly how the package is configured and built, but I have not been able to find one. Unfortunately, There are two official binary packages for Alpine (example: GHC 9.4.3): one using the GMP bignum implementation that we are using, and another using the Haskell-native bignum implementation. It might we worthwhile to try out the Haskell-native bignum implementation. I do not have any special instructions for building GHC on Alpine. I would start by following the instructions in the |
@Abhiroop See also commercialhaskell/stack#3420 |
Hello,
I am attempting to statically link a Haskell library that exports a C API. But I get the following errors if I pass the
-optl-static
flag:without the
-optl-static
flag the file is linked but when I runldd
I see there are dependencies like the following:Let me share the full set of commands and the full program so that the error can be reproduced. Here is what the programs looks like (taken from http://www.vex.net/~trebla/haskell/so.xhtml#top):
Eval.hs
hsbracket.c
The command that I run inside your docker image is this:
This one successfully produces the shared library, but if I do ldd I get:
Another set of commands that I tried with the above program is
But this fails with
Is it not possible to statically link this library?
The text was updated successfully, but these errors were encountered: