Solution: warning: `MCRYPT_FAILED' redefined

From: Date: Fri, 10 Nov 2000 00:57:33 +0000
Subject: Solution: warning: `MCRYPT_FAILED' redefined
References: 1  Groups: php.install 
Request: Send a blank email to php-install+get-705@lists.php.net to get a copy of this message
I have determined the cause of this problem. The algorithm that ext/mcrypt/config.m4 uses to determine if libmcrypt version 2.2 or 2.4 is installed is flawed. I'm fairly sure this problem only occurs when you configure --with-java. When building PHP DSO module: configure says: checking for init_mcrypt in -lmcrypt... no configure says: checking for mcrypt_module_open in -lmcrypt... yes init_mcrypt is incorrectly assumed to not exist because conftest fails to compile: /usr/lib/libmcrypt.so: undefined reference to `lt_dlerror' /usr/lib/libmcrypt.so: undefined reference to `lt_dlclose' /usr/lib/libmcrypt.so: undefined reference to `lt_dlexit' /usr/lib/libmcrypt.so: undefined reference to `lt_dlopen' /usr/lib/libmcrypt.so: undefined reference to `lt_dlsetsearchpath' /usr/lib/libmcrypt.so: undefined reference to `lt_dlopenext' /usr/lib/libmcrypt.so: undefined reference to `lt_dlsym' /usr/lib/libmcrypt.so: undefined reference to `lt_dlinit' mcrypt_module_open is found because for this test conftest is linked against -lltdl. When building PHP CGI module: configure says: checking for init_mcrypt in -lmcrypt... yes configure says: checking for mcrypt_module_open in -lmcrypt... yes init_mcrypt is found this time because conftest is linked against -lkaffevm. mcrypt_module_open is found again because conftest is linked against -lkaffevm and -lltdl. To get conftest to build in both cases you must always link against -lltdl when compiling with -lmcrypt. This solves the first problem of determining when init_mcrypt and mcrypt_module_open are available. The second problem is with the algorithm. The algorithm assumes that if init_mcrypt exists, you must have 2.2 installed and thus defines HAVE_LIBMCRYPT22. This will keep PHP from building if you are using 2.4. My solution was to change configure to always link against -lltdl for the mcrypt tests and to decide that you have 2.2 only when init_mcrypt is found and mcrypt_module_open is not. I did not do enough work to determine why -lkaffevm is not linked when compiling PHP DSO module. Lance -----Original Message----- From: Lance Lovette [mailto:lance-php@dailyrating.com] Sent: Thursday, November 09, 2000 12:49 PM To: php-general@lists.php.net Subject: [PHP] Update: DSO compiles, CGI does not Compiling PHP as a DSO module works but I run into trouble with mcrypt when I remove the --with-apxs configure option to build the CGI version. The problem most likely has something to do with the HAVE_LIBMCRYPT options in php_config.h. Why is configure changing it's mind? DSO php_config.h has #define HAVE_LIBMCRYPT24 1 CGI php_config.h has #define HAVE_LIBMCRYPT22 1 Has anyone successfully compiled libmcrypt 2.4.6 with php 4.0.3pl1? I compared the output of configure when building the DSO module and CGI module. Most of the differences make sense except the difference in 'checking for init_mcrypt'. When configuring the DSO the answer is YES and for CGI it is NO. Why is configure being inconsistent? The relevant archives I am using: php-4.0.3pl1.tar.gz libmcrypt-2.4.6.tar.gz Configure options: ./configure \ --prefix=/usr \ --with-config-file-path=/etc/httpd/conf \ --with-mysql=/usr \ --with-imap=/usr \ --with-mcrypt=/usr \ --with-xml \ --with-java \ --with-gd=/usr \ --with-ttf=/usr \ --with-zlib=/usr \ --with-jpeg-dir=/usr \ --with-png-dir=/usr \ --with-zlib-dir=/usr \ --enable-wddx \ --enable-sysvsem \ --enable-sysvshm The error messages: mcrypt.c:222: warning: `MCRYPT_FAILED' redefined /usr/include/mcrypt.h:30: warning: this is the location of the previous definition mcrypt.c: In function `php_minit_mcrypt': mcrypt.c:260: `MCRYPT_BLOWFISH_448' undeclared (first use in this function) mcrypt.c:260: (Each undeclared identifier is reported only once mcrypt.c:260: for each function it appears in.) mcrypt.c:261: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:262: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:263: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:264: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:265: `MCRYPT_SAFER_64' undeclared (first use in this function) mcrypt.c:266: `MCRYPT_SAFER_128' undeclared (first use in this function) mcrypt.c:267: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:268: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:269: `MCRYPT_RC2_1024' undeclared (first use in this function) mcrypt.c:270: `MCRYPT_TWOFISH_128' undeclared (first use in this function) mcrypt.c:271: `MCRYPT_TWOFISH_192' undeclared (first use in this function) mcrypt.c:272: `MCRYPT_TWOFISH_256' undeclared (first use in this function) mcrypt.c:273: `MCRYPT_BLOWFISH_128' undeclared (first use in this function) mcrypt.c:274: `MCRYPT_BLOWFISH_192' undeclared (first use in this function) mcrypt.c:275: `MCRYPT_BLOWFISH_256' undeclared (first use in this function) mcrypt.c:276: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:277: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:278: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:279: `MCRYPT_SERPENT_128' undeclared (first use in this function) mcrypt.c:280: `MCRYPT_SERPENT_192' undeclared (first use in this function) mcrypt.c:281: `MCRYPT_SERPENT_256' undeclared (first use in this function) mcrypt.c:282: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:283: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:284: warning: passing arg 3 of `zend_register_long_constant' makes integer from pointer without a cast mcrypt.c:285: `MCRYPT_RC2_256' undeclared (first use in this function) mcrypt.c:286: `MCRYPT_RC2_128' undeclared (first use in this function) mcrypt.c:287: `MCRYPT_RC6_256' undeclared (first use in this function) mcrypt.c:288: `MCRYPT_IDEA' undeclared (first use in this function) mcrypt.c:289: `MCRYPT_RC6_128' undeclared (first use in this function) mcrypt.c:290: `MCRYPT_RC6_192' undeclared (first use in this function) mcrypt.c:291: `MCRYPT_RC4' undeclared (first use in this function) mcrypt.c: In function `php_if_mcrypt_get_cipher_name': mcrypt.c:1500: warning: assignment makes pointer from integer without a cast make[3]: *** [mcrypt.lo] Error 1 make[3]: Leaving directory `/usr/local/src/php-4.0.3pl1/ext/mcrypt' make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory `/usr/local/src/php-4.0.3pl1/ext/mcrypt' make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory `/usr/local/src/php-4.0.3pl1/ext' make: *** [all-recursive] Error 1 Difference in configure output: < DSO > CGI 37c37,38 < checking for Apache module support via DSO through APXS... yes --- > checking for Apache module support via DSO through APXS... no > checking for Apache module support... no 38a40,41 > checking whether to force Apache CGI redirect... no > checking whether to discard path_info + path_translated... no 47c50 < checking for chosen SAPI module... apache --- > checking for chosen SAPI module... cgi 242c245 < checking for init_mcrypt in -lmcrypt... no --- > checking for init_mcrypt in -lmcrypt... yes 377,378c380,381 < checking whether to build shared libraries... yes < checking whether to build static libraries... no --- > checking whether to build shared libraries... no > checking whether to build static libraries... yes 383a387,415 > Configuring shared libtool > loading cache ./config.cache within ltconfig > checking host system type... i686-pc-linux-gnu > checking for ranlib... ranlib > checking for gcc... gcc > checking whether we are using GNU C... yes > checking for object suffix... o > checking for executable suffix... (cached) no > checking for gcc option to produce PIC... -fPIC > checking if gcc PIC flag -fPIC works... yes > checking if gcc supports -c -o file.o... yes > checking if gcc supports -c -o file.lo... yes > checking if gcc supports -fno-rtti -fno-exceptions ... yes > checking if gcc static flag -static works... -static > checking whether ln -s works... yes > checking for ld used by GCC... /usr/bin/ld > checking if the linker (/usr/bin/ld) is GNU ld... yes > checking whether the linker (/usr/bin/ld) supports shared libraries... yes > checking for BSD-compatible nm... /usr/bin/nm -B > checking command to parse /usr/bin/nm -B output... ok > checking how to hardcode library paths into programs... immediate > checking for /usr/bin/ld option to reload object files... -r > checking dynamic linker characteristics... Linux ld.so > checking if libtool supports shared libraries... yes > checking whether to build shared libraries... yes > checking whether to build static libraries... no > checking for objdir... .libs > creating shlibtool > 421c453 < creating sapi/apache/Makefile --- > creating sapi/cgi/Makefile Differences in php_config.h: < DSO > CGI 709c709 < #define HAVE_AP_CONFIG_H 1 --- > /* #undef HAVE_AP_CONFIG_H */ 712c712 < #define HAVE_AP_COMPAT_H 1 --- > /* #undef HAVE_AP_COMPAT_H */ 715c715 < #define HAVE_AP_CONFIG_H 1 --- > /* #undef HAVE_AP_CONFIG_H */ 718c718 < #define HAVE_AP_CONFIG_H 1 --- > /* #undef HAVE_AP_CONFIG_H */ 721c721 < #define HAVE_AP_COMPAT_H 1 --- > /* #undef HAVE_AP_COMPAT_H */ 727c727 < #define HAVE_AP_CONFIG_H 1 --- > /* #undef HAVE_AP_CONFIG_H */ 730c730 < #define HAVE_AP_COMPAT_H 1 --- > /* #undef HAVE_AP_COMPAT_H */ 736c736 < #define HAVE_AP_CONFIG_H 1 --- > /* #undef HAVE_AP_CONFIG_H */ 739c739 < #define HAVE_AP_COMPAT_H 1 --- > /* #undef HAVE_AP_COMPAT_H */ 745c745 < #define HAVE_AP_CONFIG_H 1 --- > /* #undef HAVE_AP_CONFIG_H */ 748c748 < #define HAVE_AP_COMPAT_H 1 --- > /* #undef HAVE_AP_COMPAT_H */ 757c757 < /* #undef FORCE_CGI_REDIRECT */ --- > #define FORCE_CGI_REDIRECT 0 760c760 < /* #undef DISCARD_PATH */ --- > #define DISCARD_PATH 0 1264c1264 < /* #undef HAVE_LIBMCRYPT22 */ --- > #define HAVE_LIBMCRYPT22 1 1267c1267 < #define HAVE_LIBMCRYPT24 1 --- > /* #undef HAVE_LIBMCRYPT24 */ -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net

« previous php.install (#705) next »