summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Pickering <matthewtpickering@gmail.com>2022-04-28 15:46:43 +0100
committerMarge Bot <ben+marge-bot@smart-cactus.org>2022-06-01 22:27:10 -0400
commit468f919b1bd27d8a58a789a6bb1be4295097388c (patch)
tree20259b0d37ee2ec7a588207561089bf346fda8ed
parent5433a35e28e2487827b88f2396865c29ecee0833 (diff)
downloadhaskell-468f919b1bd27d8a58a789a6bb1be4295097388c.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.
-rw-r--r--compiler/GHC/Driver/Session.hs17
-rw-r--r--docs/users_guide/phases.rst2
-rw-r--r--testsuite/tests/rts/all.T5
3 files changed, 13 insertions, 11 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs
index f765bb44ce..e200bd46bb 100644
--- a/compiler/GHC/Driver/Session.hs
+++ b/compiler/GHC/Driver/Session.hs
@@ -2121,12 +2121,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.
@@ -3498,7 +3492,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
@@ -3787,7 +3787,8 @@ defaultFlags settings
Opt_SimplPreInlining,
Opt_VersionMacros,
Opt_RPath,
- Opt_DumpWithWays
+ Opt_DumpWithWays,
+ Opt_CompactUnwind
]
++ [f | (ns,f) <- optLevelFlags, 0 `elem` ns]
diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst
index b784fa7662..fb635531e3 100644
--- a/docs/users_guide/phases.rst
+++ b/docs/users_guide/phases.rst
@@ -1330,6 +1330,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
diff --git a/testsuite/tests/rts/all.T b/testsuite/tests/rts/all.T
index d907ceff62..0c541dd480 100644
--- a/testsuite/tests/rts/all.T
+++ b/testsuite/tests/rts/all.T
@@ -473,9 +473,8 @@ test('keep-cafs',
# Test proper functioning of C++ exceptions within a C++ program.
# On darwin, this requires -fcompact-unwind.
-# When -fcompact-unwind becomes default, generalize test to all platforms.
-test('T11829', unless(opsys('darwin'), skip), compile_and_run,
- ['T11829_c.cpp -l{} -fcompact-unwind'.format(config.stdcxx_impl)])
+test('T11829', [ check_errmsg("This is a test") ], compile_and_run,
+ ['T11829_c.cpp -l{}'.format(config.stdcxx_impl)])
test('T16514', normal, compile_and_run, ['T16514_c.c'])
test('test-zeroongc', extra_run_opts('-DZ'), compile_and_run, ['-debug'])