[commit: packages/Cabal] ghc-head: Don't use -dylib-install-name on OS X with GHC > 7.8. (ee6d1cf)

git at git.haskell.org git at git.haskell.org
Fri Jan 31 23:27:37 UTC 2014


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

On branch  : ghc-head
Link       : http://git.haskell.org/packages/Cabal.git/commitdiff/ee6d1cf5cefe18f6d74ed379af21d92f8b0ae92d

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

commit ee6d1cf5cefe18f6d74ed379af21d92f8b0ae92d
Author: Mikhail Glushenkov <mikhail.glushenkov at gmail.com>
Date:   Thu Jan 30 21:00:10 2014 +0100

    Don't use -dylib-install-name on OS X with GHC > 7.8.
    
    Fixes #1660. Based on a patch by Christiaan Baaij.


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

ee6d1cf5cefe18f6d74ed379af21d92f8b0ae92d
 Cabal/Distribution/Simple/GHC.hs |   10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)

diff --git a/Cabal/Distribution/Simple/GHC.hs b/Cabal/Distribution/Simple/GHC.hs
index c7ea633..3159545 100644
--- a/Cabal/Distribution/Simple/GHC.hs
+++ b/Cabal/Distribution/Simple/GHC.hs
@@ -119,7 +119,7 @@ import Distribution.Simple.Compiler
 import Distribution.Version
          ( Version(..), anyVersion, orLaterVersion )
 import Distribution.System
-         ( OS(..), buildOS )
+         ( Platform(..), OS(..), buildOS, platformFromTriple )
 import Distribution.Verbosity
 import Distribution.Text
          ( display, simpleParse )
@@ -140,7 +140,6 @@ import System.FilePath          ( (</>), (<.>), takeExtension,
 import System.IO (hClose, hPutStrLn)
 import System.Environment (getEnv)
 import Distribution.Compat.Exception (catchExit, catchIO)
-import Distribution.System (Platform, platformFromTriple)
 
 
 -- -----------------------------------------------------------------------------
@@ -688,6 +687,7 @@ buildOrReplLib forRepl verbosity pkg_descr lbi lib clbi = do
       ifReplLib = when forRepl
       comp = compiler lbi
       ghcVersion = compilerVersion comp
+      (Platform _hostArch hostOS) = hostPlatform lbi
 
   (ghcProg, _) <- requireProgram verbosity ghcProgram (withPrograms lbi)
   let runGhcProg = runGHC verbosity ghcProg
@@ -868,8 +868,10 @@ buildOrReplLib forRepl verbosity pkg_descr lbi lib clbi = do
               ghcOptInputFiles         = dynamicObjectFiles,
               ghcOptOutputFile         = toFlag sharedLibFilePath,
               -- For dynamic libs, Mac OS/X needs to know the install location
-              -- at build time.
-              ghcOptDylibName          = if buildOS == OSX
+              -- at build time. This only applies to GHC < 7.8 - see the
+              -- discussion in #1660.
+              ghcOptDylibName          = if (hostOS == OSX
+                                             && ghcVersion < Version [7,8] [])
                                           then toFlag sharedLibInstallPath
                                           else mempty,
               ghcOptPackageName        = toFlag pkgid,



More information about the ghc-commits mailing list