Add the RTLD_GLOBAL option to dlopen
This enables libraries that depend on other libraries to be openable by making
the symbols of loaded libraries globally available.
commitf5f2bd33c475c3d230775ee09e7dda28c114dbc3
authorDavid Christiansen <david@davidchristiansen.dk>
dateThu 2 May 2013, 22:23 (13 years ago)
parentace080c
src/Util/DynamicLinker.hs+1−1
@@ -35,7 +35,7 @@ data DynamicLib = Lib { lib_name :: String
3535tryLoadLib :: String -> IO (Maybe DynamicLib)
3636tryLoadLib lib = do exactName <- doesFileExist lib
3737 let filename = if exactName then lib else lib ++ "." ++ hostDynamicLibExt
38− handle <- dlopen filename [RTLD_NOW]
38+ handle <- dlopen filename [RTLD_NOW, RTLD_GLOBAL]
3939 if undl handle == nullPtr
4040 then return Nothing
4141 else return . Just $ Lib lib handle