Void-packages: php-mysql do not work on AARCH64

Created on 15 May 2020  路  11Comments  路  Source: void-linux/void-packages

System

Raspberry Pi 3B+

  • xuname: Void 4.19.81_1 aarch64 Unknown uptodate rF
  • package:
    php-7.4.6_1
    php-mysql-7.4.6_1

Expected behavior

mysqli and pdo_mysql extension work.

Actual behavior

mysqli and pdo_mysql not seen:

php -m
[PHP Modules]
Core
ctype
date
dba
dom
fileinfo
filter
hash
json
libxml
mbstring
mysqlnd
pcntl
pcre
PDO
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zlib

[Zend Modules]

Steps to reproduce the behavior

Install php and php-mysql.
Uncomment extension=mysqli and extension=pdo_mysql in /etc/php/php.ini

mysql extension work on my x86_64 PC:
Void 5.6.11_1 x86_64 GenuineIntel notuptodate rrFFF

php -m
[PHP Modules]
Core
ctype
date
dba
dom
fileinfo
filter
hash
json
libxml
mbstring
mysqli
mysqlnd
pcntl
pcre
PDO
pdo_mysql
readline
Reflection
session
SimpleXML
SPL
standard
tokenizer
xml
xmlreader
xmlwriter
zlib
bug

Most helpful comment

I think I found the solution, please test #22019 if it works for you.

All 11 comments

Can confirm on a RPI 3 B+.

similar to #21852, it looks like cross-built php can not load modules

You're right.
I've recompiled php with xbps-src directly on the rpi and installed only php package (php-mysql come from official repo) and it work well.

But the problem seems to only exist on glibc systems, see my comment in the other issue.

Running
% strace -e trace=open php -r 'print_r(get_loaded_extensions());'
on armv7l yields

--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x769a5380} ---
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x769a5368} ---
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x769a5370} ---
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x769a5378} ---
Array
(
    [0] => Core
    [1] => date
    [2] => libxml
    [3] => pcre
    [4] => zlib
    [5] => ctype
    [6] => dba
    [7] => dom
    [8] => fileinfo
    [9] => filter
    [10] => hash
    [11] => json
    [12] => mbstring
    [13] => pcntl
    [14] => SPL
    [15] => PDO
    [16] => readline
    [17] => Reflection
    [18] => session
    [19] => SimpleXML
    [20] => standard
    [21] => tokenizer
    [22] => xml
    [23] => xmlreader
    [24] => xmlwriter
    [25] => mysqlnd
)
+++ exited with 0 +++

The same command on armv7l-musl:

open("/etc/ld-musl-armhf.path", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libreadline.so.8", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libdb-5.3.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libgdbm.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libxml2.so.2", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libz.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libonig.so.5", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libcrypto.so.45", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libncursesw.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libicui18n.so.64", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libicuuc.so.64", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libicudata.so.64", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/liblzma.so.5", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libstdc++.so.6", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libgcc_s.so.1", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x769fb000} ---
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x769fafe8} ---
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x769faff0} ---
--- SIGILL {si_signo=SIGILL, si_code=ILL_ILLOPC, si_addr=0x769faff8} ---
open("/etc/localtime", O_RDONLY|O_NONBLOCK|O_LARGEFILE|O_CLOEXEC) = 3
open("/usr/bin/php-cli.ini", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/etc/php/php-cli.ini", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/usr/bin/php.ini", O_RDONLY|O_LARGEFILE) = -1 ENOENT (No such file or directory)
open("/etc/php/php.ini", O_RDONLY|O_LARGEFILE) = 3
open("/etc/php/conf.d", O_RDONLY|O_LARGEFILE|O_CLOEXEC|O_DIRECTORY) = -1 ENOENT (No such file or directory)
open("/usr/lib/php/modules/mysqli", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/php/modules/mysqli.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/usr/lib/php/modules/sqlite3", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = -1 ENOENT (No such file or directory)
open("/usr/lib/php/modules/sqlite3.so", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
open("/lib/libsqlite3.so.0", O_RDONLY|O_LARGEFILE|O_CLOEXEC) = 3
Array
(
    [0] => Core
    [1] => date
    [2] => libxml
    [3] => pcre
    [4] => zlib
    [5] => ctype
    [6] => dba
    [7] => dom
    [8] => fileinfo
    [9] => filter
    [10] => hash
    [11] => json
    [12] => mbstring
    [13] => pcntl
    [14] => SPL
    [15] => PDO
    [16] => readline
    [17] => Reflection
    [18] => session
    [19] => SimpleXML
    [20] => standard
    [21] => tokenizer
    [22] => xml
    [23] => xmlreader
    [24] => xmlwriter
    [25] => mysqlnd
    [26] => mysqli
    [27] => sqlite3
)
+++ exited with 0 +++

Where does the ILL_ILLOPC come from? It doesn鈥檛 show up in native builds. Musl cross-builds seems to be able to work around it, glibc doesn鈥檛.

The ILL_ILLOPC should be harmless, this is just libcrypto probing which instructions are available:

Program received signal SIGILL, Illegal instruction.
0xb6a2d380 in _armv8_pmull_probe () at armv4cpuid.S:91
91  armv4cpuid.S: No such file or directory.
(gdb) bt
#0  0xb6a2d380 in _armv8_pmull_probe () at armv4cpuid.S:91
#1  0xb6a29534 in OPENSSL_cpuid_setup () at armcap.c:69

Not sure why it doesn't appear on musl.

~On cross glibc, the configure script does not find dlopen and builds without dynamic library support.~

Scratch that, I've read the configure log wrong.

I think I found the solution, please test #22019 if it works for you.

Yes, cross compilation work with php-mysql.
Thanks very much :)

You鈥檙e welcome! :)

@jnbr sorry I forgot to mention, but you were right above! :)

Yep, I've just spent way too much time trying to debug the configure script

Was this page helpful?
0 / 5 - 0 ratings

Related issues

no2spam picture no2spam  路  4Comments

vuksavic picture vuksavic  路  3Comments

RandomUnknown picture RandomUnknown  路  4Comments

Johnnynator picture Johnnynator  路  3Comments

edn9 picture edn9  路  4Comments