Re: Error compiling libubi with latest mtd-utils snapshot

Chase Maupin
2008-01-25T13:50:19Z

Artem,

I downloaded the latest git snapshot and I am seeing the following
results from make and make clean:

Makefile:49: no file name for `-include'
make: Warning: File `Makefile' has modification time 4.1e+03 s in the future
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o ftl_format.o ftl_format.c -g
-Wp,-MD,./.ftl_format.c.dep
gcc -I./include -O2 -Wall -g -o ftl_format ftl_format.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o flash_erase.o flash_erase.c -g
-Wp,-MD,./.flash_erase.c.dep
gcc -I./include -O2 -Wall -g -o flash_erase flash_erase.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o crc32.o crc32.c -g -Wp,-MD,./.crc32.c.dep
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o flash_eraseall.o flash_eraseall.c
-g -Wp,-MD,./.flash_eraseall.c.dep
gcc -o flash_eraseall crc32.o flash_eraseall.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o nanddump.o nanddump.c -g
-Wp,-MD,./.nanddump.c.dep
gcc -I./include -O2 -Wall -g -o nanddump nanddump.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o doc_loadbios.o doc_loadbios.c -g
-Wp,-MD,./.doc_loadbios.c.dep
gcc -I./include -O2 -Wall -g -o doc_loadbios doc_loadbios.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o ftl_check.o ftl_check.c -g
-Wp,-MD,./.ftl_check.c.dep
gcc -I./include -O2 -Wall -g -o ftl_check ftl_check.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o compr_rtime.o compr_rtime.c -g
-Wp,-MD,./.compr_rtime.c.dep
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o mkfs.jffs2.o mkfs.jffs2.c -g
-Wp,-MD,./.mkfs.jffs2.c.dep
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o compr_zlib.o compr_zlib.c -g
-Wp,-MD,./.compr_zlib.c.dep
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o compr_lzo.o compr_lzo.c -g
-Wp,-MD,./.compr_lzo.c.dep
compr_lzo.c: In function `jffs2_lzo_cmpr':
compr_lzo.c:54: warning: passing arg 4 of `lzo1x_999_compress' from
incompatible pointer type
compr_lzo.c: In function `jffs2_lzo_decompress':
compr_lzo.c:74: warning: passing arg 4 of `lzo1x_decompress_safe' from
incompatible pointer type
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o compr.o compr.c -g -Wp,-MD,./.compr.c.dep
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o rbtree.o rbtree.c -g -Wp,-MD,./.rbtree.c.dep
gcc -o mkfs.jffs2 crc32.o compr_rtime.o mkfs.jffs2.o compr_zlib.o
compr_lzo.o compr.o rbtree.o -lz -llzo2
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o flash_lock.o flash_lock.c -g
-Wp,-MD,./.flash_lock.c.dep
gcc -I./include -O2 -Wall -g -o flash_lock flash_lock.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o flash_unlock.o flash_unlock.c -g
-Wp,-MD,./.flash_unlock.c.dep
gcc -I./include -O2 -Wall -g -o flash_unlock flash_unlock.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o flash_info.o flash_info.c -g
-Wp,-MD,./.flash_info.c.dep
gcc -I./include -O2 -Wall -g -o flash_info flash_info.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o flash_otp_info.o flash_otp_info.c
-g -Wp,-MD,./.flash_otp_info.c.dep
gcc -I./include -O2 -Wall -g -o flash_otp_info flash_otp_info.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o flash_otp_dump.o flash_otp_dump.c
-g -Wp,-MD,./.flash_otp_dump.c.dep
gcc -I./include -O2 -Wall -g -o flash_otp_dump flash_otp_dump.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o mtd_debug.o mtd_debug.c -g
-Wp,-MD,./.mtd_debug.c.dep
gcc -I./include -O2 -Wall -g -o mtd_debug mtd_debug.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o flashcp.o flashcp.c -g
-Wp,-MD,./.flashcp.c.dep
flashcp.c:255:2: warning: #warning "Check for smaller erase regions"
gcc -I./include -O2 -Wall -g -o flashcp flashcp.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o nandwrite.o nandwrite.c -g
-Wp,-MD,./.nandwrite.c.dep
gcc -I./include -O2 -Wall -g -o nandwrite nandwrite.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o nandtest.o nandtest.c -g
-Wp,-MD,./.nandtest.c.dep
gcc -I./include -O2 -Wall -g -o nandtest nandtest.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o jffs2dump.o jffs2dump.c -g
-Wp,-MD,./.jffs2dump.c.dep
gcc -o jffs2dump jffs2dump.o crc32.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o nftldump.o nftldump.c -g
-Wp,-MD,./.nftldump.c.dep
gcc -I./include -O2 -Wall -g -o nftldump nftldump.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o nftl_format.o nftl_format.c -g
-Wp,-MD,./.nftl_format.c.dep
gcc -I./include -O2 -Wall -g -o nftl_format nftl_format.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o docfdisk.o docfdisk.c -g
-Wp,-MD,./.docfdisk.c.dep
docfdisk.c: In function `main':
docfdisk.c:149: warning: 'ip' might be used uninitialized in this function
gcc -I./include -O2 -Wall -g -o docfdisk docfdisk.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o rfddump.o rfddump.c -g
-Wp,-MD,./.rfddump.c.dep
gcc -I./include -O2 -Wall -g -o rfddump rfddump.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o rfdformat.o rfdformat.c -g
-Wp,-MD,./.rfdformat.c.dep
gcc -I./include -O2 -Wall -g -o rfdformat rfdformat.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o serve_image.o serve_image.c -g
-Wp,-MD,./.serve_image.c.dep
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o fec.o fec.c -g -Wp,-MD,./.fec.c.dep
gcc -o serve_image serve_image.o crc32.o fec.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o recv_image.o recv_image.c -g
-Wp,-MD,./.recv_image.c.dep
recv_image.c: In function `main':
recv_image.c:310: warning: long unsigned int format, uint32_t arg (arg 2)
recv_image.c:310: warning: long unsigned int format, uint32_t arg (arg 3)
recv_image.c:310: warning: long unsigned int format, uint32_t arg (arg 4)
recv_image.c:48: warning: 'image_crc' might be used uninitialized in
this function
recv_image.c:55: warning: 'fec' might be used uninitialized in this function
recv_image.c:58: warning: 'start_seq' might be used uninitialized in
this function
gcc -o recv_image recv_image.o crc32.o fec.o
mkdir -p .
gcc -I./include -O2 -Wall -g -c -o sumtool.o sumtool.c -g
-Wp,-MD,./.sumtool.c.dep
gcc -o sumtool sumtool.o crc32.o
make -C ./ubi-utils
make[1]: Entering directory `/home/chase/projects/wiki/mtd-utils.git/ubi-utils'
make[1]: Warning: File `Makefile' has modification time 4.1e+03 s in the future
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall src/libubi.c
-c -o libubi.o
In file included from ../include/mtd/ubi-header.h:34,
from include/libubi.h:29,
from src/libubi.c:34:
/usr/include/asm/byteorder.h:6:2: #warning using private kernel
header; include <endian.h> instead!
make[1]: *** [libubi.o] Error 1
make[1]: Leaving directory `/home/chase/projects/wiki/mtd-utils.git/ubi-utils'
make: *** [all] Error 2
rm doc_loadbios.o flash_info.o docfdisk.o ftl_check.o rfdformat.o
nandwrite.o mtd_debug.o flash_otp_dump.o nftldump.o flash_lock.o
flash_otp_info.o rfddump.o flash_unlock.o nftl_format.o flashcp.o
flash_erase.o ftl_format.o nandtest.o nanddump.o

I changed line 34 in include/mtd/ubi-header.h from "#include
<asm/byteorder.h>" to "#include <endian.h>" and I see the following
error:

make -C ./ubi-utils
make[1]: Entering directory `/home/chase/projects/wiki/mtd-utils.git/ubi-utils'
make[1]: Warning: File `Makefile' has modification time 4e+03 s in the future
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall src/libubi.c
-c -o libubi.o
ar crv libubi.a libubi.o
a - libubi.o
ranlib libubi.a
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall src/common.c
-c -o common.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall
src/ubiupdate.c -c -o ubiupdate.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall ubiupdate.o
common.o -L. -lubi -o ubiupdate
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall
src/ubimkvol.c -c -o ubimkvol.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall ubimkvol.o
common.o -L. -lubi -o ubimkvol
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall
src/ubirmvol.c -c -o ubirmvol.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall ubirmvol.o
common.o -L. -lubi -o ubirmvol
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall
src/ubicrc32.c -c -o ubicrc32.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall src/crc32.c
-c -o crc32.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall -o ubicrc32
ubicrc32.o crc32.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall src/ubinfo.c
-c -o ubinfo.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall ubinfo.o
common.o -L. -lubi -o ubinfo
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall
src/ubiattach.c -c -o ubiattach.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall ubiattach.o
common.o -L. -lubi -o ubiattach
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall
src/ubidetach.c -c -o ubidetach.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall ubidetach.o
common.o -L. -lubi -o ubidetach
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall src/ubinize.c
-c -o ubinize.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall
src/libiniparser.c -c -o libiniparser.o
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall
src/dictionary.c -c -o dictionary.o
ar crv libiniparser.a libiniparser.o dictionary.o
a - libiniparser.o
a - dictionary.o
ranlib libiniparser.a
gcc -Iinclude -Isrc -I../include -O2 -Wall -Werror -Wall
src/libubigen.c -c -o libubigen.o
src/libubigen.c: In function `ubigen_create_empty_vtbl':
src/libubigen.c:95: warning: implicit declaration of function `__cpu_to_be32'
src/libubigen.c: In function `ubigen_add_volume':
src/libubigen.c:139: warning: implicit declaration of function `__cpu_to_be16'
src/libubigen.c: In function `init_ec_hdr':
src/libubigen.c:160: warning: implicit declaration of function `__cpu_to_be64'
make[1]: *** [libubigen.o] Error 1
rm ubiupdate.o ubinfo.o ubimkvol.o ubidetach.o ubirmvol.o ubiattach.o
make[1]: Leaving directory `/home/chase/projects/wiki/mtd-utils.git/ubi-utils'
make: *** [all] Error 2
rm doc_loadbios.o flash_info.o docfdisk.o ftl_check.o rfdformat.o
nandwrite.o mtd_debug.o flash_otp_dump.o nftldump.o flash_lock.o
flash_otp_info.o rfddump.o flash_unlock.o nftl_format.o flashcp.o
flash_erase.o ftl_format.o nandtest.o nanddump.o

There still seems to be something wrong here.

Thanks,
Chase Maupin

On 1/25/08, Artem Bityutskiy <dedekind@infradead.org> wrote:
> On Thu, 2008-01-24 at 09:39 -0600, Chase Maupin wrote:
> > All,
> >
> > I downloaded the latest mtd-utils snapshot from
> > git://git.infradead.org/mtd-utils.git and did a "make clean" followed
> > by "make". The snapshot I downloaded was commited Jan 24, 2008 at
> > 11:21 with commit tag e292b5fb39de2c6907ffe751391ae3bbd5603b91.
> >
> > During the compile I received the following errors:
> >
>
> I've removes all __be32 and the like occurrences from ubi-header.h.
> Please, update (git-pull) and try again.
>
> --
> Best regards,
> Artem Bityutskiy (Битюцкий Артём)
>
>