On 05 Feb 2020, at 21:40, Sebastian Kemper <sebastian...@gmx.net> wrote:

> APR's configure script uses AC_TRY_RUN to detect whether /dev/zero can
> be mmaped. When cross-compiling this defaults to no. While APR compiles
> fine like this (since r1873594 in the APR 1.7 branch), the apr_lock
> implementation method falls back to SysV IPC semget().
> 
> <snip>
> checking for mmap that can map /dev/zero... no
> <snip>
> decision on apr_lock implementation method... SysV IPC semget()
> <snip>
> 
> This commit adds a cache check with which users who cross-compile APR
> can influence the outcome of the test by setting the variable
> ac_cv_mmap__dev_zero=yes:
> 
> <snip>
> checking for mmap that can map /dev/zero... (cached) yes
> <snip>
> decision on apr_lock implementation method... pthread pshared mutex
> <snip>
> 
> This way the new default apr_lock mechanism can also be used when
> cross-compiling (if /dev/zero is in fact mmapable that is).
> 
> Index: configure.in
> ===================================================================
> --- configure.in      (revision 1873663)
> +++ configure.in      (working copy)
> @@ -1186,8 +1186,9 @@
> # Not all systems can mmap /dev/zero (such as HP-UX).  Check for that.
> if test "$ac_cv_func_mmap" = "yes" &&
>    test "$ac_cv_file__dev_zero" = "yes"; then
> -    AC_MSG_CHECKING(for mmap that can map /dev/zero)
> -    AC_TRY_RUN([
> +    AC_CACHE_CHECK([for mmap that can map /dev/zero],
> +    [ac_cv_mmap__dev_zero],
> +    [AC_TRY_RUN([
> #include <sys/types.h>
> #include <sys/stat.h>
> #include <fcntl.h>
> @@ -1210,9 +1211,7 @@
>             return 3;
>         }
>         return 0;
> -    }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])
> -
> -    AC_MSG_RESULT($ac_cv_file__dev_zero)
> +    }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])])
> fi
> 
> # Now we determine which one is our anonymous shmem preference.

Thanks for this, this is added as 
http://svn.apache.org/viewvc?rev=1875062&view=rev 
<http://svn.apache.org/viewvc?rev=1875062&view=rev> and backported as 
http://svn.apache.org/viewvc?rev=1875064&view=rev 
<http://svn.apache.org/viewvc?rev=1875064&view=rev>

Regards,
Graham
—

Attachment: smime.p7s
Description: S/MIME cryptographic signature

Reply via email to