diff options
author | Alec Theriault <alec.theriault@gmail.com> | 2018-12-04 00:21:48 +0000 |
---|---|---|
committer | Tamar Christina <tamar@zhox.com> | 2018-12-04 07:15:26 +0000 |
commit | 924026e0405396a3f559f163e829b88f30cca49e (patch) | |
tree | ce1427ed6b4b6edf473a5a25545de22e2d1d1469 /hadrian/src/Rules | |
parent | 6090002e19d5c888c2eda0ce06dd84e3c46aa0c9 (diff) | |
download | haskell-924026e0405396a3f559f163e829b88f30cca49e.tar.gz |
Hadrian: include 'findPtr' via find-ptr cabal flag
Summary:
This is the latest in the 'findPtr' saga. See
* 900c47f88784b91517c00be3e1087322e62f698e
* 561748cb507505bd5b7bd76bdc57796d896b62a2
for the previous attempts. The problem with re-using the 'debug'
cabal flag for the purpose of forcing inclusion of 'findPtr' occurs
when 'debug' is one of the RTS ways, but RTS is not being compiled
with '-DDEBUG':
* the 'debug' flag gets passed to cabal, signalling to build
'rts' with the debug flavour, but also forcing inclusion of
the 'findPtr'/'_findPtr' symbol
* since '-DDEBUG' isn't enabled, that symbol doesn't show up in
the libraries, so executable that depend on 'rts' (everything)
will end up always requiring 'findPtr'/'_findPtr' but 'rts' won'y
provide it!
The fix is simple: create a a new 'find-ptr' cabal-flag whose only
purpose is forcing '-Wl,-u,findPtr'/'-Wl,-u,_findPtr'. Then, enable that
flag when the RTS is being compiled with '-DDEBUG'
Test Plan: ./hadrian/build.sh -c # on mac
Reviewers: alpmestan, snowleopard, bgamari, erikd, simonmar, Phyx
Reviewed By: alpmestan, snowleopard, Phyx
Subscribers: Phyx, rwbarton, carter
GHC Trac Issues: #15956
Differential Revision: https://phabricator.haskell.org/D5404
Diffstat (limited to 'hadrian/src/Rules')
-rw-r--r-- | hadrian/src/Rules/Test.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/hadrian/src/Rules/Test.hs b/hadrian/src/Rules/Test.hs index 9a314dc25b..b72c1b964b 100644 --- a/hadrian/src/Rules/Test.hs +++ b/hadrian/src/Rules/Test.hs @@ -26,13 +26,13 @@ testRules :: Rules () testRules = do root <- buildRootRules - -- | Using program shipped with testsuite to generate ghcconfig file. + -- Using program shipped with testsuite to generate ghcconfig file. root -/- ghcConfigProgPath ~> do ghc <- builderPath $ Ghc CompileHs Stage0 createDirectory $ takeDirectory (root -/- ghcConfigProgPath) cmd ghc [ghcConfigHsPath, "-o" , root -/- ghcConfigProgPath] - -- | TODO : Use input test compiler and not just stage2 compiler. + -- TODO : Use input test compiler and not just stage2 compiler. root -/- ghcConfigPath ~> do ghcPath <- needFile Stage1 ghc need [root -/- ghcConfigProgPath] |