[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Bug-cpio] MinGW build bugs w/ cpio 2.11

From: Michael Cronenworth
Subject: [Bug-cpio] MinGW build bugs w/ cpio 2.11
Date: Mon, 07 Mar 2011 10:03:47 -0600
User-agent: Mozilla/5.0 (X11; U; Linux x86_64; en-US; rv: Gecko/20101209 Fedora/3.1.7-0.35.b3pre.fc14 Lightning/1.0b3pre Thunderbird/3.1.7


I'm running Fedora 14 x86_64 and attempted to build cpio 2.11 using the Fedora MinGW environment. Unfortunately the build did not go smoothly.

Configure line:
CC=i686-pc-mingw32-gcc ./configure --build=i686-pc-mingw32

1. lstat() and stat() defined in filetypes.h
2. readlink() used in src/copyout.c, MinGW has no equivalent.
3. gethostbyname() used in lib/rtapelib.c without winsock2.h present. This causes a compile error in that the correct, MinGW gethostbyname() function is not requested to the linker, and therefore simply trying to link with wsock32 fails. 4. After fixing 1, 2, and 3, the resulting cpio.exe file fails to extract valid cpio archives printing "cpio.exe: premature end of file". It also fails to create a valid cpio archive as when I attempt to use the native Fedora cpio it fails printing "cpio: premature end of file". I then created a similar cpio archive with the native Fedora cpio and found the following file size differences:
cpio.exe built archive file size: 84323
cpio built archive file size: 81920

1. Seems to be fixed with commit 3a7a1820d4cecbd77c7b74c785af5942510bf080, so that's one down. The rest are still an issue with the latest git revision. 2. I put a #ifdef HAVE_READLINK around the readlink() call and set link_size = -1. This may not be a proper solution, but it works for building with MinGW. 3. Including winsock2.h in lib/rtapelib.c and linking cpio.exe with wsock32 fixes the issue.
4. Unknown. Perhaps my configure line is not correct?

I would appreciate any comments on these issues.


reply via email to

[Prev in Thread] Current Thread [Next in Thread]