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

Lucas Stach
2012-07-02T15:16:08Z

Am Montag, den 02.07.2012, 10:53 +0100 schrieb M?ns Rullg?rd:
> Tetsuyuki Kobayashi <koba@kmckk.co.jp> writes:
>
> > 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.
>
> Why not allow unaligned accesses instead?
>
IMHO, our recent discussion showed that both ways are wrong.
"-mno-unaligned-access" works around misaligned data on the software
level, while allowing unaligned access does on the hardware level.

What we really want is no unaligned access in U-Boot at all. Just
because "-mno-unaligned-access" is the default on ARMv5, we should not
consider it a gold standard.

Thanks,
Lucas