AIX 7.1 上的多个 "Symbol X (number Y) is not exported from dependent module"

Multiple "Symbol X (number Y) is not exported from dependent module" on AIX 7.1

我正在使用 AIX 7.1,由于多个 "Symbol X (number Y) is not exported from dependent module".

而导致链接出现问题

错误

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。 所以我在 tuxedo 库之前导出了 LIBPATH 以拥有更多的 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 时,很明显有一些原因导致 libcrypto.so先在Tuxedo目录下搜索,再在openssl目录下搜索。

我不知道是什么导致 tuxedo 库的优先级高于 openssl 库。

我正在静态链接(非共享)并且已经解决了它:-

    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