summaryrefslogtreecommitdiff
path: root/compiler/main/DynFlags.hs
diff options
context:
space:
mode:
Diffstat (limited to 'compiler/main/DynFlags.hs')
-rw-r--r--compiler/main/DynFlags.hs15
1 files changed, 14 insertions, 1 deletions
diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index b8705603c7..39f4a0487f 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -391,6 +391,7 @@ data GeneralFlag
| Opt_EagerBlackHoling
| Opt_NoHsMain
| Opt_SplitObjs
+ | Opt_SplitSections
| Opt_StgStats
| Opt_HideAllPackages
| Opt_PrintBindResult
@@ -1283,7 +1284,10 @@ wayUnsetGeneralFlags _ WayDyn = [-- There's no point splitting objects
-- when we're going to be dynamically
-- linking. Plus it breaks compilation
-- on OSX x86.
- Opt_SplitObjs]
+ Opt_SplitObjs,
+ -- If splitobjs wasn't useful for this,
+ -- assume sections aren't either.
+ Opt_SplitSections]
wayUnsetGeneralFlags _ WayProf = []
wayUnsetGeneralFlags _ WayEventLog = []
@@ -2326,6 +2330,15 @@ dynamic_flags = [
then setGeneralFlag Opt_SplitObjs
else addWarn "ignoring -fsplit-objs"))
+ , defGhcFlag "split-sections"
+ (noArgM (\dflags -> do
+ if platformHasSubsectionsViaSymbols (targetPlatform dflags)
+ then do addErr $
+ "-split-sections is not useful on this platform " ++
+ "since it always uses subsections via symbols."
+ return dflags
+ else return (gopt_set dflags Opt_SplitSections)))
+
-------- ghc -M -----------------------------------------------------
, defGhcFlag "dep-suffix" (hasArg addDepSuffix)
, defGhcFlag "dep-makefile" (hasArg setDepMakefile)