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
On OSX at least, shared libraries are not linked with frameworks, resulting in dylibs which do not declare dependencies correctly (and cannot be loaded unless the dependency is manually loaded). Additionally, ld-options are also ignored for these dylibs.
where ld options and frameworks are not specified when generating the dylib.
cabal-install version 1.22.0.0
using version 1.22.0.0 of the Cabal library
Example:
cabal file snippet
library
exposed-modules: Test
-- other-modules:
other-extensions: ForeignFunctionInterface
build-depends: base >=4.8 && <4.9
-- hs-source-dirs:
default-language: Haskell2010
ld-options: wtf is this used for
frameworks: CoreFoundation
and a Test.hs like this:
{-# LANGUAGE ForeignFunctionInterface #-}
module Test where
import Foreign
foreign import ccall "CFRelease" cfRelease :: Ptr a -> IO ()
releaseNull = cfRelease nullPtr
The dylib that gets generated turns out to be this:
~/t/ghc-framework-test ❯❯❯ otool -L dist/build/libHSghcfr_C05XexetHdH9tTr8o4CTUh-ghc7.10.1.dylib
dist/build/libHSghcfr_C05XexetHdH9tTr8o4CTUh-ghc7.10.1.dylib:
@rpath/libHSghcfr_C05XexetHdH9tTr8o4CTUh-ghc7.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/libHSbase-4.8.0.0-I5BErHzyOm07EBNpKBEeUv-ghc7.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/libHSinteger-gmp-1.0.0.0-2aU3IZNMF9a7mQ0OzsZ0dS-ghc7.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
@rpath/libHSghc-prim-0.4.0.0-8TmvWUcS1U1IKHT0levwg3-ghc7.10.1.dylib (compatibility version 0.0.0, current version 0.0.0)
/usr/lib/libiconv.2.dylib (compatibility version 7.0.0, current version 7.0.0)
/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1213.0.0)
No mention of CoreFoundation anywhere.
The text was updated successfully, but these errors were encountered:
On OSX at least, shared libraries are not linked with frameworks, resulting in dylibs which do not declare dependencies correctly (and cannot be loaded unless the dependency is manually loaded). Additionally,
ld-options
are also ignored for these dylibs.I think the issue might be
cabal/Cabal/Distribution/Simple/GHC.hs
Line 648 in 71edb7d
Example:
cabal file snippet
and a Test.hs like this:
The dylib that gets generated turns out to be this:
No mention of CoreFoundation anywhere.
The text was updated successfully, but these errors were encountered: