[uboot-omap]: fix jffs2 with internal libgcc and switch omap4 to ext4
[openwrt.git] / package / boot / uboot-omap / patches / 002-fix_jffs2.patch
1 Building boards that have JFFS2 support enabled will fail when using
2 U-Boot's builtin GCC library, for example like this:
3
4 USE_PRIVATE_LIBGCC=yes ./MAKEALL omap3_evm
5 ...
6 fs/jffs2/libjffs2.o: In function `jffs2_1pass_build_lists':
7 fs/jffs2/jffs2_1pass.c:1441: undefined reference to `__aeabi_uldivmod'
8
9 This is caused by a u64 / u32 division in jffs2_1pass.c; the problem
10 can be avoided by using do_div() instead of plain division.
11
12 Signed-off-by: Wolfgang Denk <wd@denx.de>
13 Reported-by: Chris Ruehl <chris.ruehl@gtsys.com.hk>
14 Cc: Chris Ruehl <chris.ruehl@gtsys.com.hk>
15
16 ---
17  fs/jffs2/jffs2_1pass.c | 2 +-
18  1 file changed, 1 insertion(+), 1 deletion(-)
19
20 diff --git a/fs/jffs2/jffs2_1pass.c b/fs/jffs2/jffs2_1pass.c
21 index c856983..a7dbe79 100644
22 --- a/fs/jffs2/jffs2_1pass.c
23 +++ b/fs/jffs2/jffs2_1pass.c
24 @@ -1438,7 +1438,7 @@ jffs2_1pass_build_lists(struct part_info * part)
25  {
26         struct b_lists *pL;
27         struct jffs2_unknown_node *node;
28 -       u32 nr_sectors = part->size/part->sector_size;
29 +       u32 nr_sectors = do_div(part->size, part->sector_size);
30         u32 i;
31         u32 counter4 = 0;
32         u32 counterF = 0;
33 --
34 1.8.3.1