[commit: ghc] ghc-8.2: Use NEED_PTHREAD_LIB (627dda2)

git at git.haskell.org git at git.haskell.org
Sun Dec 23 18:46:59 UTC 2018


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

On branch  : ghc-8.2
Link       : http://ghc.haskell.org/trac/ghc/changeset/627dda2a2995d640bf85b970e0f3a619036b84c4/ghc

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

commit 627dda2a2995d640bf85b970e0f3a619036b84c4
Author: Moritz Angermann <moritz.angermann at gmail.com>
Date:   Thu May 11 18:17:31 2017 +0800

    Use NEED_PTHREAD_LIB
    
    we do the same for the rts already. And using the configure script should
    be more robust than hand-picking the OSs here.
    
    Reviewers: austin, bgamari
    
    Reviewed By: bgamari
    
    Subscribers: rwbarton, thomie
    
    Differential Revision: https://phabricator.haskell.org/D3563
    
    (cherry picked from commit c0872bf99ff891e440f118bf9eea20b980c2cfca)


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

627dda2a2995d640bf85b970e0f3a619036b84c4
 compiler/main/DriverPipeline.hs | 19 ++++++++-----------
 1 file changed, 8 insertions(+), 11 deletions(-)

diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index f1038cf..b301ece 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1892,22 +1892,19 @@ linkBinary' staticLink dflags o_files dep_packages = do
     -- Here are some libs that need to be linked at the *end* of
     -- the command line, because they contain symbols that are referred to
     -- by the RTS.  We can't therefore use the ordinary way opts for these.
-    let
-        debug_opts | WayDebug `elem` ways dflags = [
+    let debug_opts | WayDebug `elem` ways dflags = [
 #if defined(HAVE_LIBBFD)
                         "-lbfd", "-liberty"
 #endif
                          ]
-                   | otherwise            = []
+                   | otherwise                   = []
 
-    let thread_opts
-         | WayThreaded `elem` ways dflags =
-            let os = platformOS (targetPlatform dflags)
-            in if os `elem` [OSMinGW32, OSFreeBSD, OSOpenBSD, OSAndroid,
-                             OSNetBSD, OSHaiku, OSQNXNTO, OSiOS, OSDarwin]
-               then []
-               else ["-lpthread"]
-         | otherwise               = []
+        thread_opts | WayThreaded `elem` ways dflags = [
+#if NEED_PTHREAD_LIB
+                        "-lpthread"
+#endif
+                        ]
+                    | otherwise                      = []
 
     rc_objs <- maybeCreateManifest dflags output_fn
 



More information about the ghc-commits mailing list