diff options
author | Karel Gardas <karel.gardas@centrum.cz> | 2014-07-13 21:43:20 -0500 |
---|---|---|
committer | Austin Seipp <austin@well-typed.com> | 2014-07-13 21:43:21 -0500 |
commit | 6da603213b097a267418d8c14cbfaf0021ac2b2c (patch) | |
tree | d4ce537f5ab59241544bdb1d1e47023d96d3125b /compiler | |
parent | 16403f0d182d2d3d0b1fbe5ad778ead4bfcb7e16 (diff) | |
download | haskell-6da603213b097a267418d8c14cbfaf0021ac2b2c.tar.gz |
add support for x86_64-solaris2 platform
Summary:
this set of patches adds support for x86_64-solaris2 platform
Solaris is multi-lib platform which means it provides 32bit user-land together
with 32bit and 64bit libraries. The 32bit libraries are located in <somewhere>/lib
directories while 64bit libraries are located in <somewhere>/lib/64 directories.
This is why GHCi required the fix since otherwise it'll attempt to load
/usr/lib/libgmp.so which is 32bit library into 64bit binary process space (GHCi).
This of course fails with wrong ELFCLASS32 error message.
Another issue was that by default GNU C distributed with Solaris compiles
into 32bit binary. We need to enforce compilation to 64bit binary
by adding appropriate -m64 option.
Test Plan: already built on x86_64-solaris2
Reviewers: austin
Reviewed By: austin
Subscribers: phaskell, simonmar, relrod, carter
Differential Revision: https://phabricator.haskell.org/D68
Diffstat (limited to 'compiler')
-rw-r--r-- | compiler/ghci/Linker.lhs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/ghci/Linker.lhs b/compiler/ghci/Linker.lhs index 0b23985be8..0dbab24de7 100644 --- a/compiler/ghci/Linker.lhs +++ b/compiler/ghci/Linker.lhs @@ -1209,7 +1209,9 @@ locateLib dflags is_hs dirs lib mk_hs_dyn_lib_path dir = dir </> mkHsSOName platform hs_dyn_lib_name so_name = mkSOName platform lib - mk_dyn_lib_path dir = dir </> so_name + mk_dyn_lib_path dir = case (arch, os) of + (ArchX86_64, OSSolaris2) -> dir </> ("64/" ++ so_name) + _ -> dir </> so_name findObject = liftM (fmap Object) $ findFile mk_obj_path dirs findDynObject = liftM (fmap Object) $ findFile mk_dyn_obj_path dirs @@ -1226,6 +1228,8 @@ locateLib dflags is_hs dirs lib Nothing -> g platform = targetPlatform dflags + arch = platformArch platform + os = platformOS platform searchForLibUsingGcc :: DynFlags -> String -> [FilePath] -> IO (Maybe FilePath) searchForLibUsingGcc dflags so dirs = do |