[commit: ghc] ghc-7.10: always use -fPIC on OpenBSD/AMD64 platform (0cfee53)

git at git.haskell.org git at git.haskell.org
Tue Jul 21 11:58:48 UTC 2015


Repository : ssh://git@git.haskell.org/ghc

On branch  : ghc-7.10
Link       : http://ghc.haskell.org/trac/ghc/changeset/0cfee536e5261af873485e7150be4a4ac26cd0e3/ghc

>---------------------------------------------------------------

commit 0cfee536e5261af873485e7150be4a4ac26cd0e3
Author: Karel Gardas <karel.gardas at centrum.cz>
Date:   Tue Jul 7 18:35:09 2015 +0200

    always use -fPIC on OpenBSD/AMD64 platform
    
    Summary:
    This patch switches -fPIC on for every invocation of GHC
    on OpenBSD/AMD64 platform. The reason is OpenBSD's support
    for PIE (PIC for executables) hence -fPIC is also needed
    for GHC compiled code.
    
    Fixes #10597
    
    Reviewers: austin
    
    Subscribers: thomie, bgamari
    
    Differential Revision: https://phabricator.haskell.org/D1027


>---------------------------------------------------------------

0cfee536e5261af873485e7150be4a4ac26cd0e3
 compiler/main/DynFlags.hs | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/compiler/main/DynFlags.hs b/compiler/main/DynFlags.hs
index 07cb23a..992e7da 100644
--- a/compiler/main/DynFlags.hs
+++ b/compiler/main/DynFlags.hs
@@ -3218,6 +3218,12 @@ default_PIC :: Platform -> [GeneralFlag]
 default_PIC platform =
   case (platformOS platform, platformArch platform) of
     (OSDarwin, ArchX86_64) -> [Opt_PIC]
+    (OSOpenBSD, ArchX86_64) -> [Opt_PIC] -- Due to PIE support in
+                                         -- OpenBSD since 5.3 release
+                                         -- (1 May 2013) we need to
+                                         -- always generate PIC. See
+                                         -- #10597 for more
+                                         -- information.
     _                      -> []
 
 impliedGFlags :: [(GeneralFlag, TurnOnFlag, GeneralFlag)]



More information about the ghc-commits mailing list