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

筅森魡賤 提交于 2019-12-22 12:29:42

问题


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 all of the error log but the main part.


回答1:


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.




回答2:


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.



来源:https://stackoverflow.com/questions/3751656/why-cant-i-build-perl-modules-that-load-socket-so-on-solaris-10

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!