iOS集成php-体系结构arm64 xcode 11的未定义符号

时间:2018-12-18 11:10:29

标签: php ios cross-compiling

我正在尝试将php 7.3库集成到我的IOS项目中。

要为arm64交叉编译php,我使用了以下sh脚本:

#!/bin/bash

# NOTE: PHP thinks "finite" is available, but it's not. You have to disable it manually in the config.h file.

PLATFORM=iPhoneOS # iPhoneSimulator # iPhoneOS
HOST=arm-apple-darwin10 # i386-apple-darwin10 # arm-apple-darwin10
ARCH=arm64 # i386 # armv7s #armv7
SDK_VERSION=12.1

XCODE_ROOT=`xcode-select -print-path`
PLATFORM_PATH=$XCODE_ROOT/Platforms/$PLATFORM.platform/Developer
SDK_PATH=$PLATFORM_PATH/SDKs/$PLATFORM$SDK_VERSION.sdk
FLAGS="-isysroot $SDK_PATH -arch $ARCH -miphoneos-version-min=$SDK_VERSION" # -miphoneos-version-min=$SDK_VERSION -mios-simulator-version-min=$SDK_VERSION"
PLATFORM_BIN_PATH=$XCODE_ROOT/Toolchains/XcodeDefault.xctoolchain/usr/bin
CC=$PLATFORM_BIN_PATH/clang
CXX=$PLATFORM_BIN_PATH/clang++
CFLAGS="$FLAGS -std=gnu99"
CXXFLAGS="$FLAGS -std=gnu++11 -stdlib=libc++"
LDFLAGS=$FLAGS

export CC CXX CFLAGS CXXFLAGS LDFLAGS

CONFIGURE_FLAGS="--host=$HOST --enable-embed=static --without-pear --disable-opcache --without-iconv --disable-cgi --disable-shared --disable-cli --enable-mysqlnd --with-pdo-mysql --with-mysqli --with-mysql --with-tsrm-pthreads"
./configure $CONFIGURE_FLAGS

然后,我将libphp7.a文件集成到xcode中的“链接的框架和库”中,并尝试构建该项目。但我收到此错误:

体系结构arm64的未定义符号:   “ ___clear_cache”,引用自:       libphp7.a中的_sljit_generate_code(pcre2_jit_compile.o) ld:找不到体系结构arm64的符号 clang:错误:链接器命令失败,退出代码为1(使用-v查看调用)

我在做什么,如何正确集成php?

0 个答案:

没有答案