summaryrefslogtreecommitdiff
path: root/compiler/GHC/SysTools.hs
diff options
context:
space:
mode:
authorSylvain Henry <sylvain@haskus.fr>2020-10-15 12:02:17 +0200
committerMarge Bot <ben+marge-bot@smart-cactus.org>2020-10-17 22:04:02 -0400
commita91dcb669b3b221c51e8ba8bb85b7ae9806bc4ca (patch)
treea0fa29c621e5f571fd4d0af9ed04e80ab1d9524d /compiler/GHC/SysTools.hs
parent0b995759ae2ba2161097a1c43efc650ccbce0276 (diff)
downloadhaskell-a91dcb669b3b221c51e8ba8bb85b7ae9806bc4ca.tar.gz
Don't get host RTS ways via settings (#18651)
To correctly perform a linking hack for Windows we need to link with the RTS GHC is currently using. We used to query the RTS ways via the "settings" file but it is fragile (#18651). The hack hasn't been fixed to take into account all the ways (Tracing) and it makes linking of GHC with another RTS more difficult (we need to link with another RTS and to regenerate the settings file). So this patch uses the ways reported by the RTS itself (GHC.Platform.Ways.hostWays) instead of the "settings" file.
Diffstat (limited to 'compiler/GHC/SysTools.hs')
-rw-r--r--compiler/GHC/SysTools.hs14
1 files changed, 5 insertions, 9 deletions
diff --git a/compiler/GHC/SysTools.hs b/compiler/GHC/SysTools.hs
index 9e4a277957..ee1940c332 100644
--- a/compiler/GHC/SysTools.hs
+++ b/compiler/GHC/SysTools.hs
@@ -244,15 +244,11 @@ linkDynLib dflags0 o_files dep_packages
-- against libHSrts, then both end up getting loaded,
-- and things go wrong. We therefore link the libraries
-- with the same RTS flags that we link GHC with.
- dflags1 = if platformMisc_ghcThreaded $ platformMisc dflags0
- then addWay' WayThreaded dflags0
- else dflags0
- win_dflags = if platformMisc_ghcDebugged $ platformMisc dflags1
- then addWay' WayDebug dflags1
- else dflags1
-
- dflags | OSMinGW32 <- os = win_dflags
- | otherwise = dflags0
+ dflags | OSMinGW32 <- os
+ , hostWays `hasWay` WayDyn
+ = dflags0 { ways = hostWays }
+ | otherwise
+ = dflags0
verbFlags = getVerbFlags dflags
o_file = outputFile dflags