diff options
author | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-07-13 13:44:27 +0100 |
---|---|---|
committer | Ard Biesheuvel <ard.biesheuvel@linaro.org> | 2017-07-14 17:28:49 +0100 |
commit | 0df6c8c157af9510e21bff7bb8aa1f461d04707b (patch) | |
tree | cff79a3022e9d8f0994f026a4db632c90aad187b /BaseTools/Conf/tools_def.template | |
parent | 6d73863b5464f382af2a17b2c2ec1abc550d0af5 (diff) | |
download | edk2-0df6c8c157af9510e21bff7bb8aa1f461d04707b.tar.gz edk2-0df6c8c157af9510e21bff7bb8aa1f461d04707b.tar.bz2 edk2-0df6c8c157af9510e21bff7bb8aa1f461d04707b.zip |
BaseTools/tools_def AARCH64: avoid SIMD registers in XIP code
XIP code may execute with the MMU off, in which case all memory accesses
should be strictly aligned to their size. Some versions of GCC violate
this restriction even when -mstrict-align is passed, when performing
loads and stores that involve SIMD registers. This is clearly a bug in
the compiler, but we can easily work around it by avoiding SIMD registers
altogether when building code that may execute in such a context. So add
-mgeneral-regs-only to the AARCH64 XIP CC flags.
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Leif Lindholm <leif.lindholm@linaro.org>
Diffstat (limited to 'BaseTools/Conf/tools_def.template')
-rwxr-xr-x | BaseTools/Conf/tools_def.template | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index 128da5131d..cdc9df44d9 100755 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -4342,7 +4342,7 @@ DEFINE GCC_IPF_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -minline-int-divide-m DEFINE GCC_ARM_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -mabi=aapcs -fno-short-enums -funsigned-char -ffunction-sections -fdata-sections -fomit-frame-pointer -Wno-address -mthumb -mfloat-abi=soft -fno-pic -fno-pie
DEFINE GCC_ARM_CC_XIPFLAGS = -mno-unaligned-access
DEFINE GCC_AARCH64_CC_FLAGS = DEF(GCC_ALL_CC_FLAGS) -mlittle-endian -fno-short-enums -fverbose-asm -funsigned-char -ffunction-sections -fdata-sections -Wno-address -fno-asynchronous-unwind-tables -fno-pic -fno-pie -ffixed-x18
-DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align
+DEFINE GCC_AARCH64_CC_XIPFLAGS = -mstrict-align -mgeneral-regs-only
DEFINE GCC_DLINK_FLAGS_COMMON = -nostdlib --pie
DEFINE GCC_DLINK2_FLAGS_COMMON = -Wl,--script=$(EDK_TOOLS_PATH)/Scripts/GccBase.lds
DEFINE GCC_IA32_X64_DLINK_COMMON = DEF(GCC_DLINK_FLAGS_COMMON) --gc-sections
|