Skip to contentSkip to conversation

v2013.10 failed build with jffs2 cmd

U-Boot New Wolfgang Denk 4 participants 11 messages Oct 22, 2013 – Nov 22, 2013 Journalling flash file system V2 (JFFS2)

lore
Share & tools
lore
#0 lore raw

Dear Chris Ruehl,

Quoted 2 lines · 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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
The human race is a race of cowards; and I am not  only  marching  in
that procession but carrying a banner.                   - Mark Twain
#1 lore raw

Hi Wolfgang,

Quoted 8 lines · Wolfgang Denk

Dear Chris Ruehl,

Quoted 2 lines · 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

Quoted 6 lines

Best regards,

Wolfgang Denk

Signature · 6 lines
GTSYS Limited RFID Technology
A01 24/F Gold King Industrial Bld
35-41 Tai Lin Pai Road, Kwai Chung, Hong Kong
Fax (852) 8167 4060 - Tel (852) 3598 9488

Disclaimer: http://www.gtsys.com.hk/email/classified.html
#2 lore raw

FYI

Quoted 14 lines · Chris Ruehl

Hi Wolfgang,

Quoted 8 lines · Wolfgang Denk

Dear Chris Ruehl,

Quoted 2 lines · 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

Quoted 16 lines

/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

Quoted 6 lines

Best regards,

Wolfgang Denk

just to let you know, I open a thread on the linaro tool-chain mail list for this problem.

Chris

#3 lore raw

PATCH 1/1 JFFS2: Fix undefined reference to `__aeabi_uldivmod' error

In reply to Chris Ruehl

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.

---
 fs/jffs2/jffs2_1pass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jffs2/jffs2_1pass.c +1 -1
index c856983..a7dbe79 100644
@@ -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;
Signature · 1 line
1.8.3.1
#4 lore raw

PATCH 1/1 JFFS2: Fix undefined reference to `__aeabi_uldivmod' error

Wolfgang,

GOOD Catch!

Quoted 32 lines · Wolfgang Denk

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.

---
  fs/jffs2/jffs2_1pass.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)
fs/jffs2/jffs2_1pass.c +1 -1
index c856983..a7dbe79 100644
@@ -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;
#5 lore raw

PATCH 1/1 JFFS2: Fix undefined reference to `__aeabi_uldivmod' error

Dear Chris,

Quoted 2 lines · In message <[email protected]> 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

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
If a train station is a place where a train stops,
                                           then what's a workstation?
#6 lore raw

PATCH 1/1 JFFS2: Fix undefined reference to `__aeabi_uldivmod' error

Wolfgang,

Quoted 10 lines · Wolfgang Denk

Dear Chris,

Quoted 2 lines · In message<[email protected]> 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.

Quoted 5 lines

Best regards,

Wolfgang Denk

Signature · 6 lines
GTSYS Limited RFID Technology
A01 24/F Gold King Industrial Bld
35-41 Tai Lin Pai Road, Kwai Chung, Hong Kong
Fax (852) 8167 4060 - Tel (852) 3598 9488

Disclaimer: http://www.gtsys.com.hk/email/classified.html
#7 lore raw

PATCH 1/1 JFFS2: Fix undefined reference to `__aeabi_uldivmod' error

In reply to Wolfgang Denk

2013/10/27 Wolfgang Denk <[email protected]>:

Quoted 7 lines

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.

Quoted 32 lines

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.

---
 fs/jffs2/jffs2_1pass.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
fs/jffs2/jffs2_1pass.c +1 -2
index c856983..a7dbe79 100644
@@ -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 at lists.denx.de
http://lists.denx.de/mailman/listinfo/u-boot

Signature · 2 lines
Best regards,
Daniel
#8 lore raw

PATCH 1/1 JFFS2: Fix undefined reference to `__aeabi_uldivmod' error

In reply to Wolfgang Denk
Quoted 8 lines · In message <[email protected]> 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'

Quoted 6 lines

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.

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

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Save yourself!  Reboot in 5 seconds!
#9 lore raw

PATCH 1/1 JFFS2: Fix undefined reference to `__aeabi_uldivmod' error

Wolfgang,

good morning.

Quoted 22 lines · Wolfgang Denk
Quoted 8 lines · In message <[email protected]> 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'

Quoted 6 lines

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.

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.

Quoted 6 lines

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.

fs/jffs2/jffs2_1pass.c +2 -1
index c856983..e6b50de 100644
@@ -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

#10 lore raw

PATCH 1/1 JFFS2: Fix undefined reference to `__aeabi_uldivmod' error

Quoted 54 lines

From: u-boot-bounces at lists.denx.de [mailto:u-boot- Wolfgang,

good morning.

Quoted 12 lines · Wolfgang Denk
Quoted 11 lines · In message <[email protected]> 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.

Quoted 6 lines
Quoted 3 lines

I would like to withdraw this patch.

It appears nobody has been running a MAKEALL with

USE_PRIVATE_LIBGCC

Quoted 10 lines

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.

fs/jffs2/jffs2_1pass.c +1 -0
index c856983..e6b50de 100644
@@ -121,6 +121,7 @@
  #include <jffs2/jffs2_1pass.h>
  #include <linux/compat.h>
  #include <asm/errno.h>
+#include <div64.h>
 
  #include "jffs2_private.h"
 

fs/jffs2/jffs2_1pass.c jffs2_1pass_build_lists(struct part_info * part) · line 1445

Quoted 8 lines
fs/jffs2/jffs2_1pass.c +1 -1
@@ -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..

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

With regards, pekon