Add support for producing position-independent executables
authorBen Gamari <bgamari.foss@gmail.com>
Tue, 22 Aug 2017 15:41:47 +0000 (11:41 -0400)
committerBen Gamari <ben@smart-cactus.org>
Tue, 22 Aug 2017 22:01:05 +0000 (18:01 -0400)
commit3625728a0e3a9b56c2b85ae7ea8bcabdd83ece6a
treec8d0ff7e921436d011e70018c5cea974dcf67f23
parentdbaa9a237b6d9771c0e9bde0e50fd2134c2f4dd0
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
17 files changed:
compiler/cmm/CmmPipeline.hs
compiler/codeGen/StgCmmCon.hs
compiler/main/DriverPipeline.hs
compiler/main/DynFlags.hs
compiler/main/SysTools.hs
compiler/nativeGen/AsmCodeGen.hs
compiler/nativeGen/PIC.hs
compiler/nativeGen/PPC/CodeGen.hs
compiler/nativeGen/SPARC/CodeGen.hs
compiler/nativeGen/X86/CodeGen.hs
docs/users_guide/phases.rst
docs/users_guide/shared_libs.rst
testsuite/tests/dynlibs/Makefile
testsuite/tests/dynlibs/T13702.hs [new file with mode: 0644]
testsuite/tests/dynlibs/T13702.stdout [new file with mode: 0644]
testsuite/tests/dynlibs/T13702a.hs [new file with mode: 0644]
testsuite/tests/dynlibs/all.T