I just wanted to build PHP7 with enable-dmalloc
enveronment:
the version of PHP is 7.1.0RC5
debian 8
gcc6.2
dmalloc 5.5.2
used this command:
./configure --prefix=/usr/local/php/70 --with-config-file-path=/usr/local/lib/php/70/etc --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --with-apxs2=/usr/local/httpd/2.4/bin/apxs --with-mysqli=/usr/local/mysql/bin/mysql_config --with-pgsql=/usr/local/PostgreSQL/9.5 --with-pdo-mysql=/usr/local/mysql --with-pdo-pgsql=/usr/local/PostgreSQL/ --enable-ftp --enable-zip --with-bz2 --with-iconv-dir --with-freetype-dir --with-jpeg-dir --with-png-dir -with-zlib --enable-bcmath --with-curl --enable-mbregex --enable-mbstring --with-mcrypt --with-gd --with-freetype-dir --enable-gd-native-ttf --with-mhash --enable-pcntl --enable-sockets --with-xmlrpc --enable-exif --enable-debug --enable-phpdbg --enable-phpdbg-webhelper --enable-phpdbg-debug --enable-dtrace --enable-dmalloc --with-openssl --enable-shmop --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-pear --enable-maintainer-zts
make
but it failed with the the Error Message:
/usr/include/malloc.h:38:35: error: expected declaration specifiers or ‘...’ before string constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:35: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
In file included from /usr/local/src/php-7.1.0RC5/main/php.h:26:0,
from /usr/local/src/php-7.1.0RC5/ext/gd/libgd/gdhelpers.h:5,
from /usr/local/src/php-7.1.0RC5/ext/gd/libgd/gdft.c:13:
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before ‘(’ token extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:38:14: error: expected declaration specifiers or ‘...’ before numeric constant extern void *malloc (size_t __size) __THROW __attribute_malloc__ __wur;
/usr/include/malloc.h:41:51: error: expected declaration specifiers or ‘...’ before string constant extern void *calloc (size_t __nmemb, size_t __size)
/usr/include/malloc.h:49:49: error: expected declaration specifiers or ‘...’ before string constant extern void *realloc (void *__ptr, size_t __size)
/usr/include/malloc.h:53:30: error: expected declaration specifiers or ‘...’ before string constant extern void free (void *__ptr) __THROW;
/usr/include/malloc.h:59:57: error: expected declaration specifiers or ‘...’ before string constant extern void *memalign (size_t __alignment, size_t __size)
/usr/include/malloc.h:63:35: error: expected declaration specifiers or ‘...’ before string constant extern void *valloc (size_t __size) __THROW __attribute_malloc__ __wur;
Makefile:1028: recipe for target 'ext/gd/libgd/gdft.lo' failed
make: *** [ext/gd/libgd/gdft.lo] Error 1
I see the source code in gdft.c, gdhelper.h and php.h, found this line:
#ifdef HAVE_DMALLOC
#include <dmalloc.h>
#endif
it maybe dmalloc caused this error, but I don't know why the error msg show malloc.h, I checked /usr/include
, it has malloc.h
and dmalloc.h
two files
I install the package libdmalloc and libdmalloc-dev and I try to reinstall dmalloc with sourcecode but it's not helpful
What are the causes of these and how do I deal it ?