summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Sturmlechner <asturm@gentoo.org>2020-09-05 18:10:47 +0200
committerAndreas Sturmlechner <asturm@gentoo.org>2020-09-06 18:45:36 +0200
commit756046b3193fbc055435914b252bed4eabf3c766 (patch)
tree535d4aaf2d516ee2db0cc949471300fe0bdbd026 /dev-util
parentkde-plasma/kscreenlocker: remove unused patch (diff)
downloadgentoo-756046b3193fbc055435914b252bed4eabf3c766.tar.gz
gentoo-756046b3193fbc055435914b252bed4eabf3c766.tar.bz2
gentoo-756046b3193fbc055435914b252bed4eabf3c766.zip
dev-util/cmake: Tolerate nullptr from uv_default_loop
See also: https://discourse.cmake.org/t/cmake-3-16-5-segmentation-violation/1316 Thanks-to: <tedheadster@gmail.com> Bug: https://bugs.gentoo.org/726962 Package-Manager: Portage-3.0.5, Repoman-3.0.1 Signed-off-by: Andreas Sturmlechner <asturm@gentoo.org>
Diffstat (limited to 'dev-util')
-rw-r--r--dev-util/cmake/cmake-3.17.4-r1.ebuild (renamed from dev-util/cmake/cmake-3.17.4.ebuild)1
-rw-r--r--dev-util/cmake/files/cmake-3.17.4-uv-check-return.patch46
2 files changed, 47 insertions, 0 deletions
diff --git a/dev-util/cmake/cmake-3.17.4.ebuild b/dev-util/cmake/cmake-3.17.4-r1.ebuild
index a65d699eeb87..3af2be355a2b 100644
--- a/dev-util/cmake/cmake-3.17.4.ebuild
+++ b/dev-util/cmake/cmake-3.17.4-r1.ebuild
@@ -67,6 +67,7 @@ PATCHES=(
"${FILESDIR}"/${PN}-3.9.0_rc2-FindPythonInterp.patch
# upstream fixes (can usually be removed with a version bump)
+ "${FILESDIR}"/${P}-uv-check-return.patch # bug 726962
)
cmake_src_bootstrap() {
diff --git a/dev-util/cmake/files/cmake-3.17.4-uv-check-return.patch b/dev-util/cmake/files/cmake-3.17.4-uv-check-return.patch
new file mode 100644
index 000000000000..ab4a45a3ec1e
--- /dev/null
+++ b/dev-util/cmake/files/cmake-3.17.4-uv-check-return.patch
@@ -0,0 +1,46 @@
+From 0fddcc1e5bd8e4672b09e2478edb72e5c0338f1b Mon Sep 17 00:00:00 2001
+From: Brad King <brad.king@kitware.com>
+Date: Wed, 1 Jul 2020 16:23:56 -0400
+Subject: [PATCH] cmake: Tolerate nullptr from uv_default_loop
+
+`uv_default_loop()` can return `nullptr` when running on a Linux kernel
+configured without `CONFIG_EVENTFD`.
+
+Fixes: #20899
+---
+ Source/cmSystemTools.cxx | 4 +++-
+ Source/cmakemain.cxx | 4 +++-
+ 2 files changed, 6 insertions(+), 2 deletions(-)
+
+diff --git a/Source/cmSystemTools.cxx b/Source/cmSystemTools.cxx
+index be799b0402..2f08b840cd 100644
+--- a/Source/cmSystemTools.cxx
++++ b/Source/cmSystemTools.cxx
+@@ -823,7 +823,9 @@ void cmSystemTools::InitializeLibUV()
+ // Perform libuv one-time initialization now, and then un-do its
+ // global _fmode setting so that using libuv does not change the
+ // default file text/binary mode. See libuv issue 840.
+- uv_loop_close(uv_default_loop());
++ if (uv_loop_t* loop = uv_default_loop()) {
++ uv_loop_close(loop);
++ }
+ # ifdef _MSC_VER
+ _set_fmode(_O_TEXT);
+ # else
+diff --git a/Source/cmakemain.cxx b/Source/cmakemain.cxx
+index 75280fb8a5..e0c17f8d54 100644
+--- a/Source/cmakemain.cxx
++++ b/Source/cmakemain.cxx
+@@ -717,6 +717,8 @@ int main(int ac, char const* const* av)
+ #ifndef CMAKE_BOOTSTRAP
+ cmDynamicLoader::FlushCache();
+ #endif
+- uv_loop_close(uv_default_loop());
++ if (uv_loop_t* loop = uv_default_loop()) {
++ uv_loop_close(loop);
++ }
+ return ret;
+ }
+--
+GitLab
+