|
| 1 | +diff --git a/hadrian/cfg/system.config.in b/hadrian/cfg/system.config.in |
| 2 | +index e8e6076f9a..e748ca514d 100644 |
| 3 | +--- a/hadrian/cfg/system.config.in |
| 4 | ++++ b/hadrian/cfg/system.config.in |
| 5 | +@@ -13,6 +13,7 @@ cc = @CC@ |
| 6 | + happy = @HappyCmd@ |
| 7 | + make = @MakeCmd@ |
| 8 | + objdump = @ObjdumpCmd@ |
| 9 | ++strip = @StripCmd@ |
| 10 | + sphinx-build = @SPHINXBUILD@ |
| 11 | + system-ghc = @WithGhc@ |
| 12 | + system-ghc-pkg = @GhcPkgCmd@ |
| 13 | +diff --git a/hadrian/src/Oracles/Setting.hs b/hadrian/src/Oracles/Setting.hs |
| 14 | +index b20b023173..881c122885 100644 |
| 15 | +--- a/hadrian/src/Oracles/Setting.hs |
| 16 | ++++ b/hadrian/src/Oracles/Setting.hs |
| 17 | +@@ -69,6 +69,7 @@ data Setting = CursesIncludeDir |
| 18 | + | ProjectPatchLevel |
| 19 | + | ProjectPatchLevel1 |
| 20 | + | ProjectPatchLevel2 |
| 21 | ++ | Strip |
| 22 | + | SystemGhc |
| 23 | + | TargetPlatformFull |
| 24 | + | BourneShell |
| 25 | +@@ -125,6 +126,7 @@ setting key = lookupSystemConfig $ case key of |
| 26 | + ProjectPatchLevel -> "project-patch-level" |
| 27 | + ProjectPatchLevel1 -> "project-patch-level1" |
| 28 | + ProjectPatchLevel2 -> "project-patch-level2" |
| 29 | ++ Strip -> "strip" |
| 30 | + SystemGhc -> "system-ghc" |
| 31 | + TargetPlatformFull -> "target-platform-full" |
| 32 | + BourneShell -> "bourne-shell" |
| 33 | +diff --git a/hadrian/src/Settings/Builders/Cabal.hs b/hadrian/src/Settings/Builders/Cabal.hs |
| 34 | +index 3e83bb5634..241f8a51ef 100644 |
| 35 | +--- a/hadrian/src/Settings/Builders/Cabal.hs |
| 36 | ++++ b/hadrian/src/Settings/Builders/Cabal.hs |
| 37 | +@@ -84,15 +84,11 @@ cabalSetupArgs = builder (Cabal Setup) ? do |
| 38 | + commonCabalArgs :: Stage -> Args |
| 39 | + commonCabalArgs stage = do |
| 40 | + pkg <- getPackage |
| 41 | ++ strip <- getSetting Strip |
| 42 | + package_id <- expr $ pkgUnitId stage pkg |
| 43 | + let prefix = "${pkgroot}" ++ (if windowsHost then "" else "/..") |
| 44 | +- mconcat [ -- Don't strip libraries when cross compiling. |
| 45 | +- -- TODO: We need to set @--with-strip=(stripCmdPath :: Action FilePath)@, |
| 46 | +- -- and if it's @:@ disable stripping as well. As it is now, I believe |
| 47 | +- -- we might have issues with stripping on Windows, as I can't see a |
| 48 | +- -- consumer of 'stripCmdPath'. |
| 49 | +- -- TODO: See https://github.com/snowleopard/hadrian/issues/549. |
| 50 | +- flag CrossCompiling ? pure [ "--disable-executable-stripping" |
| 51 | ++ mconcat [ notStage0 ? strip /= "" ? pure [ "--with-strip=" ++ strip ] |
| 52 | ++ , flag CrossCompiling ? pure [ "--disable-executable-stripping" |
| 53 | + , "--disable-library-stripping" ] |
| 54 | + -- We don't want to strip the debug RTS |
| 55 | + , S.package rts ? pure [ "--disable-executable-stripping" |
0 commit comments