From 7928605d97455eae56de1ba3c8b08b3afec99466 Mon Sep 17 00:00:00 2001 From: Victor Martinez Date: Mon, 15 Oct 2012 14:55:53 +0000 Subject: [PATCH] Fixed unaligned access with gcc 4.7.2 --- Makefile | 4 +++- work/Makefile_arm_unaligned.diff | 13 +++++++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 work/Makefile_arm_unaligned.diff diff --git a/Makefile b/Makefile index f05f578..eae1be3 100644 --- a/Makefile +++ b/Makefile @@ -23,6 +23,8 @@ $(WORK)/linux-$(KERNEL_VERSION).tar.bz2: $(WORK)/linux-$(KERNEL_VERSION): $(WORK)/linux-$(KERNEL_VERSION).tar.bz2 $(PWD)/config-$(KERNEL_VERSION) tar -C $(WORK) -xvjf $(WORK)/linux-$(KERNEL_VERSION).tar.bz2 + cd $(WORK) && \ + patch -p1 -i $(WORK)/Makefile_arm_unaligned.diff cp -v $(PWD)/config-$(KERNEL_VERSION) $(WORK)/linux-$(KERNEL_VERSION)/.config touch $(WORK)/linux-$(KERNEL_VERSION) @@ -30,7 +32,7 @@ $(WORK)/zImage-$(KERNEL_VERSION): $(WORK)/linux-$(KERNEL_VERSION) cd $(WORK)/linux-$(KERNEL_VERSION) && \ export PATH=$(CROSSTOOLS)/bin:$$PATH && \ export LD_LIBRARY_PATH=$(CROSSTOOLS)/lib:$$LD_LIBRARY_PATH && \ - make zImage ARCH=arm CROSS_COMPILE=$(TARGET)- + make zImage ARCH=arm CROSS_COMPILE=$(TARGET)- cp -v $(WORK)/linux-$(KERNEL_VERSION)/arch/arm/boot/zImage $(WORK)/zImage-$(KERNEL_VERSION) ln -sf zImage-$(KERNEL_VERSION) $(WORK)/zImage touch $(WORK)/zImage-$(KERNEL_VERSION) diff --git a/work/Makefile_arm_unaligned.diff b/work/Makefile_arm_unaligned.diff new file mode 100644 index 0000000..d1042b8 --- /dev/null +++ b/work/Makefile_arm_unaligned.diff @@ -0,0 +1,13 @@ +--- work/linux-2.6.31.14.27-efikamx_20111026/arch/arm/Makefile 2011-10-26 09:34:26.000000000 +0000 ++++ work/linux-2.6.31.14.27-efikamx_20111026/arch/arm/Makefile_arm_unaligned 2012-10-11 00:49:16.654988563 +0000 +@@ -94,6 +94,10 @@ + CFLAGS_ABI +=-funwind-tables + endif + ++ifeq ($(CONFIG_ALIGNMENT_TRAP),y) ++CFLAGS_ABI +=$(call cc-option,-mno-unaligned-access,) ++endif ++ + # Need -Uarm for gcc < 3.x + KBUILD_CFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) $(call cc-option,-mshort-load-bytes,$(call cc-option,-malignment-traps,)) -msoft-float -Uarm + KBUILD_AFLAGS +=$(CFLAGS_ABI) $(arch-y) $(tune-y) -msoft-float -- 2.26.2