summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-04-28 15:46:43 +0100
committerBen Gamari <ben@smart-cactus.org>2022-07-14 23:02:07 -0400
commit805a4b1fe0b6679d27089766d50bcaaed3110864 (patch)
tree879fd469eaf7fe6205698a77efa8d323bc47978c
parent4b5812a07f4f5c5d1e388a3fe685327317e5c50e (diff)
downloadhaskell-805a4b1fe0b6679d27089766d50bcaaed3110864.tar.gz
Make -fcompact-unwind the default
This is a follow-up to !7247 (closed) making the inclusion of compact unwinding sections the default. Also a slight refactoring/simplification of the flag handling to add -fno-compact-unwind. (cherry picked from commit 468f919b1bd27d8a58a789a6bb1be4295097388c)
-rw-r--r--compiler/GHC/Driver/Session.hs17
-rw-r--r--docs/users_guide/phases.rst2
2 files changed, 11 insertions, 8 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index f4902df612..0ef6eb3ab6 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -2144,12 +2144,6 @@ dynamic_flags_deps = [
(NoArg (setGeneralFlag Opt_SingleLibFolder))
, make_ord_flag defGhcFlag "pie" (NoArg (setGeneralFlag Opt_PICExecutable))
, make_ord_flag defGhcFlag "no-pie" (NoArg (unSetGeneralFlag Opt_PICExecutable))
- , make_ord_flag defGhcFlag "fcompact-unwind"
- (noArgM (\dflags -> do
- if platformOS (targetPlatform dflags) == OSDarwin
- then return (gopt_set dflags Opt_CompactUnwind)
- else do addWarn "-compact-unwind is only implemented by the darwin platform. Ignoring."
- return dflags))
------- Specific phases --------------------------------------------
-- need to appear before -pgmL to be parsed as LLVM flags.
@@ -3523,7 +3517,13 @@ fFlagsDeps = [
flagSpec "show-loaded-modules" Opt_ShowLoadedModules,
flagSpec "whole-archive-hs-libs" Opt_WholeArchiveHsLibs,
flagSpec "keep-cafs" Opt_KeepCAFs,
- flagSpec "link-rts" Opt_LinkRts
+ flagSpec "link-rts" Opt_LinkRts,
+ flagSpec' "compact-unwind" Opt_CompactUnwind
+ (\turn_on -> updM (\dflags -> do
+ unless (platformOS (targetPlatform dflags) == OSDarwin && turn_on)
+ (addWarn "-compact-unwind is only implemented by the darwin platform. Ignoring.")
+ return dflags))
+
]
++ fHoleFlags
@@ -3812,7 +3812,8 @@ defaultFlags settings
Opt_SharedImplib,
Opt_SimplPreInlining,
Opt_VersionMacros,
- Opt_RPath
+ Opt_RPath,
+ Opt_CompactUnwind
]
++ [f | (ns,f) <- optLevelFlags, 0 `elem` ns]
diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst
index 43e7234aa0..222ea7170f 100644
--- a/docs/users_guide/phases.rst
+++ b/docs/users_guide/phases.rst
@@ -1337,6 +1337,8 @@ for example).
:type: dynamic
:category: linking
+ :default: on
+
:since: 9.4.1
This instructs the linker to produce an executable that supports Apple's