summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/recipes-support/apr/apr/0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch62
-rw-r--r--meta/recipes-support/apr/apr_1.7.0.bb15
2 files changed, 75 insertions, 2 deletions
diff --git a/meta/recipes-support/apr/apr/0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch b/meta/recipes-support/apr/apr/0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch
new file mode 100644
index 0000000000..fa6202da79
--- /dev/null
+++ b/meta/recipes-support/apr/apr/0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch
@@ -0,0 +1,62 @@
1From ee728971fd9d2da39356f1574d58d5daa3b24520 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Fri, 26 Aug 2022 00:28:08 -0700
4Subject: [PATCH] configure: Remove runtime test for mmap that can map
5 /dev/zero
6
7This never works for cross-compile moreover it ends up disabling
8ac_cv_file__dev_zero which then results in compiler errors in shared
9mutexes
10
11Upstream-Status: Inappropriate [Cross-compile specific]
12Signed-off-by: Khem Raj <raj.khem@gmail.com>
13---
14 configure.in | 32 --------------------------------
15 1 file changed, 32 deletions(-)
16
17diff --git a/configure.in b/configure.in
18index a99049d..f1f55c7 100644
19--- a/configure.in
20+++ b/configure.in
21@@ -1182,38 +1182,6 @@ AC_CHECK_FUNCS([mmap munmap shm_open shm_unlink shmget shmat shmdt shmctl \
22 APR_CHECK_DEFINE(MAP_ANON, sys/mman.h)
23 AC_CHECK_FILE(/dev/zero)
24
25-# Not all systems can mmap /dev/zero (such as HP-UX). Check for that.
26-if test "$ac_cv_func_mmap" = "yes" &&
27- test "$ac_cv_file__dev_zero" = "yes"; then
28- AC_MSG_CHECKING(for mmap that can map /dev/zero)
29- AC_TRY_RUN([
30-#include <sys/types.h>
31-#include <sys/stat.h>
32-#include <fcntl.h>
33-#ifdef HAVE_SYS_MMAN_H
34-#include <sys/mman.h>
35-#endif
36- int main()
37- {
38- int fd;
39- void *m;
40- fd = open("/dev/zero", O_RDWR);
41- if (fd < 0) {
42- return 1;
43- }
44- m = mmap(0, sizeof(void*), PROT_READ|PROT_WRITE, MAP_SHARED, fd, 0);
45- if (m == (void *)-1) { /* aka MAP_FAILED */
46- return 2;
47- }
48- if (munmap(m, sizeof(void*)) < 0) {
49- return 3;
50- }
51- return 0;
52- }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])
53-
54- AC_MSG_RESULT($ac_cv_file__dev_zero)
55-fi
56-
57 # Now we determine which one is our anonymous shmem preference.
58 haveshmgetanon="0"
59 havemmapzero="0"
60--
612.37.2
62
diff --git a/meta/recipes-support/apr/apr_1.7.0.bb b/meta/recipes-support/apr/apr_1.7.0.bb
index b9d3e356da..5e62e5683f 100644
--- a/meta/recipes-support/apr/apr_1.7.0.bb
+++ b/meta/recipes-support/apr/apr_1.7.0.bb
@@ -25,6 +25,7 @@ SRC_URI = "${APACHE_MIRROR}/apr/${BPN}-${PV}.tar.bz2 \
25 file://0001-Add-option-to-disable-timed-dependant-tests.patch \ 25 file://0001-Add-option-to-disable-timed-dependant-tests.patch \
26 file://autoconf270.patch \ 26 file://autoconf270.patch \
27 file://0001-add-AC_CACHE_CHECK-for-strerror_r-return-type.patch \ 27 file://0001-add-AC_CACHE_CHECK-for-strerror_r-return-type.patch \
28 file://0001-configure-Remove-runtime-test-for-mmap-that-can-map-.patch \
28 file://CVE-2021-35940.patch \ 29 file://CVE-2021-35940.patch \
29 " 30 "
30 31
@@ -37,12 +38,22 @@ OE_BINCONFIG_EXTRA_MANGLE = " -e 's:location=source:location=installed:'"
37 38
38# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928 39# Added to fix some issues with cmake. Refer to https://github.com/bmwcarit/meta-ros/issues/68#issuecomment-19896928
39CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes" 40CACHED_CONFIGUREVARS += "apr_cv_mutex_recursive=yes"
40 41# Enable largefile
42CACHED_CONFIGUREVARS += "apr_cv_use_lfs64=yes"
43# Additional AC_TRY_RUN tests which will need to be cached for cross compile
44CACHED_CONFIGUREVARS += "apr_cv_epoll=yes epoll_create1=yes apr_cv_sock_cloexec=yes \
45 ac_cv_struct_rlimit=yes \
46 ac_cv_func_sem_open=yes \
47 apr_cv_process_shared_works=yes \
48 apr_cv_mutex_robust_shared=yes \
49 "
41# Also suppress trying to use sctp. 50# Also suppress trying to use sctp.
42# 51#
43CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no" 52CACHED_CONFIGUREVARS += "ac_cv_header_netinet_sctp_h=no ac_cv_header_netinet_sctp_uio_h=no"
44 53
45CACHED_CONFIGUREVARS += "ac_cv_sizeof_struct_iovec=yes" 54# ac_cv_sizeof_struct_iovec is deduced using runtime check which will fail during cross-compile
55CACHED_CONFIGUREVARS += "${@['ac_cv_sizeof_struct_iovec=16','ac_cv_sizeof_struct_iovec=8'][d.getVar('SITEINFO_BITS') != '32']}"
56
46CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes" 57CACHED_CONFIGUREVARS += "ac_cv_file__dev_zero=yes"
47 58
48CACHED_CONFIGUREVARS:append:libc-musl = " ac_cv_strerror_r_rc_int=yes" 59CACHED_CONFIGUREVARS:append:libc-musl = " ac_cv_strerror_r_rc_int=yes"