diff options
author | Ben Gamari <bgamari.foss@gmail.com> | 2017-08-22 11:41:47 -0400 |
---|---|---|
committer | Ben Gamari <ben@smart-cactus.org> | 2017-08-22 18:01:05 -0400 |
commit | 3625728a0e3a9b56c2b85ae7ea8bcabdd83ece6a (patch) | |
tree | c8d0ff7e921436d011e70018c5cea974dcf67f23 /compiler/main/SysTools.hs | |
parent | dbaa9a237b6d9771c0e9bde0e50fd2134c2f4dd0 (diff) | |
download | haskell-3625728a0e3a9b56c2b85ae7ea8bcabdd83ece6a.tar.gz |
Add support for producing position-independent executables
Previously due to #12759 we disabled PIE support entirely. However, this
breaks the user's ability to produce PIEs. Add an explicit flag, -fPIE,
allowing the user to build PIEs.
Test Plan: Validate
Reviewers: rwbarton, austin, simonmar
Subscribers: trommler, simonmar, trofi, jrtc27, thomie
GHC Trac Issues: #12759, #13702
Differential Revision: https://phabricator.haskell.org/D3589
Diffstat (limited to 'compiler/main/SysTools.hs')
-rw-r--r-- | compiler/main/SysTools.hs | 15 |
1 files changed, 1 insertions, 14 deletions
diff --git a/compiler/main/SysTools.hs b/compiler/main/SysTools.hs index faf6f11736..57d77a3a13 100644 --- a/compiler/main/SysTools.hs +++ b/compiler/main/SysTools.hs @@ -8,7 +8,7 @@ ----------------------------------------------------------------------------- -} -{-# LANGUAGE CPP, ScopedTypeVariables #-} +{-# LANGUAGE CPP, MultiWayIf, ScopedTypeVariables #-} module SysTools ( -- Initialisation @@ -1372,15 +1372,6 @@ linesPlatform xs = #endif -{- -Note [No PIE eating while linking] -~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -As of 2016 some Linux distributions (e.g. Debian) have started enabling -pie by -default in their gcc builds. This is incompatible with -r as it implies that we -are producing an executable. Consequently, we must manually pass -no-pie to gcc -when joining object files or linking dynamic libraries. See #12759. --} - linkDynLib :: DynFlags -> [String] -> [InstalledUnitId] -> IO () linkDynLib dflags0 o_files dep_packages = do @@ -1547,10 +1538,6 @@ linkDynLib dflags0 o_files dep_packages ++ [ Option "-o" , FileOption "" output_fn ] - -- See Note [No PIE eating when linking] - ++ (if sGccSupportsNoPie (settings dflags) - then [Option "-no-pie"] - else []) ++ map Option o_files ++ [ Option "-shared" ] ++ map Option bsymbolicFlag |