23 May 2011 13:16
[PATCH] ARM: Do not allow unaligned accesses when CONFIG_ALIGNMENT_TRAP
Catalin Marinas <catalin.marinas <at> arm.com>
2011-05-23 11:16:48 GMT
2011-05-23 11:16:48 GMT
Newer versions of gcc generate unaligned accesses by default, causing kernel panics when CONFIG_ALIGNMENT_TRAP is enabled. This patch adds the -mno-unaligned-access option to gcc. Reported-by: Ali Saidi <ali.saidi <at> arm.com> Signed-off-by: Catalin Marinas <catalin.marinas <at> arm.com> --- arch/arm/Makefile | 4 ++++ 1 files changed, 4 insertions(+), 0 deletions(-) diff --git a/arch/arm/Makefile b/arch/arm/Makefile index c7d321a..1c383d0 100644 --- a/arch/arm/Makefile +++ b/arch/arm/Makefile <at> <at> -101,6 +101,10 <at> <at> ifeq ($(CONFIG_ARM_UNWIND),y) CFLAGS_ABI +=-funwind-tables endif +ifeq ($(CONFIG_ALIGNMENT_TRAP),y) +CFLAGS_ABI +=$(call cc-option,-mno-unaligned-access,) +endif + ifeq ($(CONFIG_THUMB2_KERNEL),y) AFLAGS_AUTOIT :=$(call as-option,-Wa$(comma)-mimplicit-it=always,-Wa$(comma)-mauto-it) AFLAGS_NOWARN :=$(call as-option,-Wa$(comma)-mno-warn-deprecated,-Wa$(comma)-W)
RSS Feed