diff options
| author | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-13 19:14:03 -0700 |
|---|---|---|
| committer | Khem Raj <khem.raj@oss.qualcomm.com> | 2026-04-13 19:15:56 -0700 |
| commit | b5d466f73189f5bbaf3e8938d92c91bb6c79fd6c (patch) | |
| tree | 0a60ebae7ad09a80671cc77c4e9ecc5a2b8687bb /meta-networking/recipes-support/ntp | |
| parent | d13ec666392f3f80052d079dafc1edda01d5ede8 (diff) | |
| download | meta-openembedded-b5d466f73189f5bbaf3e8938d92c91bb6c79fd6c.tar.gz | |
ntp: Fix build with -std=gnu23
Backport a patch from openLDAP to fix the configure errors with clang-22 -std=gnu23
Fix another issue by dropping C89 signatures in favor of C99 function prototypes
Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com>
Diffstat (limited to 'meta-networking/recipes-support/ntp')
3 files changed, 136 insertions, 0 deletions
diff --git a/meta-networking/recipes-support/ntp/ntp/0001-ITS-10011-build-fix-compatibility-with-stricter-C99-.patch b/meta-networking/recipes-support/ntp/ntp/0001-ITS-10011-build-fix-compatibility-with-stricter-C99-.patch new file mode 100644 index 0000000000..6558fae4ae --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/0001-ITS-10011-build-fix-compatibility-with-stricter-C99-.patch | |||
| @@ -0,0 +1,102 @@ | |||
| 1 | From 58c160ce28328f9a75d41c283ee9b94c10d6ec62 Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Sam James <sam@gentoo.org> | ||
| 3 | Date: Thu, 9 Feb 2023 23:17:53 +0000 | ||
| 4 | Subject: [PATCH] ITS#10011 build: fix compatibility with stricter C99 | ||
| 5 | compilers | ||
| 6 | |||
| 7 | Fix the following warnings: | ||
| 8 | - -Wimplicit-int (fatal with Clang 16) | ||
| 9 | - -Wimplicit-function-declaration (fatal with Clang 16) | ||
| 10 | - -Wincompatible-function-pointer-types (fatal with Clang 16) | ||
| 11 | - -Wint-conversion (fatal with Clang 15) | ||
| 12 | - Old style prototypes (K&R, removed from C23) | ||
| 13 | |||
| 14 | These warnings-now-error led to misconfigurations and failure to build | ||
| 15 | OpenLDAP, as the tests used during configure caused the wrong results | ||
| 16 | to be emitted. | ||
| 17 | |||
| 18 | For more information, see LWN.net [0] or LLVM's Discourse [1], the Gentoo wiki [2], | ||
| 19 | or the (new) c-std-porting mailing list [3]. | ||
| 20 | |||
| 21 | [0] https://lwn.net/Articles/913505/ | ||
| 22 | [1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213 | ||
| 23 | [2] https://wiki.gentoo.org/wiki/Modern_C_porting | ||
| 24 | [3] hosted at lists.linux.dev. | ||
| 25 | |||
| 26 | Bug: https://bugs.gentoo.org/871288 | ||
| 27 | |||
| 28 | Upstream-Status: Pending | ||
| 29 | |||
| 30 | Signed-off-by: Sam James <sam@gentoo.org> | ||
| 31 | Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> | ||
| 32 | --- | ||
| 33 | sntp/m4/openldap.m4 | 16 +++++++++++++--- | ||
| 34 | 1 file changed, 13 insertions(+), 3 deletions(-) | ||
| 35 | |||
| 36 | diff --git a/sntp/m4/openldap.m4 b/sntp/m4/openldap.m4 | ||
| 37 | index 49ffb87..2db6aa3 100644 | ||
| 38 | --- a/sntp/m4/openldap.m4 | ||
| 39 | +++ b/sntp/m4/openldap.m4 | ||
| 40 | @@ -154,6 +154,7 @@ fi | ||
| 41 | if test $ol_cv_header_stdc = yes; then | ||
| 42 | # /bin/cc in Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi. | ||
| 43 | AC_RUN_IFELSE([AC_LANG_SOURCE([[#include <ctype.h> | ||
| 44 | +#include <stdlib.h> | ||
| 45 | #ifndef HAVE_EBCDIC | ||
| 46 | # define ISLOWER(c) ('a' <= (c) && (c) <= 'z') | ||
| 47 | # define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c)) | ||
| 48 | @@ -610,8 +611,12 @@ AC_DEFUN([OL_PTHREAD_TEST_INCLUDES], [[ | ||
| 49 | #define NULL (void*)0 | ||
| 50 | #endif | ||
| 51 | |||
| 52 | +#ifdef __STDC__ | ||
| 53 | +static void *task(void *p) | ||
| 54 | +#else | ||
| 55 | static void *task(p) | ||
| 56 | void *p; | ||
| 57 | +#endif | ||
| 58 | { | ||
| 59 | return (void *) (p == NULL); | ||
| 60 | } | ||
| 61 | @@ -667,9 +672,13 @@ AC_DEFUN([OL_PTHREAD_TEST_FUNCTION],[[ | ||
| 62 | AC_DEFUN([OL_PTHREAD_TEST_PROGRAM], [ | ||
| 63 | AC_LANG_SOURCE([OL_PTHREAD_TEST_INCLUDES | ||
| 64 | |||
| 65 | +#ifdef __STDC__ | ||
| 66 | +int main(int argc, char **argv) | ||
| 67 | +#else | ||
| 68 | int main(argc, argv) | ||
| 69 | int argc; | ||
| 70 | char **argv; | ||
| 71 | +#endif | ||
| 72 | { | ||
| 73 | OL_PTHREAD_TEST_FUNCTION | ||
| 74 | } | ||
| 75 | @@ -791,7 +800,7 @@ AC_CACHE_CHECK([for compatible POSIX regex],ol_cv_c_posix_regex,[ | ||
| 76 | #include <sys/types.h> | ||
| 77 | #include <regex.h> | ||
| 78 | static char *pattern, *string; | ||
| 79 | -main() | ||
| 80 | +int main(void) | ||
| 81 | { | ||
| 82 | int rc; | ||
| 83 | regex_t re; | ||
| 84 | @@ -818,7 +827,8 @@ AC_DEFUN([OL_C_UPPER_LOWER], | ||
| 85 | [AC_CACHE_CHECK([if toupper() requires islower()],ol_cv_c_upper_lower,[ | ||
| 86 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ | ||
| 87 | #include <ctype.h> | ||
| 88 | -main() | ||
| 89 | +#include <stdlib.h> | ||
| 90 | +int main(void) | ||
| 91 | { | ||
| 92 | if ('C' == toupper('C')) | ||
| 93 | exit(0); | ||
| 94 | @@ -873,7 +883,7 @@ AC_DEFUN([OL_NONPOSIX_STRERROR_R], | ||
| 95 | ]])],[ol_cv_nonposix_strerror_r=yes],[ol_cv_nonposix_strerror_r=no]) | ||
| 96 | else | ||
| 97 | AC_RUN_IFELSE([AC_LANG_SOURCE([[ | ||
| 98 | - main() { | ||
| 99 | + int main(void) { | ||
| 100 | char buf[100]; | ||
| 101 | buf[0] = 0; | ||
| 102 | strerror_r( 1, buf, sizeof buf ); | ||
diff --git a/meta-networking/recipes-support/ntp/ntp/0001-colcomp-sntp-libpkgver-colcomp.c-Convert-K-R-functio.patch b/meta-networking/recipes-support/ntp/ntp/0001-colcomp-sntp-libpkgver-colcomp.c-Convert-K-R-functio.patch new file mode 100644 index 0000000000..39f7e537c1 --- /dev/null +++ b/meta-networking/recipes-support/ntp/ntp/0001-colcomp-sntp-libpkgver-colcomp.c-Convert-K-R-functio.patch | |||
| @@ -0,0 +1,32 @@ | |||
| 1 | From cd54486bdced460c174fcb98680ad5ffe64f906a Mon Sep 17 00:00:00 2001 | ||
| 2 | From: Khem Raj <khem.raj@oss.qualcomm.com> | ||
| 3 | Date: Mon, 13 Apr 2026 19:09:24 -0700 | ||
| 4 | Subject: [PATCH] colcomp: sntp/libpkgver/colcomp.c: Convert K&R function | ||
| 5 | definition to ANSI C style | ||
| 6 | |||
| 7 | Replace old-style K&R function declaration with modern ANSI C prototype | ||
| 8 | syntax for colcomp(). Also remove trailing whitespace after return type. | ||
| 9 | |||
| 10 | Upstream-Status: Pending | ||
| 11 | Signed-off-by: Khem Raj <khem.raj@oss.qualcomm.com> | ||
| 12 | --- | ||
| 13 | sntp/libpkgver/colcomp.c | 6 ++---- | ||
| 14 | 1 file changed, 2 insertions(+), 4 deletions(-) | ||
| 15 | |||
| 16 | diff --git a/sntp/libpkgver/colcomp.c b/sntp/libpkgver/colcomp.c | ||
| 17 | index 4b151e3..29ecb3e 100644 | ||
| 18 | --- a/sntp/libpkgver/colcomp.c | ||
| 19 | +++ b/sntp/libpkgver/colcomp.c | ||
| 20 | @@ -33,10 +33,8 @@ | ||
| 21 | #endif | ||
| 22 | |||
| 23 | |||
| 24 | -int | ||
| 25 | -colcomp (s1, s2) | ||
| 26 | - register char *s1; | ||
| 27 | - register char *s2; | ||
| 28 | +int | ||
| 29 | +colcomp (register char *s1, register char *s2) | ||
| 30 | { | ||
| 31 | int hilo = 0; /* comparison value */ | ||
| 32 | |||
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 e59725e3e9..6f9bb01c02 100644 --- a/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb +++ b/meta-networking/recipes-support/ntp/ntp_4.2.8p18.bb | |||
| @@ -17,6 +17,8 @@ SRC_URI = "http://www.eecis.udel.edu/~ntp/ntp_spool/ntp4/ntp-4.2/ntp-${PV}.tar.g | |||
| 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://0001-include-fix-build-failure-with-glibc-2.43-_Generic-m.patch \ |
| 20 | file://0001-ITS-10011-build-fix-compatibility-with-stricter-C99-.patch \ | ||
| 21 | file://0001-colcomp-sntp-libpkgver-colcomp.c-Convert-K-R-functio.patch \ | ||
| 20 | file://ntpd \ | 22 | file://ntpd \ |
| 21 | file://ntp.conf \ | 23 | file://ntp.conf \ |
| 22 | file://ntpd.service \ | 24 | file://ntpd.service \ |
