You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Apologies if this isn't the correct place to ask support questions.
I have a haskell application (hevm) that links in a few external c dependencies, and I would like to use cabal to produce self contained binaries that can be downloaded and run on a wide range of end user systems. On linux, this is pretty easy using --enable-executable-static to proudce a fully static binary (this is how we do it at the moment). On macos things are a little more complicated as fully static executables are not supported. I would like to produce a binary that links the external c dependencies statically, but keeps system provided libraries (i.e. at a minimum /usr/lib/libSystem.B.dylib) as dynamically linked.
Is there a set of config / build flags that I can pass to cabal to achieve this? afaict --enable-executable-static is not suitable for producing distributable binaries on macos as it will try to force static linking of all dependencies (including system provided ones).
The text was updated successfully, but these errors were encountered:
so after messing around for a while I think we have something working: ethereum/hevm#185.
From what we observed during our experimentation, ghc will link a library statically if it can only find static versions of that library. If it can find both static and dynamic versions it will link dynamically. We were able to write some build system scripts that leveraged this behaviour to get the output we needed, but it's pretty dirty.
Ideally this would be better supported in cabal / ghc, perhaps with some ghc flags that would give more granular control over which libs should be linked statically or dynamically, along with a cabal flag (maybe smth like --enable-macos-static), that would link everything statically except for core system libraries?
Apologies if this isn't the correct place to ask support questions.
I have a haskell application (hevm) that links in a few external c dependencies, and I would like to use cabal to produce self contained binaries that can be downloaded and run on a wide range of end user systems. On linux, this is pretty easy using
--enable-executable-static
to proudce a fully static binary (this is how we do it at the moment). On macos things are a little more complicated as fully static executables are not supported. I would like to produce a binary that links the external c dependencies statically, but keeps system provided libraries (i.e. at a minimum/usr/lib/libSystem.B.dylib
) as dynamically linked.Is there a set of config / build flags that I can pass to cabal to achieve this? afaict
--enable-executable-static
is not suitable for producing distributable binaries on macos as it will try to force static linking of all dependencies (including system provided ones).The text was updated successfully, but these errors were encountered: