无法使用OpenSSL 1.0.2k构建APR-util 1.5.4 [英] Cannot build APR-util 1.5.4 with OpenSSL 1.0.2k
问题描述
我首先使用以下步骤构建OpenSSL 1.0.2k:
我试图为Apache 2.2.32构建APR-util 1.5.6。 p>
./ config --prefix = / usr / local / ssl --openssldir = / usr / local / ssl
make
make test
make install
然后运行这些命令:
export LD_LIBRARY_PATH = / usr / local / lib
export LIBS = -ldl
我尝试使用以下命令来构建APR-util:
./ configure --with-apr = / usr / local / apr / bin / apr-1-config --with-crypto --with-openssl = / usr / local / ssl
make
配置成功完成,但失败并出现以下错误:
/ bin / sh / usr / local / apr / build-1 / libtool --silent --mode = link gcc -g -O2 -pthread -L / usr / local / ssl / lib -release 1 -module -rpath / usr / local / apr / lib / apr-util-1 -o crypto / apr_crypto_openssl.la crypto / apr_crypto_openssl.lo -L / usr / local / ssl / lib -lssl -lcrypto
/ usr / bin / ld:/usr/local/ssl/lib/libcrypto.a(mem.o):根据`.text'重定位R_X86_64_32S在制作共享对象时无法使用;使用-fPIC重新编译
/usr/local/ssl/lib/libcrypto.a:无法读取符号:值不正确
collect2:ld返回1退出状态
make [1]:** * [crypto / apr_crypto_openssl.la]错误1
请指教。感谢。
解决方案
我首先使用以下步骤构建OpenSSL 1.0.2k:
./ config --prefix = / usr / local / ssl --openssldir = / usr / local / ssl
make
make test $ b $ make install
您是 not 在这一步建立共享对象,所以这些对象缺少重定位数据。它最终导致:
/usr/local/ssl/lib/libcrypto.a(mem .o):重新定位R_X86_64_32S
使用共享对象
./ config shared --prefix = / usr / local / ssl --openssldir = / usr / local / ssl\
在这个配置中,OpenSSL将构建共享对象。它将为您启用
-fPIC
标志。
without Shared Object
./ config -fPIC --prefix = / usr / local / ssl --openssldir = / usr / local / ssl
在此配置中,您不构建共享对象。您必须启用
-fPIC
标志。
您应该考虑OpenSSL配置标志,例如
no-ssl2
,no-ssl3
和no-排版
。如果您正在使用64位英特尔机器,那么您还应该使用enable-ec_nistp_64_gcc_128
。另请参阅编译和安装|选项在OpenSSL wiki上。I'm trying to build APR-util 1.5.6 for Apache 2.2.32.
I first build OpenSSL 1.0.2k using the following steps:
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl make make test make install
I then ran these commands:
export LD_LIBRARY_PATH=/usr/local/lib export LIBS=-ldl
I attempted to build APR-util using these commands:
./configure --with-apr=/usr/local/apr/bin/apr-1-config --with-crypto --with-openssl=/usr/local/ssl make
Configure completes successfully, but make fails with the following error:
/bin/sh /usr/local/apr/build-1/libtool --silent --mode=link gcc -g -O2 -pthread -L/usr/local/ssl/lib -release 1 -module -rpath /usr/local/apr/lib/apr-util-1 -o crypto/apr_crypto_openssl.la crypto/apr_crypto_openssl.lo -L/usr/local/ssl/lib -lssl -lcrypto /usr/bin/ld: /usr/local/ssl/lib/libcrypto.a(mem.o): relocation R_X86_64_32S against `.text' can not be used when making a shared object; recompile with -fPIC /usr/local/ssl/lib/libcrypto.a: could not read symbols: Bad value collect2: ld returned 1 exit status make[1]: *** [crypto/apr_crypto_openssl.la] Error 1
Please advise. Thanks.
解决方案I first build OpenSSL 1.0.2k using the following steps:
./config --prefix=/usr/local/ssl --openssldir=/usr/local/ssl make make test make install
You are not building a shared object at this step, so the objects are missing relocation data. It eventually leads to:
/usr/local/ssl/lib/libcrypto.a(mem.o): relocation R_X86_64_32S
Configure like the following should clear the issue.
with Shared Object
./config shared --prefix=/usr/local/ssl --openssldir=/usr/local/ssl\
In this configuration, OpenSSL will build the shared object. It will enable the
-fPIC
flag for you.without Shared Object
./config -fPIC --prefix=/usr/local/ssl --openssldir=/usr/local/ssl
In this configuration, you are not building the shared object. You must enable the
-fPIC
flag.
There are other OpenSSL configuration flags you should consider, like
no-ssl2
,no-ssl3
andno-comp
. If you are working on a 64-bit Intel machine, then you should also useenable-ec_nistp_64_gcc_128
. Also see Compilation and Installation | Options on the OpenSSL wiki.这篇关于无法使用OpenSSL 1.0.2k构建APR-util 1.5.4的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!