[commit: ghc] master: Enable subsections via symbols on iOS (58e68b3)
git at git.haskell.org
git at git.haskell.org
Tue Jan 10 19:22:12 UTC 2017
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/58e68b37e74fd226ef6be1d59785cb899e01dbd5/ghc
>---------------------------------------------------------------
commit 58e68b37e74fd226ef6be1d59785cb899e01dbd5
Author: Demi Obenour <demiobenour at gmail.com>
Date: Tue Jan 10 13:37:47 2017 -0500
Enable subsections via symbols on iOS
Test Plan: GHC CI
Reviewers: austin, bgamari
Reviewed By: bgamari
Subscribers: thomie
Differential Revision: https://phabricator.haskell.org/D2915
GHC Trac Issues: #11040, #13049
>---------------------------------------------------------------
58e68b37e74fd226ef6be1d59785cb899e01dbd5
compiler/main/DriverPipeline.hs | 2 +-
compiler/main/HscMain.hs | 4 ++--
compiler/utils/Platform.hs | 6 ++++++
3 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/compiler/main/DriverPipeline.hs b/compiler/main/DriverPipeline.hs
index a62233d..a54e05c 100644
--- a/compiler/main/DriverPipeline.hs
+++ b/compiler/main/DriverPipeline.hs
@@ -1794,7 +1794,7 @@ linkBinary' staticLink dflags o_files dep_packages = do
in ["-L" ++ l] ++ ["-Wl,-rpath", "-Wl," ++ libpath]
| otherwise = ["-L" ++ l]
- let dead_strip = if osMachOTarget (platformOS platform)
+ let dead_strip = if osSubsectionsViaSymbols (platformOS platform)
then ["-Wl,-dead_strip"]
else []
let lib_paths = libraryPaths dflags
diff --git a/compiler/main/HscMain.hs b/compiler/main/HscMain.hs
index 12e8a1d..2fc7341 100644
--- a/compiler/main/HscMain.hs
+++ b/compiler/main/HscMain.hs
@@ -137,7 +137,7 @@ import Maybes
import DynFlags
import ErrUtils
-import Platform ( platformOS, OS(OSDarwin) )
+import Platform ( platformOS, osSubsectionsViaSymbols )
import Outputable
import NameEnv
@@ -1394,7 +1394,7 @@ doCodeGen hsc_env this_mod data_tycons
let
pipeline_stream
| gopt Opt_SplitObjs dflags || gopt Opt_SplitSections dflags ||
- platformOS (targetPlatform dflags) == OSDarwin
+ osSubsectionsViaSymbols (platformOS (targetPlatform dflags))
= {-# SCC "cmmPipeline" #-}
let run_pipeline us cmmgroup = do
let (topSRT', us') = initUs us emptySRT
diff --git a/compiler/utils/Platform.hs b/compiler/utils/Platform.hs
index 600ed80..86c70a9 100644
--- a/compiler/utils/Platform.hs
+++ b/compiler/utils/Platform.hs
@@ -14,6 +14,7 @@ module Platform (
isARM,
osElfTarget,
osMachOTarget,
+ osSubsectionsViaSymbols,
platformUsesFrameworks,
platformBinariesAreStaticLibs,
)
@@ -161,6 +162,11 @@ osBinariesAreStaticLibs :: OS -> Bool
osBinariesAreStaticLibs OSiOS = True
osBinariesAreStaticLibs _ = False
+osSubsectionsViaSymbols :: OS -> Bool
+osSubsectionsViaSymbols OSDarwin = True
+osSubsectionsViaSymbols OSiOS = True
+osSubsectionsViaSymbols _ = False
+
platformBinariesAreStaticLibs :: Platform -> Bool
platformBinariesAreStaticLibs = osBinariesAreStaticLibs . platformOS
More information about the ghc-commits
mailing list