diff options
author | Moritz Angermann <moritz.angermann@gmail.com> | 2017-05-11 18:17:31 +0800 |
---|---|---|
committer | Moritz Angermann <moritz.angermann@gmail.com> | 2017-05-11 18:31:45 +0800 |
commit | c0872bf99ff891e440f118bf9eea20b980c2cfca (patch) | |
tree | e2e3cb1566eb2ae3fb0a3e012b070ea35548afe2 | |
parent | 1345c7cc42c45e63ab1726a8fd24a7e4d4222467 (diff) | |
download | haskell-c0872bf99ff891e440f118bf9eea20b980c2cfca.tar.gz |
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
-rw-r--r-- | compiler/main/DriverPipeline.hs | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs index 474fd8c344..07e5eddcc4 100644 --- a/compiler/main/DriverPipeline.hs +++ b/compiler/main/DriverPipeline.hs @@ -1887,22 +1887,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 |