Apache 2.4.23未定义引用CRYPTO_malloc_init?

时间:2016-11-15 09:46:10

标签: linux apache openssl

您好我正在尝试使用openssl版本的1.1.0c安装Apache 2.4.23,而执行make命令我收到以下错误, 我搜索了很多网站,但我看不到任何相关的答案。我也附上了错误。你能解决我的问题吗?

./configure --prefix=/usr/local/apache2 --with-included-apr --enable-so  --with-ssl=/usr/local/openssl --enable-ssl=shared  --with-pcre=/usr/local/pcre/

make

ab.o: In function main': /usr/src/httpd-2.4.23/support/ab.c:2417:   undefined reference to `CRYPTO_malloc_init'
collect2: error: ld returned 1 exit status
Makefile:73: recipe for target 'ab' failed
make[2]: \*** [ab] Error 1
make[2]: Leaving directory '/usr/src/httpd-2.4.23/support' /usr/src/httpd-2.4.23/build/rules.mk:75: recipe for target 'all-recursive' failed
make[1]: \*** [all-recursive] Error 1
make[1]: Leaving directory '/usr/src/httpd-2.4.23/support' /usr/src/httpd-2.4.23/build/rules.mk:75: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

先谢谢

2 个答案:

答案 0 :(得分:4)

  

Apache 2.4.23对CRYPTO_malloc_init的未定义引用?

OpenSSL 1.0.2及更早版本提供了CRYPTO_malloc_init

openssl-1.0.2h$ grep -R CRYPTO_malloc_init *
apps/apps.h:                        do { do_pipe_sig(); CRYPTO_malloc_init(); \
apps/apps.h:                        do { do_pipe_sig(); CRYPTO_malloc_init(); \
crypto/crypto.h:# define CRYPTO_malloc_init()    CRYPTO_set_mem_functions(\
crypto/dh/dhtest.c:    CRYPTO_malloc_init();
crypto/ecdh/ecdhtest.c:    CRYPTO_malloc_init();
...

OpenSSL 1.1.0及更高版本似乎没有提供CRYPTO_malloc_init

openssl-1.1.0b$ grep -R CRYPTO_malloc_init *
openssl-1.1.0b$

另见Apache Issue 60061 - OpenSSL 1.1.0 support

答案 1 :(得分:0)

archlinux用户存储库中的httpd 2.4.23有patch,用于处理不同openssl版本之间的差异。除此之外,它还通过以下方式修改@@ -2465,7 +2499,11 @@ int main(int argc, const char * const argv[]) #ifdef RSAREF R_malloc_init(); #else +#if OPENSSL_VERSION_NUMBER < 0x10100000L CRYPTO_malloc_init(); +#else + OPENSSL_malloc_init(); +#endif #endif SSL_load_error_strings(); SSL_library_init();

{{1}}

我应用了整个补丁并且构建成功了。

P.S。:当从源代码构建流行软件时遇到问题,看看你的发行版如何生成包(找到PKGFILE / specfile / rules等)可能会有所帮助。

相关问题