Commit d8051c6c authored by Ben Gamari's avatar Ben Gamari Committed by Ben Gamari

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
parent 8a8cee73
......@@ -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"]
_ -> []
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment