mirror of
https://github.com/openembedded/meta-openembedded.git
synced 2026-06-03 14:19:52 +00:00
net-snmp: Fix build with musl
The last patch 0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch brought in with 5.9.4 upgrade is not sufficient and infact has a regression introduced for clang+musl builds. Signed-off-by: Khem Raj <raj.khem@gmail.com>
This commit is contained in:
@@ -0,0 +1,83 @@
|
|||||||
|
From b4598662a39ff6974119c900ea56a4d020eac366 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Bart Van Assche <bvanassche@acm.org>
|
||||||
|
Date: Wed, 20 Dec 2023 13:08:06 -0800
|
||||||
|
Subject: [PATCH] Android: Fix the build
|
||||||
|
|
||||||
|
Include <sys/select.h> for the fd_set type. In the configure script,
|
||||||
|
check whether 'unsigned long' is the underlying type of fd_set. Use
|
||||||
|
u_long instead of ulong.
|
||||||
|
|
||||||
|
Upstream-Status: Backport [https://github.com/net-snmp/net-snmp/commit/b4598662a39ff6974119c900ea56a4d020eac366]
|
||||||
|
Signed-off-by: Khem Raj <raj.khem@gmail.com>
|
||||||
|
---
|
||||||
|
agent/mibgroup/ip-mib/data_access/ipaddress_linux.c | 4 ++--
|
||||||
|
configure | 2 +-
|
||||||
|
configure.d/config_project_types | 2 +-
|
||||||
|
include/net-snmp/types.h | 3 +++
|
||||||
|
4 files changed, 7 insertions(+), 4 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
|
||||||
|
index b38beb57dd..232202d0f9 100644
|
||||||
|
--- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
|
||||||
|
+++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c
|
||||||
|
@@ -50,7 +50,7 @@ int _load_v6(netsnmp_container *container, int idx_offset);
|
||||||
|
int
|
||||||
|
netsnmp_access_ipaddress_extra_prefix_info(int index,
|
||||||
|
u_long *preferedlt,
|
||||||
|
- ulong *validlt,
|
||||||
|
+ u_long *validlt,
|
||||||
|
char *addr);
|
||||||
|
#endif
|
||||||
|
|
||||||
|
@@ -523,7 +523,7 @@ out:
|
||||||
|
|
||||||
|
int
|
||||||
|
netsnmp_access_ipaddress_extra_prefix_info(int index, u_long *preferedlt,
|
||||||
|
- ulong *validlt, char *addr)
|
||||||
|
+ u_long *validlt, char *addr)
|
||||||
|
{
|
||||||
|
|
||||||
|
struct {
|
||||||
|
diff --git a/configure b/configure
|
||||||
|
index e7bf859bba..48abcbab11 100755
|
||||||
|
--- a/configure
|
||||||
|
+++ b/configure
|
||||||
|
@@ -31577,7 +31577,7 @@ CFLAGS="$CFLAGS -Werror"
|
||||||
|
|
||||||
|
{ printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the type of fd_set::fds_bits" >&5
|
||||||
|
printf %s "checking for the type of fd_set::fds_bits... " >&6; }
|
||||||
|
-for type in __fd_mask __int32_t long\ int unknown; do
|
||||||
|
+for type in __fd_mask __int32_t long 'unsigned long' unknown; do
|
||||||
|
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
|
||||||
|
/* end confdefs.h. */
|
||||||
|
|
||||||
|
diff --git a/configure.d/config_project_types b/configure.d/config_project_types
|
||||||
|
index a78e8ebb06..ac958d6712 100644
|
||||||
|
--- a/configure.d/config_project_types
|
||||||
|
+++ b/configure.d/config_project_types
|
||||||
|
@@ -66,7 +66,7 @@ netsnmp_save_CFLAGS=$CFLAGS
|
||||||
|
CFLAGS="$CFLAGS -Werror"
|
||||||
|
|
||||||
|
AC_MSG_CHECKING([for the type of fd_set::fds_bits])
|
||||||
|
-for type in __fd_mask __int32_t long\ int unknown; do
|
||||||
|
+for type in __fd_mask __int32_t long 'unsigned long' unknown; do
|
||||||
|
AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
|
||||||
|
#include <sys/select.h>
|
||||||
|
#include <stddef.h>
|
||||||
|
diff --git a/include/net-snmp/types.h b/include/net-snmp/types.h
|
||||||
|
index b78f53ffd7..6228170e5f 100644
|
||||||
|
--- a/include/net-snmp/types.h
|
||||||
|
+++ b/include/net-snmp/types.h
|
||||||
|
@@ -23,6 +23,9 @@
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#include <sys/types.h>
|
||||||
|
+#ifdef __ANDROID__
|
||||||
|
+#include <sys/select.h>
|
||||||
|
+#endif
|
||||||
|
|
||||||
|
#if defined(WIN32) && !defined(cygwin)
|
||||||
|
typedef HANDLE netsnmp_pid_t;
|
||||||
|
--
|
||||||
|
2.44.0
|
||||||
|
|
||||||
@@ -27,6 +27,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \
|
|||||||
file://0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch \
|
file://0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch \
|
||||||
file://0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch \
|
file://0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch \
|
||||||
file://0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch \
|
file://0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch \
|
||||||
|
file://0001-Android-Fix-the-build.patch \
|
||||||
"
|
"
|
||||||
SRC_URI[sha256sum] = "8b4de01391e74e3c7014beb43961a2d6d6fa03acc34280b9585f4930745b0544"
|
SRC_URI[sha256sum] = "8b4de01391e74e3c7014beb43961a2d6d6fa03acc34280b9585f4930745b0544"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user