diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-07-17 23:20:10 +0200 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2016-08-02 10:54:11 +0200 |
commit | 4a8466d4babab43ee6ee46e37c2abb8248661ad5 (patch) | |
tree | 8eeda24126cc2b3e027a9cc595b062f09f92ca96 /MdePkg/Include | |
parent | 7fd5d619806df5e5b9bdbd0cfe14580040ea3615 (diff) | |
download | edk2-4a8466d4babab43ee6ee46e37c2abb8248661ad5.tar.gz edk2-4a8466d4babab43ee6ee46e37c2abb8248661ad5.tar.bz2 edk2-4a8466d4babab43ee6ee46e37c2abb8248661ad5.zip |
BaseTools GCC: introduce GCC5 toolchain to support GCC v5.x in LTO mode
This adds support for GCC 5.x in LTO mode for IA32, X64, ARM and
AARCH64. Due to the fact that the GCC project switched to a new
numbering scheme where the first digit is now incremented for every
major release, the new toolchain is simply called 'GCC5', and is
intended to support all GCC v5.x releases.
Since IA32 and X64 enable compiler optimizations (-Os) for both DEBUG
and RELEASE builds, LTO support is equally enabled for both targets.
On ARM and AARCH64, DEBUG builds are not optimized, and so the LTO
optimizations are only enabled for RELEASE.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'MdePkg/Include')
-rw-r--r-- | MdePkg/Include/X64/ProcessorBind.h | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/MdePkg/Include/X64/ProcessorBind.h b/MdePkg/Include/X64/ProcessorBind.h index 666cc8e8bd..ffcf2b0344 100644 --- a/MdePkg/Include/X64/ProcessorBind.h +++ b/MdePkg/Include/X64/ProcessorBind.h @@ -27,13 +27,17 @@ #pragma pack()
#endif
-#if defined(__GNUC__) && defined(__pic__)
+#if defined(__GNUC__) && defined(__pic__) && !defined(USING_LTO)
//
// Mark all symbol declarations and references as hidden, meaning they will
// not be subject to symbol preemption. This allows the compiler to refer to
// symbols directly using relative references rather than via the GOT, which
// contains absolute symbol addresses that are subject to runtime relocation.
//
+// The LTO linker will not emit GOT based relocations when all symbol
+// references can be resolved locally, and so there is no need to set the
+// pragma in that case (and doing so will cause other issues).
+//
#pragma GCC visibility push (hidden)
#endif
|