[commit: ghc] ghc-8.2: Use libpthread instead of libthr on FreeBSD (fd201db)

git at git.haskell.org git at git.haskell.org
Mon Oct 2 11:27:31 UTC 2017


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

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

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

commit fd201db6ed7a02474bfcfbfe6806d11926e29f9b
Author: Ben Gamari <bgamari.foss at gmail.com>
Date:   Mon Jul 24 19:02:56 2017 -0400

    Use libpthread instead of libthr on FreeBSD
    
    Since #847 we have used libthr due to reported hangs with FreeBSD's
    KSE-based M:N pthread implementation. However, this was nearly 12 years
    ago and today libpthread seems to work fine. Moreover, adding -lthr to
    the linker flags break when used in conjunction with -r when gold is
    used (since -l and -r are incompatible although BFD ld doesn't
    complain).
    
    Test Plan: Validate on FreeBSD
    
    Reviewers: kgardas, austin
    
    Subscribers: rwbarton, thomie
    
    GHC Trac Issues: #847
    
    Differential Revision: https://phabricator.haskell.org/D3773
    
    (cherry picked from commit d8051c6cf08f02331f98fed7d5e88a95bd76e534)


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

fd201db6ed7a02474bfcfbfe6806d11926e29f9b
 compiler/main/DynFlags.hs | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 10bf671..1a7d3c7 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1436,11 +1436,7 @@ wayOptl :: Platform -> Way -> [String]
 wayOptl _ (WayCustom {}) = []
 wayOptl platform WayThreaded =
         case platformOS platform of
-        -- FreeBSD's default threading library is the KSE-based M:N libpthread,
-        -- which GHC has some problems with.  It's currently not clear whether
-        -- the problems are our fault or theirs, but it seems that using the
-        -- alternative 1:1 threading library libthr works around it:
-        OSFreeBSD  -> ["-lthr"]
+        OSFreeBSD  -> ["-pthread"]
         OSOpenBSD  -> ["-pthread"]
         OSNetBSD   -> ["-pthread"]
         _          -> []



More information about the ghc-commits mailing list