[U-Boot] Building for da830 fails

Nick Thompson
2010-05-10T10:39:03Z

On 07/05/10 16:30, Timur Tabi wrote:
> Scott McNutt wrote:
>> lib/libgeneric.a(display_options.o): In function `print_size':
>> /home/smcnutt/27xx/u-boot.git/lib/display_options.c:66: undefined
>> reference to `__udivdi3'
>> /home/smcnutt/27xx/u-boot.git/lib/display_options.c:69: undefined
>> reference to `__umoddi3'
>> /home/smcnutt/27xx/u-boot.git/lib/display_options.c:70: undefined
>> reference to `__udivdi3'
>
> Man, I knew ARM sucked, but I didn't know it was this bad :-)
>
> I was going to suggestion replacing the division operations with calls to
> lldiv(), but we're actually doing a 64-by-64 bit division here:
>
> n = size / d;
>
> which means that in order to support support printing 64-bit numbers on ARM,
> we might need to completely rewrite print_size() to avoid division on 64-bit
> numbers.
>
> Wolfgang, do you have any suggestions?
>

I'm not sure if it is the correct way to "fix" this issue, But I have
submitted a patch in "[U-Boot] [PATCH] Avoid use of divides in print_size."

It allows ARM to rebuild again (here at least), but really it modifies
the function to use bit shifts as an optimisation over calling lengthy div
library functions. This side steps the linker issue.

It you have chance to test or review it I would be grateful. I tested the
code on x86 Linux PC, not by running it in U-Boot.

Nick.