CRUX-ARM : Home

Home :: Documentation :: Download :: Development :: Community :: Ports :: Packages :: Bugs :: Links :: About :: Donors
Fixed unaligned access with gcc 4.7.2
authorVictor Martinez <pitillo@ono.com>
Mon, 15 Oct 2012 14:55:53 +0000 (14:55 +0000)
committerVictor Martinez <pitillo@ono.com>
Mon, 15 Oct 2012 14:55:53 +0000 (14:55 +0000)
Makefile
work/Makefile_arm_unaligned.diff [new file with mode: 0644]

index f05f578b05f049be0cc273850068ce162aafd6d0..eae1be3047e4c96b42b32a315532fc2a8b748a0e 100644 (file)
--- 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 (file)
index 0000000..d1042b8
--- /dev/null
@@ -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