From mboxrd@z Thu Jan 1 00:00:00 1970 From: Chris Ruehl Date: Sun, 27 Oct 2013 17:46:30 +0800 Subject: [U-Boot] [PATCH] JFFS2: Fix undefined reference to `__aeabi_uldivmod' error In-Reply-To: <1382865251-17302-1-git-send-email-wd@denx.de> References: <52671A0A.3020907@gtsys.com.hk> <1382865251-17302-1-git-send-email-wd@denx.de> Message-ID: <526CE0F6.8020408@gtsys.com.hk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang, GOOD Catch! On Sunday, October 27, 2013 05:14 PM, Wolfgang Denk 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 > Reported-by: Chris Ruehl > Cc: Chris Ruehl > > --- > fs/jffs2/jffs2_1pass.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c > index c856983..a7dbe79 100644 > --- a/fs/jffs2/jffs2_1pass.c > +++ b/fs/jffs2/jffs2_1pass.c > @@ -1438,7 +1438,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;