[U-Boot] [PATCH] JFFS2: Fix undefined reference to `__aeabi_uldivmod' error

Gupta, Pekon pekon at ti.com
Fri Nov 22 05:55:18 CET 2013


> From: u-boot-bounces at lists.denx.de [mailto:u-boot-
> Wolfgang,
> 
> good morning.
> 
> On Monday, October 28, 2013 04:07 AM, Wolfgang Denk wrote:
> > In message <1382865251-17302-1-git-send-email-wd at denx.de> I wrote:
> >> Building boards that have JFFS2 support enabled will fail when using
> >> U-Boot's builtin GCC library, for example like this:
> >>
> >> USE_PRIVATE_LIBGCC=yes ./MAKEALL omap3_evm
> >> ...
> >> fs/jffs2/libjffs2.o: In function `jffs2_1pass_build_lists':
> >> fs/jffs2/jffs2_1pass.c:1441: undefined reference to `__aeabi_uldivmod'
> >>
> >> This is caused by a u64 / u32 division in jffs2_1pass.c; the problem
> >> can be avoided by using do_div() instead of plain division.
> >>
> >> Signed-off-by: Wolfgang Denk <wd at denx.de>
> >> Reported-by: Chris Ruehl <chris.ruehl at gtsys.com.hk>
> >> Cc: Chris Ruehl <chris.ruehl at gtsys.com.hk>
> > I would like to withdraw this patch.
> >
> > It appears nobody has been running a MAKEALL with
> USE_PRIVATE_LIBGCC
> > enabled for a long, long time.  There are a number of other places
> > that show similar problems.  Instead of fixing these one by one, I
> > think we should rather bundle this.
> >
> > I'm working on a more complete patch (or patch series).
> >
> > Best regards,
> >
> > Wolfgang Denk
> >
> The test of your patch works with the linaro 2013.09 tool chain.
> 
> I had to add the missing header only
> #include <div64.h> which is required for the build.
> 
> diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
> index c856983..e6b50de 100644
> --- a/fs/jffs2/jffs2_1pass.c
> +++ b/fs/jffs2/jffs2_1pass.c
> @@ -121,6 +121,7 @@
>   #include <jffs2/jffs2_1pass.h>
>   #include <linux/compat.h>
>   #include <asm/errno.h>
> +#include <div64.h>
> 
>   #include "jffs2_private.h"
> 
> @@ -1438,7 +1439,7 @@ jffs2_1pass_build_lists(struct part_info * part)
>   {
>          struct b_lists *pL;
>          struct jffs2_unknown_node *node;
> -       u32 nr_sectors = part->size/part->sector_size;
> +       u32 nr_sectors = do_div(part->size,part->sector_size);
>          u32 i;
>          u32 counter4 = 0;
>          u32 counterF = 0;
> 

Thanks for fixing this..
Tested-by: Pekon Gupta <pekon at ti.com>

Please merge this soon, so that ./MAKEALL is clean.

With regards, pekon


More information about the U-Boot mailing list