[U-Boot] [PATCH] arm: armv7: add compile option -mno-unaligned-access if available

Gary Thomas gary at mlbassoc.com
Thu Jul 12 17:12:38 CEST 2012


On 2012-07-02 03:42, Tetsuyuki Kobayashi wrote:
> Recent compiler generates unaligned memory access in armv7 default.
> But current U-Boot does not allow unaligned memory access, so it causes
> data abort exception.
> This patch add compile option "-mno-unaligned-access" if it is available.
>
> Signed-off-by: Tetsuyuki Kobayashi <koba at kmckk.co.jp>
> ---
>   arch/arm/cpu/armv7/config.mk |    2 ++
>   1 file changed, 2 insertions(+)
>
> diff --git a/arch/arm/cpu/armv7/config.mk b/arch/arm/cpu/armv7/config.mk
> index 5407cb6..560c084 100644
> --- a/arch/arm/cpu/armv7/config.mk
> +++ b/arch/arm/cpu/armv7/config.mk
> @@ -26,6 +26,8 @@ PLATFORM_RELFLAGS += -fno-common -ffixed-r8 -msoft-float
>   # supported by more tool-chains
>   PF_CPPFLAGS_ARMV7 := $(call cc-option, -march=armv7-a, -march=armv5)
>   PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_ARMV7)
> +PF_CPPFLAGS_NO_UNALIGNED := $(call cc-option, -mno-unaligned-access,)
> +PLATFORM_CPPFLAGS += $(PF_CPPFLAGS_NO_UNALIGNED)
>
>   # =========================================================================
>   #
> -- 1.7.9.5

Tested-by: Gary Thomas <gary at mlbassoc.com>

-- 
------------------------------------------------------------
Gary Thomas                 |  Consulting for the
MLB Associates              |    Embedded world
------------------------------------------------------------




More information about the U-Boot mailing list