PHP7 does not compile on arm64 (OrangePI PC2)

671 Views Asked by At

I am trying to write a PHP program which requires pthreads on an Orange PI PC2. pthreads requires zts, which is not normally included in PHP but easy to add during build time.

Unfortunately, I get the following error when trying to build PHP 7. I've tried 7.0.14 and 7.1. It all works perfect on a raspberry pi (not 64 bit). Does anyone know how to fix this error?

orangepi@Orangepi:~/php-7.1.0$ make -j2
/bin/bash /home/orangepi/php-7.1.0/libtool --silent --preserve-dup-deps --mode=compile /home/orangepi/php-7.1.0/meta_ccld -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/opcache/ -I/home/orangepi/php-7.1.0/ext/opcache/ -DPHP_ATOM_INC -I/home/orangepi/php-7.1.0/include -I/home/orangepi/php-7.1.0/main -I/home/orangepi/php-7.1.0 -I/home/orangepi/php-7.1.0/ext/date/lib -I/usr/include/libxml2 -I/home/orangepi/php-7.1.0/ext/sqlite3/libsqlite -I/home/orangepi/php-7.1.0/TSRM -I/home/orangepi/php-7.1.0/Zend  -D_REENTRANT  -I/usr/include -g -O2 -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS    -c /home/orangepi/php-7.1.0/ext/opcache/ZendAccelerator.c -o ext/opcache/ZendAccelerator.lo 
/bin/bash /home/orangepi/php-7.1.0/libtool --silent --preserve-dup-deps --mode=compile /home/orangepi/php-7.1.0/meta_ccld -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/opcache/ -I/home/orangepi/php-7.1.0/ext/opcache/ -DPHP_ATOM_INC -I/home/orangepi/php-7.1.0/include -I/home/orangepi/php-7.1.0/main -I/home/orangepi/php-7.1.0 -I/home/orangepi/php-7.1.0/ext/date/lib -I/usr/include/libxml2 -I/home/orangepi/php-7.1.0/ext/sqlite3/libsqlite -I/home/orangepi/php-7.1.0/TSRM -I/home/orangepi/php-7.1.0/Zend  -D_REENTRANT  -I/usr/include -g -O2 -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS    -c /home/orangepi/php-7.1.0/ext/opcache/zend_accelerator_blacklist.c -o ext/opcache/zend_accelerator_blacklist.lo 
mkdir: cannot create directory 'ext/opcache/.libs': File exists
/bin/bash /home/orangepi/php-7.1.0/libtool --silent --preserve-dup-deps --mode=compile /home/orangepi/php-7.1.0/meta_ccld -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/opcache/ -I/home/orangepi/php-7.1.0/ext/opcache/ -DPHP_ATOM_INC -I/home/orangepi/php-7.1.0/include -I/home/orangepi/php-7.1.0/main -I/home/orangepi/php-7.1.0 -I/home/orangepi/php-7.1.0/ext/date/lib -I/usr/include/libxml2 -I/home/orangepi/php-7.1.0/ext/sqlite3/libsqlite -I/home/orangepi/php-7.1.0/TSRM -I/home/orangepi/php-7.1.0/Zend  -D_REENTRANT  -I/usr/include -g -O2 -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS    -c /home/orangepi/php-7.1.0/ext/opcache/zend_accelerator_debug.c -o ext/opcache/zend_accelerator_debug.lo 
/bin/bash /home/orangepi/php-7.1.0/libtool --silent --preserve-dup-deps --mode=compile /home/orangepi/php-7.1.0/meta_ccld -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/opcache/ -I/home/orangepi/php-7.1.0/ext/opcache/ -DPHP_ATOM_INC -I/home/orangepi/php-7.1.0/include -I/home/orangepi/php-7.1.0/main -I/home/orangepi/php-7.1.0 -I/home/orangepi/php-7.1.0/ext/date/lib -I/usr/include/libxml2 -I/home/orangepi/php-7.1.0/ext/sqlite3/libsqlite -I/home/orangepi/php-7.1.0/TSRM -I/home/orangepi/php-7.1.0/Zend  -D_REENTRANT  -I/usr/include -g -O2 -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS    -c /home/orangepi/php-7.1.0/ext/opcache/zend_accelerator_hash.c -o ext/opcache/zend_accelerator_hash.lo 
/bin/bash /home/orangepi/php-7.1.0/libtool --silent --preserve-dup-deps --mode=compile /home/orangepi/php-7.1.0/meta_ccld -DZEND_ENABLE_STATIC_TSRMLS_CACHE=1 -Iext/opcache/ -I/home/orangepi/php-7.1.0/ext/opcache/ -DPHP_ATOM_INC -I/home/orangepi/php-7.1.0/include -I/home/orangepi/php-7.1.0/main -I/home/orangepi/php-7.1.0 -I/home/orangepi/php-7.1.0/ext/date/lib -I/usr/include/libxml2 -I/home/orangepi/php-7.1.0/ext/sqlite3/libsqlite -I/home/orangepi/php-7.1.0/TSRM -I/home/orangepi/php-7.1.0/Zend  -D_REENTRANT  -I/usr/include -g -O2 -fvisibility=hidden -pthread -DZTS -DZEND_SIGNALS    -c /home/orangepi/php-7.1.0/ext/opcache/zend_accelerator_module.c -o ext/opcache/zend_accelerator_module.lo 
/tmp/ccuWeYfe.s: Assembler messages:
/tmp/ccuWeYfe.s:951: Error: operand 3 should be an integer register -- `mul x1,x1,1048576'
/tmp/ccuWeYfe.s:952: Error: operand 3 should be an integer register -- `smulh x0,x1,1048576'
Makefile:1000: recipe for target 'ext/opcache/zend_accelerator_module.lo' failed
make: *** [ext/opcache/zend_accelerator_module.lo] Error 1
make: *** Waiting for unfinished jobs....

I've searched everywhere, and only found a similar documented issue, but still cannot get past this.

1

There are 1 best solutions below

0
On

Bug #73898, this has been fixed in both 7.0.15 and 7.1.1 (I just verified both).