Commit 58e68b37 authored by dobenour's avatar dobenour Committed by Ben Gamari
Browse files

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
parent 8a76d32e
...@@ -1794,7 +1794,7 @@ linkBinary' staticLink dflags o_files dep_packages = do ...@@ -1794,7 +1794,7 @@ linkBinary' staticLink dflags o_files dep_packages = do
in ["-L" ++ l] ++ ["-Wl,-rpath", "-Wl," ++ libpath] in ["-L" ++ l] ++ ["-Wl,-rpath", "-Wl," ++ libpath]
| otherwise = ["-L" ++ l] | otherwise = ["-L" ++ l]
let dead_strip = if osMachOTarget (platformOS platform) let dead_strip = if osSubsectionsViaSymbols (platformOS platform)
then ["-Wl,-dead_strip"] then ["-Wl,-dead_strip"]
else [] else []
let lib_paths = libraryPaths dflags let lib_paths = libraryPaths dflags
......
...@@ -137,7 +137,7 @@ import Maybes ...@@ -137,7 +137,7 @@ import Maybes
import DynFlags import DynFlags
import ErrUtils import ErrUtils
import Platform ( platformOS, OS(OSDarwin) ) import Platform ( platformOS, osSubsectionsViaSymbols )
import Outputable import Outputable
import NameEnv import NameEnv
...@@ -1394,7 +1394,7 @@ doCodeGen hsc_env this_mod data_tycons ...@@ -1394,7 +1394,7 @@ doCodeGen hsc_env this_mod data_tycons
let let
pipeline_stream pipeline_stream
| gopt Opt_SplitObjs dflags || gopt Opt_SplitSections dflags || | gopt Opt_SplitObjs dflags || gopt Opt_SplitSections dflags ||
platformOS (targetPlatform dflags) == OSDarwin osSubsectionsViaSymbols (platformOS (targetPlatform dflags))
= {-# SCC "cmmPipeline" #-} = {-# SCC "cmmPipeline" #-}
let run_pipeline us cmmgroup = do let run_pipeline us cmmgroup = do
let (topSRT', us') = initUs us emptySRT let (topSRT', us') = initUs us emptySRT
......
...@@ -14,6 +14,7 @@ module Platform ( ...@@ -14,6 +14,7 @@ module Platform (
isARM, isARM,
osElfTarget, osElfTarget,
osMachOTarget, osMachOTarget,
osSubsectionsViaSymbols,
platformUsesFrameworks, platformUsesFrameworks,
platformBinariesAreStaticLibs, platformBinariesAreStaticLibs,
) )
...@@ -161,6 +162,11 @@ osBinariesAreStaticLibs :: OS -> Bool ...@@ -161,6 +162,11 @@ osBinariesAreStaticLibs :: OS -> Bool
osBinariesAreStaticLibs OSiOS = True osBinariesAreStaticLibs OSiOS = True
osBinariesAreStaticLibs _ = False osBinariesAreStaticLibs _ = False
osSubsectionsViaSymbols :: OS -> Bool
osSubsectionsViaSymbols OSDarwin = True
osSubsectionsViaSymbols OSiOS = True
osSubsectionsViaSymbols _ = False
platformBinariesAreStaticLibs :: Platform -> Bool platformBinariesAreStaticLibs :: Platform -> Bool
platformBinariesAreStaticLibs = osBinariesAreStaticLibs . platformOS platformBinariesAreStaticLibs = osBinariesAreStaticLibs . platformOS
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment