[commit: ghc] wip/nfs-locking: Use nm-classic instead of nm when host is Darwin (3c31edc)

git at git.haskell.org git at git.haskell.org
Fri Oct 27 00:20:06 UTC 2017


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

On branch  : wip/nfs-locking
Link       : http://ghc.haskell.org/trac/ghc/changeset/3c31edcca75f477bfeb54cd844c9d2f575037c3c/ghc

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

commit 3c31edcca75f477bfeb54cd844c9d2f575037c3c
Author: Tomas Carnecky <tomas.carnecky at gmail.com>
Date:   Sun Jul 24 00:03:59 2016 +0200

    Use nm-classic instead of nm when host is Darwin


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

3c31edcca75f477bfeb54cd844c9d2f575037c3c
 README.md                          | 8 --------
 src/Settings/Builders/Configure.hs | 7 +++++++
 2 files changed, 7 insertions(+), 8 deletions(-)

diff --git a/README.md b/README.md
index 4ce3b3a..d99d2b7 100644
--- a/README.md
+++ b/README.md
@@ -43,14 +43,6 @@ runs the `boot` and `configure` scripts automatically on the first build, so tha
 need to. Use `--skip-configure` to suppress this behaviour (see overview of command line
 flags below).
 
-* Also note on OS X newer versions of XCode ship with a broken `nm` tool
-([#11744](https://ghc.haskell.org/trac/ghc/ticket/11744)). One way to mitigate the
-problem is to add the following into your `UserSettings.hs`:
-  ````haskell
-  userArgs :: Args
-  userArgs = builder (Configure ".") ? arg "--with-nm=$(xcrun --find nm-classic)"
-  ````
-
 Using the build system
 ----------------------
 Once your first build is successful, simply run `build` to rebuild. Most build artefacts
diff --git a/src/Settings/Builders/Configure.hs b/src/Settings/Builders/Configure.hs
index c95a5da..6482df1 100644
--- a/src/Settings/Builders/Configure.hs
+++ b/src/Settings/Builders/Configure.hs
@@ -1,5 +1,7 @@
 module Settings.Builders.Configure (configureBuilderArgs) where
 
+import qualified System.Info as System
+
 import Base
 import Oracles.Config.Setting
 import Oracles.WindowsPath
@@ -23,4 +25,9 @@ configureBuilderArgs = mconcat
                , "--enable-static=yes"
                , "--enable-shared=no" -- TODO: add support for yes
                , "--host=" ++ targetPlatform ]
+
+    -- On OS X, use "nm-classic" instead of "nm" due to a bug in the later.
+    -- See https://ghc.haskell.org/trac/ghc/ticket/11744
+    , builder (Configure ".") ? System.os == "darwin" ?
+        arg "--with-nm=$(xcrun --find nm-classic)"
     ]



More information about the ghc-commits mailing list