networkmanager: Fix reallocarray check in meson and configure

Signed-off-by: Khem Raj <raj.khem@gmail.com>
(cherry picked from commit 62c2f4a48a244ead00d4b32f42b10f52441afc1c)
Signed-off-by: Armin Kuster <akuster808@gmail.com>
This commit is contained in:
Khem Raj 2020-12-12 16:34:22 -08:00 committed by Armin Kuster
parent c920ef3dec
commit 165ad9ad4c
2 changed files with 28 additions and 0 deletions

View File

@ -0,0 +1,27 @@
reallocarray() is coming from stdlib.h which maybe indirectly included
by malloc.h but not on all libc implementations
Upstream-Status: Pending
Signed-off-by: Khem Raj <raj.khem@gmail.com>
--- a/meson.build
+++ b/meson.build
@@ -114,7 +114,7 @@ config_h.set10('HAVE_GETRANDOM', use_sys
# FIXME secure_getenv check is not useful?
config_h.set('HAVE_SECURE_GETENV', cc.has_function('secure_getenv'))
config_h.set('HAVE___SECURE_GETENV', cc.has_function('__secure_getenv'))
-config_h.set10('HAVE_DECL_REALLOCARRAY', cc.has_function('reallocarray', prefix: '#include <malloc.h>'))
+config_h.set10('HAVE_DECL_REALLOCARRAY', cc.has_function('reallocarray', prefix: '#include <stdlib.h>'))
config_h.set10('HAVE_DECL_EXPLICIT_BZERO', cc.has_function('explicit_bzero', prefix: '#include <string.h>'))
config_h.set10('HAVE_DECL_MEMFD_CREATE', cc.has_function('memfd_create', prefix: '#include <sys/mman.h>'))
--- a/configure.ac
+++ b/configure.ac
@@ -82,7 +82,7 @@ AC_CHECK_DECLS([
AC_CHECK_DECLS([
reallocarray],
[], [], [[
-#include <malloc.h>
+#include <stdlib.h>
]])
AC_CHECK_DECLS([

View File

@ -27,6 +27,7 @@ SRC_URI = " \
file://0001-Fixed-configure.ac-Fix-pkgconfig-sysroot-locations.patch \
file://0002-Do-not-create-settings-settings-property-documentati.patch \
file://0001-install-firewalld-to-var-libdir-rather-than-hardcod-.patch \
file://fix_reallocarray_check.patch \
"
SRC_URI_append_libc-musl = " \
file://musl/0001-Fix-build-with-musl-systemd-specific.patch \