无法安装Crypt-SSLeay模块

时间:2011-03-08 21:48:09

标签: perl openssl perl-module

我正在创建一个需要使用perl模块Crypt-SSLeay的Web应用程序。此模块具有需要OpenSSL头的依赖性。由于我的Linux服务器既没有通过这些步骤进行安装,但由于我的经验有限,我收到了一个难以理解的错误(见下文)。

服务器信息: 运行Oracle Enterprise Linux
Linux版本2.6.18-194.11.4.0.1.el5(mockbuild@ca-build9.us.oracle.com)(gcc版本4.1.2 20080704(Red Hat 4.1.2-48))

复制问题的步骤:
here下载并解压缩openssl 0.9.8r并运行以下命令(转到目录后)

./config --openssldir=/usr/local/openssl
make
make test
sudo make install

here下载并解压缩Crypt-SSLeay模块,然后运行以下命令(转到目录后)

 perl Makefile.PL
 make

运行“make”后,我收到以下错误:

BUILD INFORMATION
================================================
ssl library: OpenSSL 0.9.8r in /usr/local/openssl
ssl header:  openssl/ssl.h
libraries:   -L/usr/local/openssl/lib -lssl -lcrypto -lgcc
include dir: -I/usr/local/openssl/include
================================================
Note (probably harmless): No library found for -lgcc
Writing Makefile for Crypt::SSLeay
The test suite can attempt to connect to public servers
to ensure that the code is working properly. If you are
behind a strict firewall or have no network connectivity,
these tests may fail (through no fault of the code).
Do you want to run the live tests (y/N)? [N] 
-bash-3.2$ make
gcc -c  -I/usr/local/openssl/include -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 -m64 -mtune=generic   -DVERSION=\"0.58\" -DXS_VERSION=\"0.58\" -fPIC "-I/usr/lib64/perl5/5.8.8/x86_64-linux-thread-multi/CORE"   SSLeay.c
SSLeay.c: In function ‘XS_Crypt__SSLeay__CTX_new’:
SSLeay.c:118: warning: unused variable ‘packname’
SSLeay.c: In function ‘XS_Crypt__SSLeay__Conn_new’:
SSLeay.c:395: warning: unused variable ‘packname’
SSLeay.c: In function ‘XS_Crypt__SSLeay__CTX_use_pkcs12_file’:
SSLeay.c:287: warning: ‘RETVAL’ may be used uninitialized in this function
Running Mkbootstrap for Crypt::SSLeay ()
chmod 644 SSLeay.bs
rm -f blib/arch/auto/Crypt/SSLeay/SSLeay.so
gcc  -shared -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m64 -mtune=generic SSLeay.o  -o blib/arch/auto/Crypt/SSLeay/SSLeay.so     \
       -L/usr/local/openssl/lib -lssl -lcrypto      \

/usr/bin/ld: /usr/local/openssl/lib/libssl.a(s2_clnt.o): relocation R_X86_64_32 against `a local symbol' can not be used when making a shared object; recompile with -fPIC
/usr/local/openssl/lib/libssl.a: could not read symbols: Bad value
collect2: ld returned 1 exit status
make: *** [blib/arch/auto/Crypt/SSLeay/SSLeay.so] Error 1

当我重新编译OpenSSL以使该模块工作时,我不确定我需要做什么。任何帮助表示赞赏。

1 个答案:

答案 0 :(得分:2)

这看起来像OpenSSL构建本身的错误。您确定您的发行版不提供OpenSSL标头吗? (而且我确定你已经有了这些库,对吗?)

标题位于RedHat IIRC上名为“openssl-devel”的包中,对于Oracle Enterprise Linux应该是相同的(我猜,从未使用过)。

如果您确实在发行版的软件包中找到了标题,请不要忘记卸载自定义版本(如果OpenSSL Makefile没有卸载目标,请手动删除文件)。