search

Home  >  Q&A  >  body text

How to deal with the error `call to undeclared function 'sys_icache_invalidate'` when executing `make` on Mac OS Ventura M1?

I'm trying to maintain an old application using PHP 5.4.45. So I installed the source code of the corresponding PHP version from here. I unzipped the tar.gz folder and executed...

  1. ./configure --with-iconv=/opt/homebrew/opt/libiconv
  2. make

In the first step, the configuration was successfully performed. However, during the second step, many warnings and errors appeared. The make process stopped at this error:

/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))

How do I handle this error and install PHP version 5.4.45 from source on my MacOS Ventura M1 MacBook?

P粉006977956P粉006977956503 days ago584

reply all(1)I'll reply

  • P粉418351692

    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))) 

    reply
    0
  • Cancelreply