wufuyue / yaffs2utils

Automatically exported from code.google.com/p/yaffs2utils
GNU General Public License v2.0
1 stars 3 forks source link

Can't compile on current Ubuntu #17

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
$ make -k
gcc -I. -I./yaffs2 -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wnested-externs -Winline -D_HAVE_MMAP   -c -o 
yaffs2/yaffs_hweight.o yaffs2/yaffs_hweight.c
gcc -I. -I./yaffs2 -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wnested-externs -Winline -D_HAVE_MMAP   -c -o 
yaffs2/yaffs_ecc.o yaffs2/yaffs_ecc.c
gcc -I. -I./yaffs2 -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wnested-externs -Winline -D_HAVE_MMAP   -c -o 
yaffs2/yaffs_packedtags1.o yaffs2/yaffs_packedtags1.c
gcc -I. -I./yaffs2 -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wnested-externs -Winline -D_HAVE_MMAP   -c -o 
yaffs2/yaffs_packedtags2.o yaffs2/yaffs_packedtags2.c
gcc -I. -I./yaffs2 -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wnested-externs -Winline -D_HAVE_MMAP   -c -o 
yaffs2utils_io.o yaffs2utils_io.c
gcc -I. -I./yaffs2 -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wnested-externs -Winline -D_HAVE_MMAP   -c -o 
yaffs2utils_endian.o yaffs2utils_endian.c
gcc -I. -I./yaffs2 -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wnested-externs -Winline -D_HAVE_MMAP   -c -o 
yaffs2utils_progress.o yaffs2utils_progress.c
gcc -I. -I./yaffs2 -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wnested-externs -Winline -D_HAVE_MMAP   -c -o mkyaffs2.o 
mkyaffs2.c
mkyaffs2.c: In function ‘mkyaffs2_tag2spare’:
mkyaffs2.c:309:49: error: dereferencing pointer to incomplete type
mkyaffs2.c: In function ‘mkyaffs2_load_spare’:
mkyaffs2.c:814:47: error: invalid application of ‘sizeof’ to incomplete 
type ‘struct nand_ecclayout’ 
mkyaffs2.c:815:22: error: invalid application of ‘sizeof’ to incomplete 
type ‘struct nand_ecclayout’ 
mkyaffs2.c: In function ‘main’:
mkyaffs2.c:974:21: warning: assignment from incompatible pointer type
mkyaffs2.c:980:21: warning: assignment from incompatible pointer type
mkyaffs2.c:997:20: warning: assignment from incompatible pointer type
mkyaffs2.c: In function ‘mkyaffs2_process_objtree’:
mkyaffs2.c:733:11: warning: ignoring return value of ‘readlink’, declared 
with attribute warn_unused_result
make: *** [mkyaffs2.o] Error 1
gcc -I. -I./yaffs2 -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wnested-externs -Winline -D_HAVE_MMAP   -c -o unyaffs2.o 
unyaffs2.c
unyaffs2.c: In function ‘unyaffs2_spare2tag’:
unyaffs2.c:460:49: error: dereferencing pointer to incomplete type
unyaffs2.c: In function ‘unyaffs2_load_spare’:
unyaffs2.c:1288:47: error: invalid application of ‘sizeof’ to incomplete 
type ‘struct nand_ecclayout’ 
unyaffs2.c:1289:22: error: invalid application of ‘sizeof’ to incomplete 
type ‘struct nand_ecclayout’ 
unyaffs2.c: In function ‘main’:
unyaffs2.c:1534:21: warning: assignment from incompatible pointer type
unyaffs2.c:1538:21: warning: assignment from incompatible pointer type
unyaffs2.c:1554:20: warning: assignment from incompatible pointer type
unyaffs2.c: In function ‘unyaffs2_extract_hardlink’:
unyaffs2.c:1010:8: warning: ignoring return value of ‘link’, declared with 
attribute warn_unused_result
unyaffs2.c:1050:12: warning: ignoring return value of ‘symlink’, declared 
with attribute warn_unused_result
unyaffs2.c: In function ‘unyaffs2_obj_chattr’:
unyaffs2.c:587:8: warning: ignoring return value of ‘lchown’, declared with 
attribute warn_unused_result
make: *** [unyaffs2.o] Error 1
gcc -I. -I./yaffs2 -O2 -Wall -Wshadow -Wpointer-arith -Wwrite-strings 
-Wstrict-prototypes -Wmissing-declarations -Wmissing-prototypes 
-Wredundant-decls -Wnested-externs -Winline -D_HAVE_MMAP   -c -o unspare2.o 
unspare2.c
gcc -lm -o unspare2 yaffs2/yaffs_hweight.o yaffs2/yaffs_ecc.o 
yaffs2/yaffs_packedtags1.o yaffs2/yaffs_packedtags2.o yaffs2utils_io.o 
yaffs2utils_endian.o yaffs2utils_progress.o unspare2.o
make: Target `all' not remade because of errors.

The cause is struct nand_oobfree not being defined.  There is a conflict 
between the files included in this package and the developer files that come 
with Ubuntu - specifically the file /usr/include/mtd/mtd-abi.h - which is part 
of the linux-libc-dev package.

Original issue reported on code.google.com by rogerbinns on 24 Aug 2011 at 7:39

GoogleCodeExporter commented 8 years ago
Would you try the attached patch!?

Original comment by penguin.lin on 30 Aug 2011 at 8:02

Attachments:

GoogleCodeExporter commented 8 years ago
patching file mkyaffs2.c
Hunk #1 FAILED at 120.
Hunk #2 FAILED at 811.
2 out of 2 hunks FAILED -- saving rejects to file mkyaffs2.c.rej
patching file unyaffs2.c
Hunk #1 FAILED at 182.
Hunk #2 FAILED at 1285.
2 out of 2 hunks FAILED -- saving rejects to file unyaffs2.c.rej

Patch doesn't apply.  In any event your changes were not the problem - the 
standard libc devel headers on Ubuntu include some MTD stuff and the headers 
you bundle with your project have an overlapping but slightly different set.  

Original comment by rogerbinns on 30 Aug 2011 at 8:16

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Dear rogerbinns:

At the latest version, the definition in "yaffs2utils_mtd.h" are useless (in 
r23),
and all information about ecc layout are came from "mtd/mtd-user.h";
I think the conflict problem should not occur.

I am still using the old Debian system.
Are there any details available?

Please also tell me which version you used,
the latest version should be "0.2.1" in CHANGES

* others
- Use "mtd/mtd-user.h" instead of "yaffs2utils_ecc.h".

Thanks

Original comment by penguin.lin on 30 Aug 2011 at 8:56

GoogleCodeExporter commented 8 years ago
Note that I no longer have a need for this tool as I found an alternate 
workaround for my original problem.

I used the latest version on the download page and am using Ubuntu Natty which 
roughly corresponds to Debian testing.  There are conflicting definitions in 
/usr/include/mtd/mtd-user.h or rather a different subset than the headers you 
supply.  Between the two sets they end up conflicting.

You will only be able to see and fix the problem by using an Ubuntu setup.  You 
could use a LiveCD, or make a chroot environment on your system by using 
debootstrap or pbuilder.

Original comment by rogerbinns on 30 Aug 2011 at 3:09

GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
[deleted comment]
GoogleCodeExporter commented 8 years ago
Dear rogerbinns:

I still think the previous patch can solve your problem.

In the latest "mtd-user.h", "nand_ecclayout_t" is defined from "struct 
nand_ecclayout_user", instead of the old "struct nand_ecclayout". I think it 
will be the root cause for this issue. Would you kindly double-check it.

Another question is, which version of Ubuntu is used!?
Would you kindly re-download the latest version and the previous patch to try 
again!? The latest one on Download page can be patched and compiled (the 
patched one) successfully on my test environment.

Best Regards.

Original comment by penguin.lin on 30 Aug 2011 at 5:58

GoogleCodeExporter commented 8 years ago
I am running Ubuntu 11.04 and I was able to apply the patch and then compile 
the code. I used the 21 July snapshot.

Original comment by brett...@gmail.com on 2 Sep 2011 at 1:24

GoogleCodeExporter commented 8 years ago
Dear brettpim:

Thanks for your reply. :D

Dear rogerbinns:

I will use ubuntu 11.04 live cd to make sure everything is right before 
committing the new revision.

Original comment by penguin.lin on 2 Sep 2011 at 3:40

GoogleCodeExporter commented 8 years ago
Hi,

I got the same error when mistakenly using patch -p2 (pwd yaffs2utils). Patch 
applies with patch -p1 and compiles ok. (Natty)

Original comment by hieronym...@gmail.com on 3 Sep 2011 at 7:12

GoogleCodeExporter commented 8 years ago
hello. i try
.../yaffs2utils$ patch -p1 compile_ubuntu.patch
but it does not work (((

Original comment by gashan.m...@gmail.com on 7 Sep 2011 at 11:57

GoogleCodeExporter commented 8 years ago
Running Linux Mint 11 was able to apply the patch and compile successfully. 
Command I used (from inside src directory) `patch 
</home/me/compile_ubuntu.patch` for Comment 16

Original comment by bli...@gmail.com on 10 Sep 2011 at 12:23

GoogleCodeExporter commented 8 years ago
This issue should be fixed in the latest version.
I will close it when next minor release.

Original comment by penguin.lin on 1 Nov 2011 at 2:33

GoogleCodeExporter commented 8 years ago

Original comment by penguin.lin on 18 Nov 2011 at 7:11