summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Marko <peter.marko@siemens.com>2026-03-14 14:01:01 +0100
committerKhem Raj <raj.khem@gmail.com>2026-03-18 14:33:24 -0700
commitc823746d7e0203eb40a8c3abbe2c25a6cac0c175 (patch)
tree9ef9d6c85b0832f6ba195515d04f572033d04ca3
parentcce9a3b9373722702973fdeaef31cf78db04f3cd (diff)
downloadmeta-openembedded-c823746d7e0203eb40a8c3abbe2c25a6cac0c175.tar.gz
ntp: fix build with glibc 2.43
Signed-off-by: Peter Marko <peter.marko@siemens.com> Signed-off-by: Khem Raj <raj.khem@gmail.com>
-rw-r--r--meta-networking/recipes-support/ntp/ntp/0001-include-fix-build-failure-with-glibc-2.43-_Generic-m.patch41
-rw-r--r--meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb1
2 files changed, 42 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp/0001-include-fix-build-failure-with-glibc-2.43-_Generic-m.patch b/meta-networking/recipes-support/ntp/ntp/0001-include-fix-build-failure-with-glibc-2.43-_Generic-m.patch
new file mode 100644
index 0000000000..89797b3aa8
--- /dev/null
+++ b/meta-networking/recipes-support/ntp/ntp/0001-include-fix-build-failure-with-glibc-2.43-_Generic-m.patch
@@ -0,0 +1,41 @@
1From c7d76559dada2a6c0c9c18e8343a69b1eabc031e Mon Sep 17 00:00:00 2001
2From: Peter Marko <peter.marko@siemens.com>
3Date: Fri, 13 Mar 2026 13:20:20 +0100
4Subject: [PATCH] include: fix build failure with glibc 2.38+ _Generic memchr
5 macro
6
7Newer glibc defines memchr as a _Generic macro in <string.h>.
8When sntp's config.h lacks a HAVE_MEMCHR definition, the #ifndef guard
9in l_stdlib.h passes and the extern declaration of memchr is emitted.
10The preprocessor expands the memchr token into _Generic(...), producing:
11
12 l_stdlib.h:225:14: error: expected identifier or '(' before '_Generic'
13
14Guard the fallback declarations of memchr and strnlen with an additional
15!defined(memchr) / !defined(strnlen) check so they are skipped when the
16symbols are already provided as macros by the C library headers.
17
18Upstream-Status: Pending
19Signed-off-by: Peter Marko <peter.marko@siemens.com>
20---
21 include/l_stdlib.h | 4 ++--
22 1 file changed, 2 insertions(+), 2 deletions(-)
23
24diff --git a/include/l_stdlib.h b/include/l_stdlib.h
25index fbf57c5..195dc41 100644
26--- a/include/l_stdlib.h
27+++ b/include/l_stdlib.h
28@@ -221,11 +221,11 @@ extern int errno;
29 extern int h_errno;
30 #endif
31
32-#ifndef HAVE_MEMCHR
33+#if !defined(HAVE_MEMCHR) && !defined(memchr)
34 extern void *memchr(const void *s, int c, size_t n);
35 #endif
36
37-#ifndef HAVE_STRNLEN
38+#if !defined(HAVE_STRNLEN) && !defined(strnlen)
39 extern size_t strnlen(const char *s, size_t n);
40 #endif
41
diff --git a/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb b/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb
index a5a6048f8a..e59725e3e9 100644
--- a/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb
+++ b/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb
@@ -16,6 +16,7 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.g
16 file://0001-libntp-Do-not-use-PTHREAD_STACK_MIN-on-glibc.patch \ 16 file://0001-libntp-Do-not-use-PTHREAD_STACK_MIN-on-glibc.patch \
17 file://0001-test-Fix-build-with-new-compiler-defaults-to-fno-com.patch \ 17 file://0001-test-Fix-build-with-new-compiler-defaults-to-fno-com.patch \
18 file://0001-sntp-Fix-types-in-check-for-pthread_detach.patch \ 18 file://0001-sntp-Fix-types-in-check-for-pthread_detach.patch \
19 file://0001-include-fix-build-failure-with-glibc-2.43-_Generic-m.patch \
19 file://ntpd \ 20 file://ntpd \
20 file://ntp.conf \ 21 file://ntp.conf \
21 file://ntpd.service \ 22 file://ntpd.service \