我正在使用AIX 7.1并且由于多个“符号X(编号Y)没有从依赖模块导出而导致链接问题”。
错误
Could not load program openssl:
Symbol resolution failed for /apps/10.00/openssl/product/openssl-1.0.2f/lib/libssl.so because:
Symbol EC_curve_nist2nid (number 73) is not exported from dependent
module /apps/tuxedo/product/12.1/lib/libcrypto.so.
Symbol EVP_aes_256_cbc_hmac_sha256 (number 274) is not exported from dependent
module /apps/tuxedo/product/12.1/lib/libcrypto.so.
Symbol EVP_aes_128_cbc_hmac_sha256 (number 275) is not exported from dependent
module /apps/tuxedo/product/12.1/lib/libcrypto.so.
Symbol X509_get_signature_nid (number 282) is not exported from dependent
module /apps/tuxedo/product/12.1/lib/libcrypto.so.
Symbol X509_chain_up_ref (number 312) is not exported from dependent
module /apps/tuxedo/product/12.1/lib/libcrypto.so.
Symbol X509_chain_check_suiteb (number 313) is not exported from dependent
module /apps/tuxedo/product/12.1/lib/libcrypto.so.
以下是依赖关系:
$ ldd `which openssl`
/cb/cb10b/rel/server/bin/openssl needs:
/apps/10.00/openssl/product/openssl-1.0.2f/lib/libssl.so
/apps/tuxedo/product/12.1/lib/libcrypto.so
/usr/lib/libpthreads.a(shr_xpg5_64.o)
/usr/lib/libc.a(shr_64.o)
/unix
可以看出libcrypto.so来自tuxedo而不是openssl。 所以我导出LIBPATH在tuxedo库之前有更多的openssl。这会将ldd输出更改为: -
export LIBPATH=/apps/10.00/openssl/product/openssl-1.0.2f/lib:$LIBPATH
$ ldd `which openssl`
/cb/cb10b/rel/server/bin/openssl needs:
/apps/10.00/openssl/product/openssl-1.0.2f/lib/libssl.so
/apps/10.00/openssl/product/openssl-1.0.2f/lib/libcrypto.so
/usr/lib/libpthreads.a(shr_xpg5_64.o)
/usr/lib/libc.a(shr_64.o)
/unix
/usr/lib/libcrypt.a(shr_64.o)
虽然ldd输出显示从openssl目录中选择的依赖库。但是,当我运行脚本时,我仍然得到与上面相同的错误。当我将libcrypto.so重命名为其他东西时(比如libcrypto.s.bkp),然后在选择从openssl运行libcrypto.so时,显然有一些东西导致首先在Tuxedo目录中搜索libcrypto.so后来在openssl目录中。
我不知道是什么导致tuxedo库的优先级高于openssl库。
答案 0 :(得分:1)
我正在静态链接(不共享)并解决了它: -
OPENSSL_VERSION=openssl-1.0.2f
On AIX:
./Configure aix64-cc --prefix=$INSTALLDIR/openssl/product/$OPENSSL_VERSION --openssldir=$INSTALLDIR/openssl/product/$OPENSSL_VERSION/openssl threads no-shared
编辑: 此外,由于我已经在SunOs上安装了它,所以这是指令
./Configure solaris64-sparcv9-cc --prefix=$INSTALLDIR/openssl/product/$OPENSSL_VERSION --openssldir=$INSTALLDIR/openssl/product/$OPENSSL_VERSION/openssl threads no-shared -KPIC