6

Hi I am trying to install Apache 2.4.23 with openssl version of 1.1.0c , while execute make command I am getting following error, I have searched many website but I couldn't see any relevant answer. I have attached error also .Could you please solve my problem?

./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

Thanks in Advance

Manuel
  • 433
  • 1
  • 8
  • 19
Kalanidhi
  • 4,902
  • 27
  • 42

2 Answers2

5

Apache 2.4.23 undefined reference to CRYPTO_malloc_init?

OpenSSL 1.0.2 and earlier provided 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 and later do not appear to provide CRYPTO_malloc_init:

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

Also see Apache Issue 60061 - OpenSSL 1.1.0 support.

jww
  • 97,681
  • 90
  • 411
  • 885
  • How to over come the problem or Shall I install `OpenSSL 1.0.2h` ? – Kalanidhi Nov 15 '16 at 10:00
  • 2
    Well, I think you have three choices. First is to use 1.0.2. Second is to use Apache tip in SVN. Third is to modify Apache 2.4 sources. I would personally probably use (1) until Apache catches up. I would personally avoid (3) because there's no telling how deep the rabbit hole goes. But you have to do what works for you. I shouldn't bikeshed the solution because what works for me may not work for you. – jww Nov 15 '16 at 10:39
1

There is a patch for httpd 2.4.23 in archlinux user repository which deals with differences between different openssl versions. Among other things it modifies ab.c in the following way:

@@ -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();

I applied the whole patch and the build succeeded.

P.S.: when having problems building popular software from source it might be helpful to look at how your distribution biulds the package (find the PKGFILE/specfile/rules, etc.).

Vladislav Ivanishin
  • 2,092
  • 16
  • 22