hadrian: Build debug rts with -O0 -g3 and disable rts stripping
authorMatthew Pickering <matthewtpickering@gmail.com>
Sun, 7 Jul 2019 09:17:51 +0000 (10:17 +0100)
committerMarge Bot <ben+marge-bot@smart-cactus.org>
Sun, 14 Jul 2019 05:19:58 +0000 (01:19 -0400)
Fixes #16920

hadrian/src/Settings/Builders/Cabal.hs
hadrian/src/Settings/Packages.hs

index 759c0fd..bf6322f 100644 (file)
@@ -8,6 +8,7 @@ import Context
 import Flavour
 import Packages
 import Settings.Builders.Common
+import qualified Settings.Builders.Common as S
 
 cabalBuilderArgs :: Args
 cabalBuilderArgs = builder (Cabal Setup) ? do
@@ -26,6 +27,9 @@ cabalBuilderArgs = builder (Cabal Setup) ? do
             -- TODO: See https://github.com/snowleopard/hadrian/issues/549.
             , flag CrossCompiling ? pure [ "--disable-executable-stripping"
                                          , "--disable-library-stripping" ]
+            -- We don't want to strip the debug RTS
+            , S.package rts ? pure [ "--disable-executable-stripping"
+                                  , "--disable-library-stripping" ]
             , arg "--cabal-file"
             , arg $ pkgCabalFile pkg
             , arg "--distdir"
index e120e79..804aeb0 100644 (file)
@@ -225,7 +225,8 @@ rtsPackageArgs = package rts ? do
 
           , Debug     `wayUnit` way          ? pure [ "-DDEBUG"
                                                     , "-fno-omit-frame-pointer"
-                                                    , "-g" ]
+                                                    , "-g3"
+                                                    , "-O0" ]
           , way `elem` [debug, debugDynamic] ? arg "-DTICKY_TICKY"
           , Profiling `wayUnit` way          ? arg "-DPROFILING"
           , Threaded  `wayUnit` way          ? arg "-DTHREADED_RTS"