Upstream-Status: Inappropriate [cross compile specific]

diff -durpN php-7.4.11.orig/ext/iconv/config.m4 php-7.4.11/ext/iconv/config.m4
--- php-7.4.11.orig/ext/iconv/config.m4	2020-10-09 08:04:45.951837732 -0400
+++ php-7.4.11/ext/iconv/config.m4	2020-10-09 08:06:36.874657935 -0400
@@ -150,9 +150,9 @@ int main() {
       PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv])
       AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
     ],[
-      AC_MSG_RESULT(no, cross-compiling)
-      PHP_DEFINE([ICONV_SUPPORTS_ERRNO],0,[ext/iconv])
-      AC_DEFINE([ICONV_SUPPORTS_ERRNO],0,[Whether iconv supports error no or not])
+      AC_MSG_RESULT(yes)
+      PHP_DEFINE([ICONV_SUPPORTS_ERRNO],1,[ext/iconv])
+      AC_DEFINE([ICONV_SUPPORTS_ERRNO],1,[Whether iconv supports error no or not])
     ])
 
     AC_MSG_CHECKING([if iconv supports //IGNORE])
diff -durpN php-7.4.11.orig/ext/opcache/config.m4 php-7.4.11/ext/opcache/config.m4
--- php-7.4.11.orig/ext/opcache/config.m4	2020-10-09 08:04:45.953837747 -0400
+++ php-7.4.11/ext/opcache/config.m4	2020-10-09 08:06:36.874657935 -0400
@@ -89,7 +89,9 @@ int main() {
 }
 ]])],[dnl
     AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
-    msg=yes],[msg=no],[msg=no])
+    msg=yes],[msg=no],[
+    AC_DEFINE(HAVE_SHM_IPC, 1, [Define if you have SysV IPC SHM support])
+    msg=yes])
   AC_MSG_RESULT([$msg])
 
   AC_MSG_CHECKING(for mmap() using MAP_ANON shared memory support)
@@ -141,7 +143,9 @@ int main() {
 }
 ]])],[dnl
     AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
-    msg=yes],[msg=no],[msg=no])
+    msg=yes],[msg=no],[
+    AC_DEFINE(HAVE_SHM_MMAP_ANON, 1, [Define if you have mmap(MAP_ANON) SHM support])
+    msg=yes])
   AC_MSG_RESULT([$msg])
 
   PHP_CHECK_FUNC_LIB(shm_open, rt)
@@ -216,7 +220,9 @@ int main() {
   ],[
     AC_MSG_RESULT([no])
   ],[
-    AC_MSG_RESULT([no])
+    AC_DEFINE(HAVE_SHM_MMAP_POSIX, 1, [Define if you have POSIX mmap() SHM support])
+    AC_MSG_RESULT([yes])
+    PHP_CHECK_LIBRARY(rt, shm_unlink, [PHP_ADD_LIBRARY(rt,1,OPCACHE_SHARED_LIBADD)])
   ])
 
   PHP_NEW_EXTENSION(opcache,
diff -durpN php-7.4.11.orig/ext/posix/config.m4 php-7.4.11/ext/posix/config.m4
--- php-7.4.11.orig/ext/posix/config.m4	2020-10-09 08:04:45.954837755 -0400
+++ php-7.4.11/ext/posix/config.m4	2020-10-09 08:06:36.875657943 -0400
@@ -28,7 +28,10 @@ int main(int argc, char *argv[])
   ],[
     AC_MSG_RESULT([no, posix_ttyname() will be thread-unsafe])
   ], [
-    AC_MSG_RESULT([no, cannot detect working ttyname_r() when cross compiling. posix_ttyname() will be thread-unsafe])
+    AC_CHECK_FUNCS(ttyname_r,
+      [AC_MSG_RESULT([yes])
+       AC_DEFINE(HAVE_TTYNAME_R, 1, [Whether you have a working ttyname_r])],
+      [AC_MSG_RESULT([no, cannot detect working ttyname_r() when cross compiling. posix_ttyname() will be thread-unsafe])])
   ])
 
   AC_CACHE_CHECK([for utsname.domainname], ac_cv_have_utsname_domainname, [
diff -durpN php-7.4.11.orig/sapi/fpm/config.m4 php-7.4.11/sapi/fpm/config.m4
--- php-7.4.11.orig/sapi/fpm/config.m4	2020-10-09 08:04:45.955837762 -0400
+++ php-7.4.11/sapi/fpm/config.m4	2020-10-09 08:06:37.012658955 -0400
@@ -262,7 +262,8 @@ AC_DEFUN([AC_FPM_TRACE],
       proc_mem_file=""
       AC_MSG_RESULT([no])
     ], [
-      AC_MSG_RESULT([skipped (cross-compiling)])
+      AC_MSG_RESULT([cross compiling for Linux, using 'mem'])
+      proc_mem_file="mem"
     ])
   fi
 
