haskell存储库的openssl的未定义参考错误

时间:2018-12-21 02:57:17

标签: haskell openssl haskell-stack libssl

我对Haskell完全陌生。我正在尝试建立https://github.com/wireapp/mls-server项目。运行make build时,出现未定义的引用错误:

Linking .stack-work/dist/x86_64-linux/Cabal-2.2.0.1/build/mls-server-test/mls-server-test ...
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o)(.text+0x69d): error: undefined reference to 'EVP_CIPHER_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o)(.text+0x7e5): error: undefined reference to 'EVP_CIPHER_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o)(.text+0x89d): error: undefined reference to 'EVP_CIPHER_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o)(.text+0x9e5): error: undefined reference to 'EVP_CIPHER_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziEVPziInternal_digestLazzily3_info: error: undefined reference to 'EVP_MD_CTX_create'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziEVPziInternal_digestLazzily3_info: error: undefined reference to 'EVP_MD_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziEVPziInternal_digestLazzily3_info: error: undefined reference to 'EVP_MD_CTX_destroy'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziEVPziInternal_digestLazzily3_info: error: undefined reference to 'EVP_MD_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Internal.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziEVPziInternal_digestLazzily3_info: error: undefined reference to 'EVP_MD_CTX_destroy'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Store.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziX509ziStore_getStoreCtxChain1_info: error: undefined reference to 'X509_STORE_CTX_get_chain'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0x33): error: undefined reference to 'sk_new_null'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0xcc): error: undefined reference to 'sk_push'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0x1a2): error: undefined reference to 'sk_free'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0x242): error: undefined reference to 'sk_free'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0x3a2): error: undefined reference to 'sk_free'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0x41a): error: undefined reference to 'sk_free'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0xa6b): error: undefined reference to 'sk_value'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o)(.text+0xb73): error: undefined reference to 'sk_value'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Stack.o):HsOpenSSLzm0zi11zi4zi14zm1RUGvOiXKv4J8uIsPTtnnt_OpenSSLziStack_zdwmapStack_info: error: undefined reference to 'sk_num'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(X509.o)(.text+0x1dcf): error: undefined reference to 'X509_set_notBefore'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(X509.o)(.text+0x20cf): error: undefined reference to 'X509_set_notAfter'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Revocation.o)(.text+0x225f): error: undefined reference to 'X509_CRL_set_lastUpdate'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(Revocation.o)(.text+0x255f): error: undefined reference to 'X509_CRL_set_nextUpdate'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_init: error: undefined reference to 'SSL_load_error_strings'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_init: error: undefined reference to 'OPENSSL_add_all_algorithms_noconf'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_HMAC_CTX_new: error: undefined reference to 'HMAC_CTX_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_HMAC_CTX_free: error: undefined reference to 'HMAC_CTX_cleanup'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_num_locks'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_num_locks'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_set_locking_callback'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_set_id_callback'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_set_dynlock_create_callback'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_set_dynlock_lock_callback'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_init: error: undefined reference to 'SSL_library_init'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_X509_ref: error: undefined reference to 'CRYPTO_add_lock'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_X509_CRL_ref: error: undefined reference to 'CRYPTO_add_lock'
/home/euphoria/.stack/snapshots/x86_64-linux/lts-12.4/8.4.3/lib/x86_64-linux-ghc-8.4.3/HsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt/libHSHsOpenSSL-0.11.4.14-1RUGvOiXKv4J8uIsPTtnnt.a(HsOpenSSL.o):function HsOpenSSL_setupMutex: error: undefined reference to 'CRYPTO_set_dynlock_destroy_callback'
collect2: error: ld returned 1 exit status
`gcc' failed in phase `Linker'. (Exit code: 1)
Progress 1/2

--  While building package mls-server-0.1.0 using:
      /home/euphoria/.stack/setup-exe-cache/x86_64-linux/Cabal-simple_mPHDZzAJ_2.2.0.1_ghc-8.4.3 --builddir=.stack-work/dist/x86_64-linux/Cabal-2.2.0.1 build lib:mls-server exe:mls-server exe:mls-server-schema test:mls-server-test --ghc-options " -ddump-hi -ddump-to-file -fdiagnostics-color=always"
    Process exited with code: ExitFailure 1
Makefile:8: recipe for target 'build' failed
make: *** [build] Error 1

我尝试将openssl降级为1.0.1g。我也尝试过更新它。尽管一切,我仍然收到这些错误。不知道出了什么问题。

1 个答案:

答案 0 :(得分:0)

这应该可以帮助您解决问题。如果要获取现有的openssl备份,请确保使用此命令sudo mv /usr/bin/openssl /usr/bin/openssl.backup

进行备份

安装openssl-1.1.1g为我解决了这些链接程序问题。也许绑定期望使用此版本。

  $ sudo rm -rf /usr/bin/openssl /usr/share/man/man1/openssl.1ssl.gz
  $ wget https://www.openssl.org/source/openssl-1.1.1g.tar.gz
  $ tar -zxf openssl-1.1.1g.tar.gz && cd openssl-1.1.1g
  $ ./config
  $ sudo apt install make gcc
  $ make
  $ make test
  $ sudo make install
  $ sudo ln -s /usr/local/bin/openssl /usr/bin/openssl
  $ sudo ldconfig
  $ cd ..
  $ rm -rf openssl-1.1.1g*

如果上述所有步骤均成功完成,则您应该可以使用$ openssl version -a

查看版本详细信息

OpenSSL 1.1.1g 2020年4月21日 建立于:2020 UTC八月5日星期三07:16:04 平台:linux-x86_64 选项:bn(64,64)rc4(16x,int)des(int)idea(int)河豚(ptr) 编译器:GCC -fPIC -pthread -m64 -Wa, - noexecstack -Wall -O3 -DOPENSSL_USE_NODELETE -DL_ENDIAN -DOPENSSL_PIC -DOPENSSL_CPUID_OBJ -DOPENSSL_IA32_SSE2 -DOPENSSL_BN_ASM_MONT -DOPENSSL_BN_ASM_MONT5 -DOPENSSL_BN_ASM_GF2m -DSHA1_ASM -DSHA256_ASM -DSHA512_ASM -DKECCAK1600_ASM -DRC4_ASM -DMD5_ASM -DAESNI_ASM - DVPAES_ASM -DGHASH_ASM -DECP_NISTZ256_ASM -DX25519_ASM -DPOLY1305_ASM -DNDEBUG OPENSSLDIR:“ / usr / local / ssl” ENGINESDIR:“ / usr / local / lib / engines-1.1” 种子源:特定于操作系统