-
-
Notifications
You must be signed in to change notification settings - Fork 35
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
Producing FFI static binaries #97
Comments
There may be a confusion in there, usually people refer to Separately: I suspect that |
@nh2, thanks for the quick response, do I need to update anything on the default.nix file? I tried to add the |
I think we need to backtrack a bit first so that I can understand what you want to achieve. What I said above boils down to "it is normal that your Now, what do you want to do? You're saying to
From looking at https://github.com/facebook/duckling, it seems that it's a Haskell-only library, so I suspect you "C-compliant" means that you want to be able to do If yes, then I have a good and a bad message:
(I notice you use |
That's resumes basically what I'm trying to do! I'll try to use |
I'd guess not, but I discovered |
Just a few notes, as this showed up due to the mention:
Do you need a statically linked GHC? No. Do you need the dependent archives available to roll them into a combined archive. Well, yes. Does GHC usually ship with the archives? Yes. |
@angerman, thanks for the detailed info. I have a question regarding fPIC, I have been not able to compile my library, as the linker complains that many of the core Haskell library were not compiled using fPIC. Which is the correct way of doing it? |
I managed to produce a static library, however, I get undefined symbols such as |
How exactly did you build it? Did it end up calling |
@angerman, yes indeed, I added |
You might have to look at the verbose output ( You could always link against |
Hi, thanks for your work on this!
I have a question regarding to the production of FFI binaries on Haskell using nix. Right now I'm trying to compile this project, https://github.com/treble-ai/duckling-ffi, which intends to produce a C-compliant static library. Until now, Nix is able to build the library and produces a static binary
libHSduckling-ffi-0.1.0.0-28aDIsnrQtXFlJL0Bi0HJ4.a
. However, when I inspect that binary usingnm
, I find that several Haskell runtime symbols are undefined, such asbase_GHCziForeign_zdwpeekCString_closure
, orrts_getPtr
, which prevent the output library to be useful. Is there any way to produce a full, static binary using static-haskell-nix? Sorry for my lack of background, as I don't have any previous haskell/nix experience.The text was updated successfully, but these errors were encountered: