[php-src] Issue #11099: Generating phar.php during cross-compile can't be done

From: Date: Tue, 18 Apr 2023 10:10:48 +0000
Subject: [php-src] Issue #11099: Generating phar.php during cross-compile can't be done
Groups: php.bugs 
Request: Send a blank email to php-bugs+get-244226@lists.php.net to get a copy of this message
Issue: https://github.com/php/php-src/issues/11099 Author: peter279k ### Description When building the PHP 8.x versions with phar support from source with aarch64-linux-gnu tool chain, it will be failed: Here are configure commands: ```bash ./configure '--cache-file=/home/localadmin/.phpbrew/cache/config.cache' '--prefix=/home/localadmin/.phpbrew/php/php_8_0_arm' '--disable-all' '--enable-phar' '--enable-session' '--enable-short-tags' '--enable-tokenizer' '--with-zlib=/usr' '--with-libdir=lib/x86_64-linux-gnu' '--enable-dom' '--with-libxml' '--enable-simplexml' '--enable-xml' '--enable-xmlreader' '--enable-xmlwriter' '--with-xsl' '--enable-bcmath' '--with-bz2=/usr' '--enable-calendar' '--enable-cli' '--enable-ctype' '--enable-fileinfo' '--enable-filter' '--enable-shmop' '--enable-sysvsem' '--enable-sysvshm' '--enable-sysvmsg' '--enable-json' '--enable-mbregex' '--enable-mbstring' '--with-mhash' '--enable-pcntl' '--enable-pdo' '--enable-posix' '--enable-sockets' '--disable-opcache' '--without-readline' '--without-openssl' '--without-curl' '--without-pear' '--without-zip' '--host=aarch64-linux' '--with-xsl=/opt/libxslt' '--with-zlib=/opt/zlib' '--with-libxml=/opt/libxml2' '--with-bz2=/opt/bzip2' '--disable-test' '--with-config-file-path=/home/localadmin/.phpbrew/php/php_8_0_arm/etc/cli' '--with-config-file-scan-dir=/home/localadmin/.phpbrew/php/php_8_0_arm/var/db/cli' 'PKG_CONFIG_PATH=/usr/lib/pkgconfig:/opt/libxslt/lib/pkgconfig' >> '/home/localadmin/.phpbrew/build/php_8_0_arm/build.log' ``` And the error message is as follows: ```bash Generating phar.php /bin/bash: /home/localadmin/.phpbrew/build/php_8_0_arm/sapi/cli/php: cannot execute binary file: Exec format error Makefile:413: recipe for target 'ext/phar/phar.php' failed make: *** [ext/phar/phar.php] Error 126 ``` I think it should have the way to check whether it's cross compiling mode and it can avoid running the php binary. That is, it should skip related phar generating steps when it's the cross compiling mode. ### PHP Version PHP 8.x ### Operating System Ubuntu 18.04

« previous php.bugs (#244226) next »