Gentoo Archives: gentoo-commits

From: Jory Pratt <anarchy@g.o>
To: gentoo-commits@l.g.o
Subject: [gentoo-commits] proj/musl:master commit in: net-misc/networkmanager/files/, net-misc/networkmanager/
Date: Wed, 03 Feb 2021 15:40:22
Message-Id: 1612366811.424c11684631ac417069214602b73a064524898d.anarchy@gentoo
1 commit: 424c11684631ac417069214602b73a064524898d
2 Author: Jory Pratt <anarchy <AT> gentoo <DOT> org>
3 AuthorDate: Wed Feb 3 15:40:11 2021 +0000
4 Commit: Jory Pratt <anarchy <AT> gentoo <DOT> org>
5 CommitDate: Wed Feb 3 15:40:11 2021 +0000
6 URL: https://gitweb.gentoo.org/proj/musl.git/commit/?id=424c1168
7
8 net-misc/networkmanager: Fix reallocarray error
9
10 Closes: https://github.com/gentoo/musl/issues/372
11 Package-Manager: Portage-3.0.14, Repoman-3.0.2
12 Signed-off-by: Jory Pratt <anarchy <AT> gentoo.org>
13
14 net-misc/networkmanager/files/reallocarray.patch | 22 ++++++++++++++++++++++
15 .../networkmanager/networkmanager-1.26.4.ebuild | 3 ++-
16 2 files changed, 24 insertions(+), 1 deletion(-)
17
18 diff --git a/net-misc/networkmanager/files/reallocarray.patch b/net-misc/networkmanager/files/reallocarray.patch
19 new file mode 100644
20 index 0000000..98722f0
21 --- /dev/null
22 +++ b/net-misc/networkmanager/files/reallocarray.patch
23 @@ -0,0 +1,22 @@
24 +musl [added support for reallocarray](0), but the function prototype is
25 +declared in `stdlib.h` instead of `malloc.h`.
26 +
27 +Update the check for reallocarray to check both in `malloc.h` and
28 +`stdlib.h`.
29 +
30 +[0]:https://git.musl-libc.org/cgit/musl/commit/?id=821083ac7b54eaa040d5a8ddc67c6206a175e0ca
31 +
32 +diff --git a/meson.build b/meson.build
33 +index 22a3c4c..12a10c5 100644
34 +--- a/meson.build
35 ++++ b/meson.build
36 +@@ -126,7 +126,8 @@ config_h.set10('HAVE_RT_SIGQUEUEINFO', cc.has_function('rt_sigqueueinfo', prefix
37 + #include <sys/wait.h>'''))
38 + config_h.set('HAVE_SECURE_GETENV', cc.has_function('secure_getenv'))
39 + config_h.set('HAVE___SECURE_GETENV', cc.has_function('__secure_getenv'))
40 +-config_h.set10('HAVE_DECL_REALLOCARRAY', cc.has_function('reallocarray', prefix: '#include <malloc.h>'))
41 ++config_h.set10('HAVE_DECL_REALLOCARRAY', cc.has_function('reallocarray', prefix: '''#include <malloc.h>
42 ++ #include <stdlib.h>'''))
43 + config_h.set10('HAVE_DECL_EXPLICIT_BZERO', cc.has_function('explicit_bzero', prefix: '#include <string.h>'))
44 + config_h.set10('HAVE_DECL_MEMFD_CREATE', cc.has_function('memfd_create', prefix: '#include <sys/mman.h>'))
45 +
46
47 diff --git a/net-misc/networkmanager/networkmanager-1.26.4.ebuild b/net-misc/networkmanager/networkmanager-1.26.4.ebuild
48 index ff6099b..50d95a0 100644
49 --- a/net-misc/networkmanager/networkmanager-1.26.4.ebuild
50 +++ b/net-misc/networkmanager/networkmanager-1.26.4.ebuild
51 @@ -1,4 +1,4 @@
52 -# Copyright 1999-2020 Gentoo Authors
53 +# Copyright 1999-2021 Gentoo Authors
54 # Distributed under the terms of the GNU General Public License v2
55
56 EAPI=6
57 @@ -108,6 +108,7 @@ PATCHES=( "${FILESDIR}"/${PN}-1.26.4-iwd-fixes-pr640.patch
58 "${FILESDIR}"/musl-process-util.patch
59 "${FILESDIR}"/musl-compar.patch
60 "${FILESDIR}"/musl-no-drand.patch
61 + "${FILESDIR}"/reallocarray.patch
62 )
63
64 python_check_deps() {