uboot-omap: fix build with gcc-5
[openwrt/staging/chunkeey.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 --- a/fs/jffs2/jffs2_1pass.c
21 +++ b/fs/jffs2/jffs2_1pass.c
22 @@ -1438,7 +1438,7 @@ jffs2_1pass_build_lists(struct part_info
23 {
24 struct b_lists *pL;
25 struct jffs2_unknown_node *node;
26 - u32 nr_sectors = part->size/part->sector_size;
27 + u32 nr_sectors = do_div(part->size, part->sector_size);
28 u32 i;
29 u32 counter4 = 0;
30 u32 counterF = 0;