我想交叉编译php的手臂,并有很好的进展,但我完全卡住它想要运行PHP本身(不知道为什么)。因为它是一个二进制的手臂,而不是英特尔(我的建筑平台),它不会运行:交叉编译php
/bin/sh: /path-to-build/sapi/cli/php: cannot execute binary file
我怎样才能解决这个问题?配置脚本明白我是交叉编译,但没有做任何事情(从配置日志):
checking whether the C compiler (/path-to-compiler/arm-none-linux-gnueabi-gcc) is a cross-compiler... yes
我编译php-5.3.6
与configure命令行:
export CC=/path-to-cc/arm-none-linux-gnueabi-gcc
../configure --prefix=/prefix-path/ --host=arm-none-linux-gnueabi
--disable-libxml --disable-dom --disable-openssl
--without-iconv --without-openssl --disable-simplexml
--disable-xml --disable-xmlreader --disable-xmlwriter
--without-pear --without-sqlite --without-sqlite3
--disable-pdo --without-pdo-sqlite
我把工具链的路径,只是没有设置'CC'然后指定'--host =手臂-NONE-Linux的gnueabi'应该让'configure'找到一切都需要:编译器,链接器,条等 –
它没关系......它在php上失败,不在工具 – Dani
你确定它链接正确吗?我的意思是这不是因为CC是arm-none-linux-gnueabi-gcc,'configure'正确地解析了其他工具链的工具......“无法执行二进制文件”可以表示链接问题,因为'configure'没有使用正确的链接器(因为你没有设置'LD') –