开发者

Why can't I build Perl modules that load Socket.so on Solaris 10?

I am trying to build Convert::ASN1 module but I get an error in the process. I am using Perl 5.12.0 on Solaris 10. perl Makefile.PL runs without trouble, same for make, but 'make test' throws this error:

MOST CRUCIAL PART OF IT IMO:

t/00prim.t ....... Can't load '/usr/local/lib/perl5/5.12.0/sun4-solari +s/auto/Socket
/Socket.so' for module Socket: ld.so.1: perl5.12.0: fata +l: 
relocation error: file /usr/local/lib/perl5/5.12.0/sun4-solaris/au +to/Socket/Socket.so:
 symbol inet_aton: referenced symbol not found at + /usr/local/lib/perl5/5.12.0/XSLoader.pm
 line 70.

Same error occured when I tried to install IO::Socket. I think something must be wrong with the Socket core module. This is not a开发者_运维技巧ll of the error log but the main part.


Note: this answer is pure conjecture as I don't have a Solaris machine to test this on.

It looks like Solaris doesn't put inet_aton in libsocket, which is presumably what is being linked against when you build Socket. Instead, it looks like you need to add -lresolv to the LIBS line in the Makefile (I don't know if this is in the Makefile.PL for Socket...).

Like I said, this is pure conjecture. I'm pulling this answer mostly from this bug report for DBMail. I hope it gets you somewhere, though.


I don't have a Perl 5.12 installation, but I do have access to Solaris 10, and I can confirm that Solaris' libsocket does not have inet_aton (it has inet_pton instead).

But the resolver library (libresolv) does have inet_aton, so a workaround may be to add

-lresolv

to the Makefile's LDFLAGS, and build/install it yourself outside of cpan.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜