]> git.proxmox.com Git - mirror_edk2.git/commit
BaseTools: Add the missing -pie link option in GCC tool chain
authorLiming Gao <liming.gao@intel.com>
Wed, 23 Aug 2017 08:04:04 +0000 (16:04 +0800)
committerLiming Gao <liming.gao@intel.com>
Fri, 25 Aug 2017 03:19:56 +0000 (11:19 +0800)
commit2f7f1e73c10f9057be27ec6ffe92aaf8084d176f
treea5f0459b8b4db973a243594230180acc13109074
parentae9e4650cdf8a7e6790f74e54a9276700dd9d894
BaseTools: Add the missing -pie link option in GCC tool chain

https://bugzilla.tianocore.org/show_bug.cgi?id=671
GCC tool chain uses -fpie in CC_FLAGS. So, add -pie in DLINK_FLAGS.
More discussion in
https://lists.01.org/pipermail/edk2-devel/2017-August/013508.html

3.13 Options for Linking
========================
'-pie'
     Produce a position independent executable on targets that support
     it.  For predictable results, you must also specify the same set
     of options used for compilation ('-fpie', '-fPIE', or model
     suboptions) when you specify this linker option.

3.18 Options for Code Generation Conventions
============================================
'-fpie'
'-fPIE'
     These options are similar to '-fpic' and '-fPIC', but generated
     position independent code can be only linked into executables.
     Usually these options are used when '-pie' GCC option is used
     during linking.
     '-fpie' and '-fPIE' both define the macros '__pie__' and
     '__PIE__'. The macros have the value 1 for '-fpie' and 2 for
     '-fPIE'.

Contributed-under: TianoCore Contribution Agreement 1.1
Signed-off-by: Liming Gao <liming.gao@intel.com>
Reviewed-by: Yonghong Zhu <yonghong.zhu@intel.com>
Tested-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
BaseTools/Conf/tools_def.template