Skip to content

Cannot compile with php-7.0.0alpha1 #173

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
HansVanEijsden opened this issue Jun 12, 2015 · 6 comments
Closed

Cannot compile with php-7.0.0alpha1 #173

HansVanEijsden opened this issue Jun 12, 2015 · 6 comments

Comments

@HansVanEijsden
Copy link

I'm not able to compile it with php-7.0.0alpha1.

uname -a

Linux vps 3.16.0-0.bpo.4-amd64 #1 SMP Debian 3.16.7-ckt9-3deb8u1bpo70+1 (2015-04-27) x86_64 GNU/Linux

icc -v

icc version 15.0.1 (gcc version 4.7.0 compatibility)

source /opt/intel/bin/compilervars.sh intel64
export PATH=/usr/lib/ccache:$PATH
CC=icc
CFLAGS="-xHOST -O3 -ip -no-prec-div -qopenmp -pthread -unroll-aggressive -qopt-prefetch"
LD=xild
AR=xiar
CXX=icpc
CXXFLAGS="-xHOST -O3 -ip -no-prec-div -qopenmp -pthread -unroll-aggressive -qopt-prefetch"
LDFLAGS="-ljemalloc"
export CC CFLAGS LD AR CXX CXXFLAGS LDFLAGS

Configure:

./configure --prefix=/opt/7.0.0alpha1 --with-libdir=/lib/x86_64-linux-gnu --enable-fpm --with-fpm-user=www-data --with-fpm-group=www-data --disable-cgi --with-libxml-dir=/usr --with-openssl --with-kerberos --with-pcre-regex --with-zlib --with-zlib-dir=/usr/local --enable-bcmath --with-bz2 --enable-calendar --with-curl --enable-exif --enable-ftp --with-gd --with-vpx-dir=/usr --with-jpeg-dir=/usr --with-png-dir=/usr --with-xpm-dir=/usr --with-freetype-dir --enable-gd-native-ttf --enable-gd-jis-conv --with-gettext --with-mhash --with-imagick --with-imap --with-kerberos --with-imap-ssl --enable-intl --with-ldap --with-ldap-sasl --enable-mbstring --enable-memcached --enable-memcached-msgpack --enable-memcached-json --with-msgpack --with-mysqli --enable-opcache --enable-pcntl --with-pdo-mysql --with-pspell --with-readline --enable-soap --enable-sockets --enable-sysvmsg --enable-sysvsem --enable-sysvshm --with-tidy --with-xmlrpc --with-xsl --enable-zip --enable-wddx --enable-mysqlnd --with-pear --with-iconv --with-gmp --enable-inline-optimization --with-mcrypt --disable-rpath --enable-mbregex

Here the output:

/bin/bash /usr/local/src/php5-build/php-7.0.0alpha1/libtool --silent --preserve-dup-deps --mode=compile icc -I/usr/local/src/php5-build/php-7.0.0alpha1 -I/usr/local/src/php5-build/php-7.0.0alpha1 -Iext/memcached/ -I/usr/local/src/php5-build/php-7.0.0alpha1/ext/memcached/ -DPHP_ATOM_INC -I/usr/local/src/php5-build/php-7.0.0alpha1/include -I/usr/local/src/php5-build/php-7.0.0alpha1/main -I/usr/local/src/php5-build/php-7.0.0alpha1 -I/usr/local/src/php5-build/php-7.0.0alpha1/ext/date/lib -I/usr/include/libxml2 -I/usr/local/include -I/usr/X11 -I/usr/include/freetype2 -I/usr/include/ImageMagick -I/usr/include/c-client -I/usr/local/src/php5-build/php-7.0.0alpha1/ext/mbstring/oniguruma -I/usr/local/src/php5-build/php-7.0.0alpha1/ext/mbstring/libmbfl -I/usr/local/src/php5-build/php-7.0.0alpha1/ext/mbstring/libmbfl/mbfl -I/usr/local/src/php5-build/php-7.0.0alpha1/ext/sqlite3/libsqlite -I/usr/include/pspell -I/usr/include/tidy -I/usr/local/src/php5-build/php-7.0.0alpha1/ext/zip/lib -I/usr/local/src/php5-build/php-7.0.0alpha1/TSRM -I/usr/local/src/php5-build/php-7.0.0alpha1/Zend -I/usr/include -xHOST -O3 -ip -no-prec-div -qopenmp -pthread -unroll-aggressive -qopt-prefetch -c /usr/local/src/php5-build/php-7.0.0alpha1/ext/memcached/php_memcached.c -o ext/memcached/php_memcached.lo
/usr/local/src/php5-build/php-7.0.0alpha1/ext/memcached/php_memcached.c(3131): error: struct "" has no field "c"
if (!buf->c) {
^

/usr/local/src/php5-build/php-7.0.0alpha1/ext/memcached/php_memcached.c(3335): warning #2330: argument of type "const char *" is incompatible with parameter of type "char *" (dropping qualifiers)
php_json_decode(value, payload, payload_len, (serializer == SERIALIZER_JSON_ARRAY), JSON_PARSER_DEFAULT_DEPTH);
^

/usr/local/src/php5-build/php-7.0.0alpha1/ext/memcached/php_memcached.c(3346): warning #2330: argument of type "const char *" is incompatible with parameter of type "char *" (dropping qualifiers)
php_msgpack_unserialize(value, payload, payload_len);
^

compilation aborted for /usr/local/src/php5-build/php-7.0.0alpha1/ext/memcached/php_memcached.c (code 2)
make: *** [ext/memcached/php_memcached.lo] Fout 1

@HansVanEijsden
Copy link
Author

Edit: I see #172 now, possibly related?
If yes, I'm sorry for the duplicate.

@HansVanEijsden
Copy link
Author

By removing --enable-memcached-msgpack and --enable-memcached-json things go further, but in the end the code still doesn't compile.

The output (linking stage, on the end):

ext/memcached/.libs/php_memcached.o: In function zim_Memcached___construct': /usr/local/src/php5-build/php-7.0.0alpha1/ext/memcached/php_memcached.c:(.text+0x831): undefined reference toZEND_CTOR_MAKE_NULL'
ext/memcached/.libs/php_memcached.o: In function zim_Memcached___construct': /usr/local/src/php5-build/php-7.0.0alpha1/ext/memcached/php_memcached.c:(.text+0x831): undefined reference toZEND_CTOR_MAKE_NULL'
make: *** [sapi/cli/php] Fout 1

@givanz
Copy link

givanz commented Jun 15, 2015

You only need to remove the obsolete

ZEND_CTOR_MAKE_NULL();

in php_memcached.c line 411 to compile succesfully.

@HansVanEijsden
Copy link
Author

Thank you, very much!

@acrolink
Copy link

I am getting a lot of errors under latest PHP (compiled today from php-src) (PHP 7). Errors like:

/usr/include/php/Zend/zend_smart_str_public.h:25:3: error: conflicting types for ‘smart_str’
 } smart_str;
   ^
In file included from /usr/include/php/ext/standard/php_smart_str.h:24:0,
                 from /home/user/apps/php-memcached/php_memcached_private.h:44,
                 from /home/user/apps/php-memcached/php_memcached.c:26:
/usr/include/php/ext/standard/php_smart_str_public.h:30:3: note: previous declaration of ‘smart_str’ was here
 } smart_str;
   ^
/home/user/apps/php-memcached/php_memcached.c: In function ‘OnUpdateCompressionType’:
/home/user/apps/php-memcached/php_memcached.c:247:2: warning: passing argument 1 of ‘strlen’ from incompatible pointer type [enabled by default]
  } else if (!strcmp(new_value, "fastlz")) {
  ^
In file included from /usr/include/php/main/../main/php_config.h:2483:0,
                 from /usr/include/php/Zend/zend_config.h:1,
                 from /usr/include/php/Zend/zend_portability.h:48,
                 from /usr/include/php/Zend/zend_types.h:26,
                 from /usr/include/php/Zend/zend.h:31,
                 from /usr/include/php/main/php.h:35,
                 from /home/user/apps/php-memcached/php_memcached.h:22,
                 from /home/user/apps/php-memcached/php_memcached.c:25:
/usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
 extern size_t strlen (const char *__s)
               ^
/home/user/apps/php-memcached/php_memcached.c:247:2: warning: passing argument 1 of ‘__builtin_strcmp’ from incompatible pointer type [enabled by default]
  } else if (!strcmp(new_value, "fastlz")) {
  ^
/home/user/apps/php-memcached/php_memcached.c:247:2: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
/home/user/apps/php-memcached/php_memcached.c:247:2: warning: passing argument 1 of ‘strlen’ from incompatible pointer type [enabled by default]
In file included from /usr/include/php/main/../main/php_config.h:2483:0,
                 from /usr/include/php/Zend/zend_config.h:1,
                 from /usr/include/php/Zend/zend_portability.h:48,
                 from /usr/include/php/Zend/zend_types.h:26,
                 from /usr/include/php/Zend/zend.h:31,
                 from /usr/include/php/main/php.h:35,
                 from /home/user/apps/php-memcached/php_memcached.h:22,
                 from /home/user/apps/php-memcached/php_memcached.c:25:
/usr/include/string.h:399:15: note: expected ‘const char *’ but argument is of type ‘struct zend_string *’
 extern size_t strlen (const char *__s)
               ^
/home/user/apps/php-memcached/php_memcached.c:247:2: warning: passing argument 1 of ‘__builtin_strcmp’ from incompatible pointer type [enabled by default]
  } else if (!strcmp(new_value, "fastlz")) {

Any idea how to solve these errors? Thanks.

@krakjoe
Copy link
Member

krakjoe commented Sep 2, 2015

You should be good to go, make sure when building php7 that you have ./vcsclean'd php-src, make sure when configuring php-memcached that you pass the correct php-config to ./configure ... this seems to be the root cause of this last error^.

Closing, 7 branch is buildable/runnable.

@krakjoe krakjoe closed this as completed Sep 2, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants