summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJames Le Cuirot <chewi@gentoo.org>2022-11-13 17:25:12 +0000
committerJames Le Cuirot <chewi@gentoo.org>2022-11-13 17:25:25 +0000
commit7080fc27a36a02b528415b262a2a83f0a8462ba9 (patch)
tree3cb8998cdd0633cc8691599f87864820b93b78aa /dev-libs
parentapp-misc/linux-logo: add 6.01 (diff)
downloadgentoo-7080fc27a36a02b528415b262a2a83f0a8462ba9.tar.gz
gentoo-7080fc27a36a02b528415b262a2a83f0a8462ba9.tar.bz2
gentoo-7080fc27a36a02b528415b262a2a83f0a8462ba9.zip
dev-libs/apr: Apply patch to fix cross-compiling 1.7.0-r6
Fixes detection of /dev/zero. Thanks to Alexandra Parker for the patch. This has not yet been submitted upstream. Closes: https://bugs.gentoo.org/830833 Signed-off-by: James Le Cuirot <chewi@gentoo.org>
Diffstat (limited to 'dev-libs')
-rw-r--r--dev-libs/apr/apr-1.7.0-r6.ebuild1
-rw-r--r--dev-libs/apr/files/apr-1.7.0-dev-zero.patch34
2 files changed, 35 insertions, 0 deletions
diff --git a/dev-libs/apr/apr-1.7.0-r6.ebuild b/dev-libs/apr/apr-1.7.0-r6.ebuild
index 4ba3505bd8f8..4d8630a847e9 100644
--- a/dev-libs/apr/apr-1.7.0-r6.ebuild
+++ b/dev-libs/apr/apr-1.7.0-r6.ebuild
@@ -34,6 +34,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-1.7.0-autoconf-2.70.patch #750353
"${FILESDIR}"/${PN}-1.7.0-CVE-2021-35940.patch #828545
"${FILESDIR}"/${PN}-1.7.0-clang-16.patch #870004
+ "${FILESDIR}"/${PN}-1.7.0-dev-zero.patch #830833
)
src_prepare() {
diff --git a/dev-libs/apr/files/apr-1.7.0-dev-zero.patch b/dev-libs/apr/files/apr-1.7.0-dev-zero.patch
new file mode 100644
index 000000000000..be6433dd46bc
--- /dev/null
+++ b/dev-libs/apr/files/apr-1.7.0-dev-zero.patch
@@ -0,0 +1,34 @@
+APR (ab)uses AC_TRY_RUN to determine if:
+
+* We have /dev/zero
+* We can mmap /dev/zero
+
+The APR ebuild sets ac_cv_file__dev_zero=yes when cross compiling
+to fill in an answer for the first question, but the configure script
+immediately defeats that when answering the second.
+
+AC_TRY_FUN takes four arguments: the test, and what happens on success,
+failure, and cross-compiling. The APR script uses this as a "gate" to
+clear ac_cv_file__dev_zero when /dev/zero exists but it turns out not
+to be useable. They take a pessimistic approach: if you can't "prove"
+it is mmap-able, clear the flag.
+
+This patch changes that to leave the flag alone while cross compiling;
+just assume /dev/zero is mmap-able. It relies on ac_cv_file__dev_zero
+to be correctly set for the target. The fourth parameter is changed to
+[:] and not [] because [] engages autoconf's default cross-compiling
+behavior, which raises an error.
+
+Signed-off-by: Alexandra Parker <alex.iris.parker@gmail.com>
+
+--- a/configure.in 2022-01-09 00:31:05.552582255 -0800
++++ b/configure.in 2022-01-09 00:31:19.824582533 -0800
+@@ -1203,7 +1203,7 @@
+ return 3;
+ }
+ return 0;
+- }], [], [ac_cv_file__dev_zero=no], [ac_cv_file__dev_zero=no])
++ }], [], [ac_cv_file__dev_zero=no], [:])
+
+ AC_MSG_RESULT($ac_cv_file__dev_zero)
+ fi