diff options
author | Khem Raj <raj.khem@gmail.com> | 2024-03-25 11:29:51 -0700 |
---|---|---|
committer | Khem Raj <raj.khem@gmail.com> | 2024-03-25 12:50:39 -0700 |
commit | e9221e89bcbfed0bf9f26adca88f8971142cf5ad (patch) | |
tree | 264af3e254d74fd08522f45b9ddf67b62c49e50c /meta-networking/recipes-protocols | |
parent | fbbe7cefdd05c5149ce16975ed5ea56e787e419b (diff) | |
download | meta-openembedded-e9221e89bcbfed0bf9f26adca88f8971142cf5ad.tar.gz |
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>
Diffstat (limited to 'meta-networking/recipes-protocols')
-rw-r--r-- | meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Android-Fix-the-build.patch | 83 | ||||
-rw-r--r-- | meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb | 1 |
2 files changed, 84 insertions, 0 deletions
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Android-Fix-the-build.patch b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Android-Fix-the-build.patch new file mode 100644 index 000000000..097d9f83c --- /dev/null +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp/0001-Android-Fix-the-build.patch | |||
@@ -0,0 +1,83 @@ | |||
1 | From b4598662a39ff6974119c900ea56a4d020eac366 Mon Sep 17 00:00:00 2001 | ||
2 | From: Bart Van Assche <bvanassche@acm.org> | ||
3 | Date: Wed, 20 Dec 2023 13:08:06 -0800 | ||
4 | Subject: [PATCH] Android: Fix the build | ||
5 | |||
6 | Include <sys/select.h> for the fd_set type. In the configure script, | ||
7 | check whether 'unsigned long' is the underlying type of fd_set. Use | ||
8 | u_long instead of ulong. | ||
9 | |||
10 | Upstream-Status: Backport [https://github.com/net-snmp/net-snmp/commit/b4598662a39ff6974119c900ea56a4d020eac366] | ||
11 | Signed-off-by: Khem Raj <raj.khem@gmail.com> | ||
12 | --- | ||
13 | agent/mibgroup/ip-mib/data_access/ipaddress_linux.c | 4 ++-- | ||
14 | configure | 2 +- | ||
15 | configure.d/config_project_types | 2 +- | ||
16 | include/net-snmp/types.h | 3 +++ | ||
17 | 4 files changed, 7 insertions(+), 4 deletions(-) | ||
18 | |||
19 | diff --git a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c | ||
20 | index b38beb57dd..232202d0f9 100644 | ||
21 | --- a/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c | ||
22 | +++ b/agent/mibgroup/ip-mib/data_access/ipaddress_linux.c | ||
23 | @@ -50,7 +50,7 @@ int _load_v6(netsnmp_container *container, int idx_offset); | ||
24 | int | ||
25 | netsnmp_access_ipaddress_extra_prefix_info(int index, | ||
26 | u_long *preferedlt, | ||
27 | - ulong *validlt, | ||
28 | + u_long *validlt, | ||
29 | char *addr); | ||
30 | #endif | ||
31 | |||
32 | @@ -523,7 +523,7 @@ out: | ||
33 | |||
34 | int | ||
35 | netsnmp_access_ipaddress_extra_prefix_info(int index, u_long *preferedlt, | ||
36 | - ulong *validlt, char *addr) | ||
37 | + u_long *validlt, char *addr) | ||
38 | { | ||
39 | |||
40 | struct { | ||
41 | diff --git a/configure b/configure | ||
42 | index e7bf859bba..48abcbab11 100755 | ||
43 | --- a/configure | ||
44 | +++ b/configure | ||
45 | @@ -31577,7 +31577,7 @@ CFLAGS="$CFLAGS -Werror" | ||
46 | |||
47 | { printf "%s\n" "$as_me:${as_lineno-$LINENO}: checking for the type of fd_set::fds_bits" >&5 | ||
48 | printf %s "checking for the type of fd_set::fds_bits... " >&6; } | ||
49 | -for type in __fd_mask __int32_t long\ int unknown; do | ||
50 | +for type in __fd_mask __int32_t long 'unsigned long' unknown; do | ||
51 | cat confdefs.h - <<_ACEOF >conftest.$ac_ext | ||
52 | /* end confdefs.h. */ | ||
53 | |||
54 | diff --git a/configure.d/config_project_types b/configure.d/config_project_types | ||
55 | index a78e8ebb06..ac958d6712 100644 | ||
56 | --- a/configure.d/config_project_types | ||
57 | +++ b/configure.d/config_project_types | ||
58 | @@ -66,7 +66,7 @@ netsnmp_save_CFLAGS=$CFLAGS | ||
59 | CFLAGS="$CFLAGS -Werror" | ||
60 | |||
61 | AC_MSG_CHECKING([for the type of fd_set::fds_bits]) | ||
62 | -for type in __fd_mask __int32_t long\ int unknown; do | ||
63 | +for type in __fd_mask __int32_t long 'unsigned long' unknown; do | ||
64 | AC_COMPILE_IFELSE([AC_LANG_PROGRAM([ | ||
65 | #include <sys/select.h> | ||
66 | #include <stddef.h> | ||
67 | diff --git a/include/net-snmp/types.h b/include/net-snmp/types.h | ||
68 | index b78f53ffd7..6228170e5f 100644 | ||
69 | --- a/include/net-snmp/types.h | ||
70 | +++ b/include/net-snmp/types.h | ||
71 | @@ -23,6 +23,9 @@ | ||
72 | #endif | ||
73 | |||
74 | #include <sys/types.h> | ||
75 | +#ifdef __ANDROID__ | ||
76 | +#include <sys/select.h> | ||
77 | +#endif | ||
78 | |||
79 | #if defined(WIN32) && !defined(cygwin) | ||
80 | typedef HANDLE netsnmp_pid_t; | ||
81 | -- | ||
82 | 2.44.0 | ||
83 | |||
diff --git a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb index 5da06bb6d..395b02df0 100644 --- a/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb +++ b/meta-networking/recipes-protocols/net-snmp/net-snmp_5.9.4.bb | |||
@@ -27,6 +27,7 @@ SRC_URI = "${SOURCEFORGE_MIRROR}/net-snmp/net-snmp-${PV}.tar.gz \ | |||
27 | file://0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch \ | 27 | file://0010-net-snmp-Reproducibility-Don-t-check-build-host-for.patch \ |
28 | file://0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch \ | 28 | file://0011-ac_add_search_path.m4-keep-consistent-between-32bit-.patch \ |
29 | file://0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch \ | 29 | file://0012-Fix-configuration-of-NETSNMP_FD_MASK_TYPE.patch \ |
30 | file://0001-Android-Fix-the-build.patch \ | ||
30 | " | 31 | " |
31 | SRC_URI[sha256sum] = "8b4de01391e74e3c7014beb43961a2d6d6fa03acc34280b9585f4930745b0544" | 32 | SRC_URI[sha256sum] = "8b4de01391e74e3c7014beb43961a2d6d6fa03acc34280b9585f4930745b0544" |
32 | 33 | ||