CentOS5.2でPerlのSRPMがビルドに失敗した件
初めてさくらで専用サーバを借りたらCentOS5.2(i386)が入ってました。今まで作ったRPMとかはx86_64用だったので、そのへんも作り直しです。
んで、Perlを DBIC_NO_WARN_BAD_PERL=1 しなくてもいいように & @INCに/usr/local/CPANをデフォルトで追加しておきたかったのでRPMをビルドしなおそうと思ったら(過去エントリ:「Perlの@INCを指定してビルドする」「DBICが入らなくて、CentOS5.1でPerlのRPMリビルドした」)、コンパイルが通りませんでした。
ここから perl-5.8.8-10.el5_0.2.src.rpm を落としてきて、そのSPECファイルでそのまま
cd ~/rpm rpmbuild -bb SPECS/perl.spec
したら、こんな感じで失敗。
Making IO (dynamic) Writing Makefile for IO make[1]: Entering directory `/home/ryo/rpm/BUILD/perl-5.8.8/ext/IO' make[1]: Leaving directory `/home/ryo/rpm/BUILD/perl-5.8.8/ext/IO' make[1]: Entering directory `/home/ryo/rpm/BUILD/perl-5.8.8/ext/IO' cp lib/IO/Pipe.pm ../../lib/IO/Pipe.pm cp lib/IO/File.pm ../../lib/IO/File.pm cp lib/IO/Select.pm ../../lib/IO/Select.pm cp lib/IO/Socket/INET.pm ../../lib/IO/Socket/INET.pm cp lib/IO/Socket.pm ../../lib/IO/Socket.pm cp lib/IO/Poll.pm ../../lib/IO/Poll.pm cp lib/IO/Socket/UNIX.pm ../../lib/IO/Socket/UNIX.pm cp lib/IO/Handle.pm ../../lib/IO/Handle.pm cp lib/IO/Dir.pm ../../lib/IO/Dir.pm cp lib/IO/Seekable.pm ../../lib/IO/Seekable.pm cp IO.pm ../../lib/IO.pm ../../miniperl "-I../../lib" "-I../../lib" ../../lib/ExtUtils/xsubpp -typemap ../../lib/ExtUtils/typemap IO.xs > IO.xsc && mv IO.xsc IO.c gcc -c -D_REENTRANT -D_GNU_SOURCE -fno-strict-aliasing -pipe -Wdeclaration-after-statement -I/usr/local/include -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -I/usr/include/gdbm -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -DVERSION=\"1.22\" -DXS_VERSION=\"1.22\" -fPIC "-I../.." IO.c IO.xs: In function 'XS_IO__Poll__poll': IO.xs:238: error: invalid application of 'sizeof' to incomplete type 'struct pollfd' IO.xs:242: error: invalid use of undefined type 'struct pollfd' IO.xs:242: error: dereferencing pointer to incomplete type IO.xs:244: error: invalid use of undefined type 'struct pollfd' IO.xs:244: error: dereferencing pointer to incomplete type IO.xs:246: error: invalid use of undefined type 'struct pollfd' IO.xs:246: error: dereferencing pointer to incomplete type IO.xs:248: warning: implicit declaration of function 'poll' IO.xs:250: error: invalid use of undefined type 'struct pollfd' IO.xs:250: error: dereferencing pointer to incomplete type IO.xs:251: error: invalid use of undefined type 'struct pollfd' IO.xs:251: error: dereferencing pointer to incomplete type make[1]: *** [IO.o] Error 1 make[1]: Leaving directory `/home/ryo/rpm/BUILD/perl-5.8.8/ext/IO' make: *** [lib/auto/IO/IO.so] Error 2 エラー: /var/tmp/rpm-tmp.69306 の不正な終了ステータス (%build) RPM ビルドエラー: /var/tmp/rpm-tmp.69306 の不正な終了ステータス (%build)
「XS_IO__Poll__poll」とか「perl IO.xs」とかでググってもあんまり情報が出てこない。古いバージョンで、外人がビルドできNeeeeeee!!って言ってるぐらい。
CentOS5.0(x86_64)環境だと何も問題なく通るんだけどなぁ。5.2のx86_64とか、5.1のi386環境を作って試してみた方がいいのかも知れんけど、めんどくせぇなー
(2008/10/19追記)/usr/src/redhat/以下に落として、root権限でrpmbuildしたら通りました。環境の問題ではありませんでした。
にしても、CentOS5.2はyumが爆速で気持ちいいねぇ。これだけでも上げる価値あるかも。