我正在嘗試維護一個使用PHP 5.4.45的舊應用程式。所以我從這裡安裝了對應PHP版本的原始碼。我解壓縮了tar.gz資料夾並執行了...
./configure --with-iconv=/opt/homebrew/opt/libiconv
make
在第一步中,成功地進行了配置。但是,在第二步中,出現了許多警告和錯誤。在這個錯誤處,make過程停止了:
/Users/ferguso/Downloads/php-5.4.45/ext/pcre/pcrelib/sljit/sljitNativeARM_64.c:312:2: error: call to undeclared function 'sys_icache_invalidate'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] SLJIT_CACHE_FLUSH(code, code_ptr); /Users/ferguso/Downloads/php-5.4.45/ext/pcre/pcrelib/sljit/sljitConfigInternal.h:301:2: note: expanded from macro 'SLJIT_CACHE_FLUSH' sys_icache_invalidate((char*)(from), (char*)(to) - (char*)(from))
如何處理這個錯誤並在我的MacOS Ventura M1 MacBook上安裝PHP 5.4.45版本的原始程式碼?
P粉4183516922023-07-18 16:15:42
我比较了最新的代码。尝试在宏前面包含头文件。
#include/* +++ */ #define SLJIT_CACHE_FLUSH(from, to) \ sys_icache_invalidate((void*)(from), (size_t)((char*)(to) - (char*)(from)))