From 8606b30d44e8c6d40213e0b00111e6247bfb077a Mon Sep 17 00:00:00 2001 From: Julius Werner Date: Fri, 16 Jan 2015 16:06:00 -0800 Subject: [PATCH] ARM: Remove -mno-unaligned-access We've decided that it is generally okay for coreboot to expect unaligned accesses to work. Trying to find all instances of unaligned access opportunities and working around them in software would be an unsustainable whack-a-mole contest. Instead, architectures and boards need to make sure they conform to this, which on ARM and ARM64 requires setting up paging early in the bootblock. Other architectures (x86, ARM64, MIPS) already generate code in this manner. ARM still had an -mno-unaligned-access flag hanging around that has been copied so many times its initial origin was lost in time (probably U-Boot). Let's remove it for consistency between architectures and to improve code generation. BRANCH=veyron BUG=None TEST=Booted Jerry and Blaze. Looked at the disassembly for timestamp_sync() and confirmed that it only gives you half as much eye cancer as before (GCC still somehow insists on byte accesses when zeroing fields which is very odd, but at least that terrible AND/OR mess is gone). Measured a boot time increase of about 11ms on Jerry (mostly faster timestamp and CBFS accesses). Could not test Storm because despite our claimed abundance of test devices, every time I get one of them it magically disappears again in less than a week. Change-Id: I1d046e05bb11822b86e467eafb6aa92e8fbce774 Signed-off-by: Julius Werner Reviewed-on: https://chromium-review.googlesource.com/241732 Reviewed-by: Aaron Durbin Reviewed-on: https://chromium-review.googlesource.com/242162 --- toolchain.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/toolchain.inc b/toolchain.inc index df5e659c9a..fdb7bcb256 100644 --- a/toolchain.inc +++ b/toolchain.inc @@ -118,7 +118,7 @@ $(eval $(call create_class_compiler,arm64,aarch64)) CFLAGS_nonx86 += -ffunction-sections -fdata-sections -Wstack-usage=1536 -CFLAGS_arm += $(CFLAGS_nonx86) -mno-unaligned-access +CFLAGS_arm += $(CFLAGS_nonx86) CFLAGS_arm64 += $(CFLAGS_nonx86) CFLAGS_mipsel += $(CFLAGS_nonx86) -mips32r2 -G 0