[commit: ghc] master: Use libpthread instead of libthr on FreeBSD (d8051c6)

git at git.haskell.org git at git.haskell.org
Mon Jul 24 23:36:41 UTC 2017


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

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

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

commit d8051c6cf08f02331f98fed7d5e88a95bd76e534
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


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

d8051c6cf08f02331f98fed7d5e88a95bd76e534
 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 d25b361..cc9bbb8 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -1446,11 +1446,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