[commit: ghc] master: Add Solaris linker support to SysTools (59182e4)

git at git.haskell.org git at git.haskell.org
Tue Jan 14 09:47:12 UTC 2014


Repository : ssh://git@git.haskell.org/ghc

On branch  : master
Link       : http://ghc.haskell.org/trac/ghc/changeset/59182e42bb0922238faba8fff3c5c20966d4af14/ghc

>---------------------------------------------------------------

commit 59182e42bb0922238faba8fff3c5c20966d4af14
Author: Karel Gardas <karel.gardas at centrum.cz>
Date:   Mon Jan 13 16:59:47 2014 -0600

    Add Solaris linker support to SysTools
    
    Signed-off-by: Austin Seipp <austin at well-typed.com>


>---------------------------------------------------------------

59182e42bb0922238faba8fff3c5c20966d4af14
 compiler/main/DynFlags.hs  |    1 +
 compiler/main/SysTools.lhs |    9 +++++++++
 2 files changed, 10 insertions(+)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 193303e..20b61c1 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -3728,6 +3728,7 @@ data LinkerInfo
   = GnuLD    [Option]
   | GnuGold  [Option]
   | DarwinLD [Option]
+  | SolarisLD [Option]
   | UnknownLD
   deriving Eq
 
diff --git a/compiler/main/SysTools.lhs b/compiler/main/SysTools.lhs
index d0545fd..510475e 100644
--- a/compiler/main/SysTools.lhs
+++ b/compiler/main/SysTools.lhs
@@ -638,6 +638,7 @@ neededLinkArgs :: LinkerInfo -> [Option]
 neededLinkArgs (GnuLD o)     = o
 neededLinkArgs (GnuGold o)   = o
 neededLinkArgs (DarwinLD o)  = o
+neededLinkArgs (SolarisLD o) = o
 neededLinkArgs UnknownLD     = []
 
 -- Grab linker info and cache it in DynFlags.
@@ -676,6 +677,14 @@ getLinkerInfo' dflags = do
   -- Process the executable call
   info <- catchIO (do
              case os of
+               OSSolaris2 ->
+                 -- Solaris uses its own Solaris linker. Even all
+                 -- GNU C are receommended to configure with Solaris
+                 -- linker instead of using GNU binutils linker. Also
+                 -- all GCC distributed with Solaris follows this rule
+                 -- precisely so we assume here, the Solaris linker is
+                 -- used.
+                 return $ SolarisLD []
                OSDarwin ->
                  -- Darwin has neither GNU Gold or GNU LD, but a strange linker
                  -- that doesn't support --version. We can just assume that's



More information about the ghc-commits mailing list