Re: [U-Boot] v2013.10 failed build with jffs2 cmd

Dear Chris Ruehl,
I wrote:
If everything else fails, use "USE_PRIVATE_LIBGCC=y" on the make command line.
I mean: use "USE_PRIVATE_LIBGCC=yes" on the make command line.
Best regards,
Wolfgang Denk

Hi Wolfgang,
On Tuesday, October 22, 2013 08:13 PM, Wolfgang Denk wrote:
Dear Chris Ruehl,
I wrote:
If everything else fails, use "USE_PRIVATE_LIBGCC=y" on the make command line.
I mean: use "USE_PRIVATE_LIBGCC=yes" on the make command line.
after I set this option the build failed for
/uboot.d/u-boot-git/arch/arm/lib/libgcc.o -Map u-boot.map -o u-boot fs/jffs2/libjffs2.o: In function `jffs2_1pass_build_lists': /opt/cross_build/uboot.d/u-boot-git/fs/jffs2/jffs2_1pass.c:1441: undefined reference to `__aeabi_uldivmod'
I mentioned this reference as "root of the evil" before :-)
Chris
Best regards,
Wolfgang Denk

FYI
On Wednesday, October 23, 2013 08:36 AM, Chris Ruehl wrote:
Hi Wolfgang,
On Tuesday, October 22, 2013 08:13 PM, Wolfgang Denk wrote:
Dear Chris Ruehl,
I wrote:
If everything else fails, use "USE_PRIVATE_LIBGCC=y" on the make command line.
I mean: use "USE_PRIVATE_LIBGCC=yes" on the make command line.
after I set this option the build failed for
/uboot.d/u-boot-git/arch/arm/lib/libgcc.o -Map u-boot.map -o u-boot fs/jffs2/libjffs2.o: In function `jffs2_1pass_build_lists': /opt/cross_build/uboot.d/u-boot-git/fs/jffs2/jffs2_1pass.c:1441: undefined reference to `__aeabi_uldivmod'
I mentioned this reference as "root of the evil" before :-)
Chris
Best regards,
Wolfgang Denk
just to let you know, I open a thread on the linaro tool-chain mail list for this problem.
Chris

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@denx.de Reported-by: Chris Ruehl chris.ruehl@gtsys.com.hk Cc: Chris Ruehl chris.ruehl@gtsys.com.hk
--- 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;

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 Denkwd@denx.de Reported-by: Chris Ruehlchris.ruehl@gtsys.com.hk Cc: Chris Ruehlchris.ruehl@gtsys.com.hk
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;

Dear Chris,
In message 526CE0F6.8020408@gtsys.com.hk you wrote:
GOOD Catch!
Thanks :-)
It would be nice if you could run an actual test on your hardware,and then eventually even provide an Tested-by: ?
Best regards,
Wolfgang Denk

Wolfgang,
On Sunday, October 27, 2013 06:01 PM, Wolfgang Denk wrote:
Dear Chris,
In message526CE0F6.8020408@gtsys.com.hk you wrote:
GOOD Catch!
Thanks :-)
It would be nice if you could run an actual test on your hardware,and then eventually even provide an Tested-by: ?
Yes, I will run the test, later today.
Best regards,
Wolfgang Denk

2013/10/27 Wolfgang Denk wd@denx.de:
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'
I recently noticed a similar problem on MIPS too:
fs/jffs2/libjffs2.o: In function `jffs2_get_list': jffs2_1pass.c:(.text.jffs2_get_list+0x5c): undefined reference to `__udivdi3'
Your patch solves it, thanks. Tested-by: Daniel Schwierzeck daniel.schwierzeck@gmail.com
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@denx.de Reported-by: Chris Ruehl chris.ruehl@gtsys.com.hk Cc: Chris Ruehl chris.ruehl@gtsys.com.hk
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;
-- 1.8.3.1
U-Boot mailing list U-Boot@lists.denx.de http://lists.denx.de/mailman/listinfo/u-boot

In message 1382865251-17302-1-git-send-email-wd@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@denx.de Reported-by: Chris Ruehl chris.ruehl@gtsys.com.hk Cc: Chris Ruehl chris.ruehl@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

Wolfgang,
good morning.
On Monday, October 28, 2013 04:07 AM, Wolfgang Denk wrote:
In message 1382865251-17302-1-git-send-email-wd@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@denx.de Reported-by: Chris Ruehl chris.ruehl@gtsys.com.hk Cc: Chris Ruehl chris.ruehl@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;
cd /opt/cross_build/uboot.d/u-boot-git/spl/ && arm-linux-gnueabihf-ld.bfd -T /opt/cross_build/uboot.d/u-boot-git/spl/u-boot-spl.lds --gc-sections --gc-sections -Bstatic -Ttext 0xa0000000 arch/arm/cpu/arm926ejs/start.o --start-group arch/arm/cpu/arm926ejs/libarm926ejs.o arch/arm/cpu/arm926ejs/mx27/libmx27.o arch/arm/imx-common/libimx-common.o arch/arm/lib/libarm.o board/gtsys/common/libgtsys.o board/gtsys/mx27gtsir/libmx27gtsir.o drivers/mtd/nand/libnand.o --end-group /opt/cross_build/uboot.d/u-boot-git/spl/arch/arm/lib/eabi_compat.o /opt/cross_build/uboot.d/u-boot-git/spl/arch/arm/lib/libgcc.o -Map u-boot-spl.map -o u-boot-spl arm-linux-gnueabihf-objcopy --gap-fill=0xff -O binary /opt/cross_build/uboot.d/u-boot-git/spl/u-boot-spl /opt/cross_build/uboot.d/u-boot-git/spl/u-boot-spl.bin make[1]: Leaving directory `/opt/cross_build/uboot.d/u-boot-git/spl' arm-linux-gnueabihf-objcopy --gap-fill=0xff --pad-to=0x800 -I binary -O binary spl/u-boot-spl.bin spl/u-boot-spl-pad.bin; cat spl/u-boot-spl-pad.bin u-boot.bin > u-boot-with-spl.bin; rm spl/u-boot-spl-pad.bin
Regards Chris

From: u-boot-bounces@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@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@denx.de Reported-by: Chris Ruehl chris.ruehl@gtsys.com.hk Cc: Chris Ruehl chris.ruehl@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@ti.com
Please merge this soon, so that ./MAKEALL is clean.
With regards, pekon
participants (4)
-
Chris Ruehl
-
Daniel Schwierzeck
-
Gupta, Pekon
-
Wolfgang Denk