FYI I am adding the below patch to my GCC consolidation series.
-------------8<--------------- In GCC 4.7, a feature was added to the ARM backend that allows unaligned loads and stores to be emitted. Since it is enabled by default on ARMv6 and later CPUs, and since such code is not suitable in our case (i.e., bare metal code), we must disable it by passing the -mno-unaligned-access option if we are using GCC 4.7 or later.
However, this particular feature and its enabling by default have been backported to version 4.6 by Linaro. Since the Linaro toolchains are widely used for ARM development, and also shipped by distros such as Ubuntu, we should disable the feature on version 4.6 as well. Unfortunately, since the upstream version does not support the feature, it also does not understand the -mno-unaligned-access option.
Considering the above, and the fact that the oldest supported toolchain for AARCH64 is 4.7 as well, let's just drop support for 4.6 altogether.
Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Ard Biesheuvel ard.biesheuvel@linaro.org --- BaseTools/Conf/tools_def.template | 30 -------------------- 1 file changed, 30 deletions(-)
diff --git a/BaseTools/Conf/tools_def.template b/BaseTools/Conf/tools_def.template index fabfe7436167..5707aafec8cd 100644 --- a/BaseTools/Conf/tools_def.template +++ b/BaseTools/Conf/tools_def.template @@ -4160,36 +4160,6 @@ DEFINE GCC_AARCH64_RC_FLAGS = -I binary -O elf64-littleaarch64 -B aarch64 *_GCC46_X64_OBJCOPY_FLAGS = *_GCC46_X64_NASM_FLAGS = -f elf64
-################## -# GCC46 ARM definitions -################## -*_GCC46_ARM_OBJCOPY_PATH = echo -*_GCC46_ARM_CC_PATH = ENV(GCC46_ARM_PREFIX)gcc -*_GCC46_ARM_SLINK_PATH = ENV(GCC46_ARM_PREFIX)ar -*_GCC46_ARM_DLINK_PATH = ENV(GCC46_ARM_PREFIX)ld -*_GCC46_ARM_ASLDLINK_PATH = ENV(GCC46_ARM_PREFIX)ld -*_GCC46_ARM_ASM_PATH = ENV(GCC46_ARM_PREFIX)gcc -*_GCC46_ARM_PP_PATH = ENV(GCC46_ARM_PREFIX)gcc -*_GCC46_ARM_VFRPP_PATH = ENV(GCC46_ARM_PREFIX)gcc -*_GCC46_ARM_ASLCC_PATH = ENV(GCC46_ARM_PREFIX)gcc -*_GCC46_ARM_ASLPP_PATH = ENV(GCC46_ARM_PREFIX)gcc -*_GCC46_ARM_RC_PATH = ENV(GCC46_ARM_PREFIX)objcopy - -*_GCC46_ARM_ARCHCC_FLAGS = -*_GCC46_ARM_PLATFORM_FLAGS = -march=armv7-a - -*_GCC46_ARM_ASLCC_FLAGS = DEF(GCC_ASLCC_FLAGS) -*_GCC46_ARM_ASLDLINK_FLAGS = DEF(GCC_ARM_ASLDLINK_FLAGS) -*_GCC46_ARM_ASM_FLAGS = DEF(GCC_ARM_ASM_FLAGS) -*_GCC46_ARM_DLINK_FLAGS = DEF(GCC_ARM_DLINK_FLAGS) -*_GCC46_ARM_PLATFORM_FLAGS = -march=armv7-a -*_GCC46_ARM_PP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_PP_FLAGS) -*_GCC46_ARM_RC_FLAGS = DEF(GCC_ARM_RC_FLAGS) -*_GCC46_ARM_VFRPP_FLAGS = $(ARCHCC_FLAGS) $(PLATFORM_FLAGS) DEF(GCC_VFRPP_FLAGS) - - DEBUG_GCC46_ARM_CC_FLAGS = DEF(GCC_ARM_CC_FLAGS) -O0 -RELEASE_GCC46_ARM_CC_FLAGS = DEF(GCC_ARM_CC_FLAGS) - #################################################################################### # # GCC 4.7 - This configuration is used to compile under Linux to produce