diff options
author | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-09-24 23:32:03 +0200 |
---|---|---|
committer | Krzysztof Gogolewski <krzysztof.gogolewski@tweag.io> | 2020-10-12 14:22:35 +0200 |
commit | 447798994126db7d5fe47be5dc3f3a6796208edb (patch) | |
tree | 5844ba695c99cdc90d7a19e1d524540d940d291e | |
parent | aff164bc30694dd20ba9ab0b51249f24804a1e89 (diff) | |
download | haskell-447798994126db7d5fe47be5dc3f3a6796208edb.tar.gz |
Add a flag to indicate that gcc supports -no-pie
Fixes #17919.
(cherry picked from commit e48cab2a57f2342891f985bcb44817e17e985275)
-rw-r--r-- | compiler/GHC/Driver/Session.hs | 2 | ||||
-rw-r--r-- | docs/users_guide/phases.rst | 14 |
2 files changed, 16 insertions, 0 deletions
diff --git a/compiler/GHC/Driver/Session.hs b/compiler/GHC/Driver/Session.hs index 9bc9b24329..baee859f26 100644 --- a/compiler/GHC/Driver/Session.hs +++ b/compiler/GHC/Driver/Session.hs @@ -2375,6 +2375,8 @@ dynamic_flags_deps = [ -- (see #15319) toolSettings_ccSupportsNoPie = False } + , make_ord_flag defFlag "pgmc-supports-no-pie" + $ noArg $ alterToolSettings $ \s -> s { toolSettings_ccSupportsNoPie = True } , make_ord_flag defFlag "pgms" (HasArg (\_ -> addWarn "Object splitting was removed in GHC 8.8")) , make_ord_flag defFlag "pgma" diff --git a/docs/users_guide/phases.rst b/docs/users_guide/phases.rst index 3c94a39733..32a26a0fa3 100644 --- a/docs/users_guide/phases.rst +++ b/docs/users_guide/phases.rst @@ -162,6 +162,20 @@ the following flags: Pass ⟨option⟩ to the C compiler. +.. ghc-flag:: -pgmc-supports-no-pie + :shortdesc: Indicate that the C compiler supports ``-no-pie`` + :type: dynamic + :category: phase-options + + When ``-pgmc`` is used, GHC by default will never pass the ``-no-pie`` + command line flag. The rationale is that it is not known whether the + specified compiler will support it. This flag can be used to indicate + that ``-no-pie`` is supported. It has to be passed after ``-pgmc``. + + This flag is not neccessary when ``-pgmc`` is not used, since GHC + remembers whether the default C compiler supports ``-no-pie`` in + an internal settings file. + .. ghc-flag:: -optcxx ⟨option⟩ :shortdesc: pass ⟨option⟩ to the C++ compiler :type: dynamic |