Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 357075 - IO.xs error: invalid application of 'sizeof' to incomplete type 'struct pollfd' building perl on gentoo-prefix on a debian box
Summary: IO.xs error: invalid application of 'sizeof' to incomplete type 'struct pollf...
Status: RESOLVED FIXED
Alias: None
Product: Gentoo/Alt
Classification: Unclassified
Component: Prefix Support (show other bugs)
Hardware: All Linux
: High normal
Assignee: Gentoo Prefix
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-03-02 10:05 UTC by Asfand Yar Qazi
Modified: 2011-04-07 07:59 UTC (History)
0 users

See Also:
Package list:
Runtime testing required: ---


Attachments
Here is what Perl detects during the configuration phase. poll.h and sys/poll.h are found just fine (perl-configure.txt,32.53 KB, text/plain)
2011-03-02 10:06 UTC, Asfand Yar Qazi
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Asfand Yar Qazi 2011-03-02 10:05:32 UTC
They run Debian lenny at work, and I wanted to install gentoo-prefix in my home directory.  During the bootstrap setup where I'm told to do 'env FEATURES="-collision-protect" emerge --oneshot portage', it pulls in perl-5.12.2-r4.  As it was building, I encountered the following error when building:

../../miniperl "-I../../lib" "-I../../lib" ../../lib/ExtUtils/xsubpp  -typemap ../../lib/ExtUtils/typemap  IO.xs > IO.xsc && mv IO.xsc IO.c
i686-pc-linux-gnu-gcc -c   -fno-strict-aliasing -pipe -I/nfs/users/nfs_a/aq2/gentoo/usr/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -O2 -march=i686 -pipe -m32   -DVERSION=\"1.25_02\" -DXS_VERSION=\"1.25_02\" -fPIC "-I../.."   IO.c
IO.xs: In function 'XS_IO__Poll__poll':
IO.xs:249: error: invalid application of 'sizeof' to incomplete type 'struct pollfd'
IO.xs:253: error: invalid use of undefined type 'struct pollfd'
IO.xs:253: error: dereferencing pointer to incomplete type
IO.xs:255: error: invalid use of undefined type 'struct pollfd'
IO.xs:255: error: dereferencing pointer to incomplete type
IO.xs:257: error: invalid use of undefined type 'struct pollfd'
IO.xs:257: error: dereferencing pointer to incomplete type
IO.xs:261: error: invalid use of undefined type 'struct pollfd'
IO.xs:261: error: dereferencing pointer to incomplete type
IO.xs:262: error: invalid use of undefined type 'struct pollfd'
IO.xs:262: error: dereferencing pointer to incomplete type
make[1]: *** [IO.o] Error 1

In case it helps, /usr/include/poll.h looks like:
#include <sys/poll.h>


As specified here (http://serverfault.com/questions/145288/make-error-when-compiling-perl-5-12-1-rhel-5-5), I fudged the files in usr/portage to apply this patch to the sources before they compile:

--- dist/IO/poll.h      2011-03-02 09:19:19.600310000 +0000
+++ dist/IO/poll.h      2011-03-02 09:22:02.637505000 +0000
@@ -11,7 +11,7 @@
 #  define POLL_H

 #if (defined(HAS_POLL) && defined(I_POLL)) || defined(POLLWRBAND)
-#  include <poll.h>
+#  include <sys/poll.h>
 #else
 #ifdef HAS_SELECT

and, strangely, it worked.  I got perl to compile just fine.

Reproducible: Always

Steps to Reproduce:
Comment 1 Asfand Yar Qazi 2011-03-02 10:06:33 UTC
Created attachment 264343 [details]
Here is what Perl detects during the configuration phase.  poll.h and sys/poll.h are found just fine
Comment 2 Fabian Groffen gentoo-dev 2011-03-07 16:15:36 UTC
hmmm, I think that it should try to include sys/poll.h before poll.h based on the HAVE_XXXX guards.  I wonder if this is already fixed in 5.13.2 already though.
Comment 3 Asfand Yar Qazi 2011-03-08 11:59:01 UTC
Just FYI, once I'd set up the prefix and emerge --sync'ed, Perl compiled just fine - it was version 5.12.3 .
Comment 4 Fabian Groffen gentoo-dev 2011-03-08 13:43:44 UTC
ok, do you think we can close this bug then?  or do we need a new bootstrap image?
Comment 5 Asfand Yar Qazi 2011-03-08 16:27:55 UTC
Well, I could try a newer version of Perl during bootstrap instead of patching the existing version, to see if that will cure it.
Comment 6 Fabian Groffen gentoo-dev 2011-03-08 16:31:10 UTC
in that case just use
./bootstrap-prefix.sh ${EPREFIX} latest_tree
instead of tree, that should give you the latest perl ebuild during bootstrap
Comment 7 Asfand Yar Qazi 2011-03-10 10:44:50 UTC
OK, I did the latest_tree thing, and it worked.

I guess you can close the ticket now - if anyone has the same problem, hopefully they'll find this page and do the same thing.

Thanks
Comment 8 Fabian Groffen gentoo-dev 2011-03-10 13:36:09 UTC
ok, we just have to put a new snapshot live, then other people will not hit this bug any more (it's basically making tree == latest_tree of today)
Comment 9 Jeremy Olexa (darkside) (RETIRED) archtester gentoo-dev Security 2011-03-10 14:00:29 UTC
(In reply to comment #8)
> ok, we just have to put a new snapshot live, then other people will not hit
> this bug any more (it's basically making tree == latest_tree of today)

I'll sign off on that based on linux nightly testing.
Comment 10 Asfand Yar Qazi 2011-04-07 07:22:26 UTC
I can confirm that bootstrapping the prefix with 'tree' now works fine and does not encounter this error (on Ubuntu anyway)
Comment 11 Fabian Groffen gentoo-dev 2011-04-07 07:59:42 UTC
thanks for the confirmation