All of lore.kernel.org
 help / color / mirror / Atom feed
* [Buildroot] [PATCH v3] package/ntp: fix build with GCC 14.x
@ 2024-06-03 13:43 yegorslists--- via buildroot
  2024-06-03 13:49 ` Yegor Yefremov via buildroot
  2024-06-03 21:33 ` Yann E. MORIN
  0 siblings, 2 replies; 3+ messages in thread
From: yegorslists--- via buildroot @ 2024-06-03 13:43 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, yann.morin.1998

From: Yegor Yefremov <yegorslists@googlemail.com>

Fix pthread_detach() detection that is broken when building
with GCC 14.x:

checking for pthread_kill... yes
checking for pthread_rwlock_destroy with <pthread.h>... yes
checking for pthread_detach with <pthread.h>... no
configure: error: could not locate pthread_detach()
make[1]: *** [package/pkg-generic.mk:273:
/home/user/buildroot/bsp-barebox/build/ntp-4.2.8p17/.stamp_configured]
Error 1
make: *** [Makefile:82: _all] Error 2

Reference: https://bugs.ntp.org/show_bug.cgi?id=3926

Additionally, refresh patch 0002 to fix the offset of hunk 1.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
Changes v1 -> v2:
 - add upstream reference (Yann E. MORIN)
 - rework 0002 refresh reason (Yann E. MORIN)
 - add error log

Changes v2 -> v3:
 - add proper Upstream tag to the 0003-fix-pthread-detach-check.patch
   file

 package/ntp/0002-ntp-syscalls-fallback.patch  |  9 ++++---
 .../ntp/0003-fix-pthread-detach-check.patch   | 26 +++++++++++++++++++
 2 files changed, 31 insertions(+), 4 deletions(-)
 create mode 100644 package/ntp/0003-fix-pthread-detach-check.patch

diff --git a/package/ntp/0002-ntp-syscalls-fallback.patch b/package/ntp/0002-ntp-syscalls-fallback.patch
index 535fc93dfd..46704b9d3f 100644
--- a/package/ntp/0002-ntp-syscalls-fallback.patch
+++ b/package/ntp/0002-ntp-syscalls-fallback.patch
@@ -8,10 +8,11 @@ Signed-off-by: James Knight <james.knight@rockwellcollins.com>
  configure.ac | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)

-diff --git a/configure.ac b/configure.ac
---- a/configure.ac
-+++ b/configure.ac
-@@ -1523,11 +1523,11 @@ AC_CACHE_CHECK(
+Index: ntp-4.2.8p17/configure.ac
+===================================================================
+--- ntp-4.2.8p17.orig/configure.ac
++++ ntp-4.2.8p17/configure.ac
+@@ -1472,11 +1472,11 @@ AC_CACHE_CHECK(
      [ntp_cv_var_ntp_syscalls],
      [
  	ntp_cv_var_ntp_syscalls=no
diff --git a/package/ntp/0003-fix-pthread-detach-check.patch b/package/ntp/0003-fix-pthread-detach-check.patch
new file mode 100644
index 0000000000..894b422f2c
--- /dev/null
+++ b/package/ntp/0003-fix-pthread-detach-check.patch
@@ -0,0 +1,26 @@
+fix pthread_detach check
+
+Upstream: https://bugs.ntp.org/show_bug.cgi?id=3926
+
+Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
+---
+ sntp/m4/openldap-thread-check.m4 |    6 ++----
+ 1 file changed, 2 insertions(+), 4 deletions(-)
+
+Index: ntp-4.2.8p17/sntp/m4/openldap-thread-check.m4
+===================================================================
+--- ntp-4.2.8p17.orig/sntp/m4/openldap-thread-check.m4
++++ ntp-4.2.8p17/sntp/m4/openldap-thread-check.m4
+@@ -262,10 +262,8 @@ pthread_rwlock_t rwlock;
+ 				dnl save the flags
+ 				AC_LINK_IFELSE([AC_LANG_PROGRAM([[
+ #include <pthread.h>
+-#ifndef NULL
+-#define NULL (void*)0
+-#endif
+-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
++pthread_t thread;
++]], [[pthread_detach(thread);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
+ 			])
+
+ 			if test $ol_cv_func_pthread_detach = no ; then
--
2.34.1

_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH v3] package/ntp: fix build with GCC 14.x
  2024-06-03 13:43 [Buildroot] [PATCH v3] package/ntp: fix build with GCC 14.x yegorslists--- via buildroot
@ 2024-06-03 13:49 ` Yegor Yefremov via buildroot
  2024-06-03 21:33 ` Yann E. MORIN
  1 sibling, 0 replies; 3+ messages in thread
From: Yegor Yefremov via buildroot @ 2024-06-03 13:49 UTC (permalink / raw)
  To: buildroot; +Cc: Bernd Kuhls, yann.morin.1998

Yann, All,

On Mon, Jun 3, 2024 at 3:44 PM <yegorslists@googlemail.com> wrote:
>
> From: Yegor Yefremov <yegorslists@googlemail.com>
>
> Fix pthread_detach() detection that is broken when building
> with GCC 14.x:
>
> checking for pthread_kill... yes
> checking for pthread_rwlock_destroy with <pthread.h>... yes
> checking for pthread_detach with <pthread.h>... no
> configure: error: could not locate pthread_detach()
> make[1]: *** [package/pkg-generic.mk:273:
> /home/user/buildroot/bsp-barebox/build/ntp-4.2.8p17/.stamp_configured]
> Error 1
> make: *** [Makefile:82: _all] Error 2
>
> Reference: https://bugs.ntp.org/show_bug.cgi?id=3926
>
> Additionally, refresh patch 0002 to fix the offset of hunk 1.
>
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
> Changes v1 -> v2:
>  - add upstream reference (Yann E. MORIN)
>  - rework 0002 refresh reason (Yann E. MORIN)
>  - add error log
>
> Changes v2 -> v3:
>  - add proper Upstream tag to the 0003-fix-pthread-detach-check.patch
>    file
>
>  package/ntp/0002-ntp-syscalls-fallback.patch  |  9 ++++---
>  .../ntp/0003-fix-pthread-detach-check.patch   | 26 +++++++++++++++++++
>  2 files changed, 31 insertions(+), 4 deletions(-)
>  create mode 100644 package/ntp/0003-fix-pthread-detach-check.patch
>
> diff --git a/package/ntp/0002-ntp-syscalls-fallback.patch b/package/ntp/0002-ntp-syscalls-fallback.patch
> index 535fc93dfd..46704b9d3f 100644
> --- a/package/ntp/0002-ntp-syscalls-fallback.patch
> +++ b/package/ntp/0002-ntp-syscalls-fallback.patch
> @@ -8,10 +8,11 @@ Signed-off-by: James Knight <james.knight@rockwellcollins.com>
>   configure.ac | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
>
> -diff --git a/configure.ac b/configure.ac
> ---- a/configure.ac
> -+++ b/configure.ac
> -@@ -1523,11 +1523,11 @@ AC_CACHE_CHECK(
> +Index: ntp-4.2.8p17/configure.ac
> +===================================================================
> +--- ntp-4.2.8p17.orig/configure.ac
> ++++ ntp-4.2.8p17/configure.ac
> +@@ -1472,11 +1472,11 @@ AC_CACHE_CHECK(
>       [ntp_cv_var_ntp_syscalls],
>       [
>         ntp_cv_var_ntp_syscalls=no
> diff --git a/package/ntp/0003-fix-pthread-detach-check.patch b/package/ntp/0003-fix-pthread-detach-check.patch
> new file mode 100644
> index 0000000000..894b422f2c
> --- /dev/null
> +++ b/package/ntp/0003-fix-pthread-detach-check.patch
> @@ -0,0 +1,26 @@
> +fix pthread_detach check
> +
> +Upstream: https://bugs.ntp.org/show_bug.cgi?id=3926
> +
> +Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> +---
> + sntp/m4/openldap-thread-check.m4 |    6 ++----
> + 1 file changed, 2 insertions(+), 4 deletions(-)
> +
> +Index: ntp-4.2.8p17/sntp/m4/openldap-thread-check.m4
> +===================================================================
> +--- ntp-4.2.8p17.orig/sntp/m4/openldap-thread-check.m4
> ++++ ntp-4.2.8p17/sntp/m4/openldap-thread-check.m4
> +@@ -262,10 +262,8 @@ pthread_rwlock_t rwlock;
> +                               dnl save the flags
> +                               AC_LINK_IFELSE([AC_LANG_PROGRAM([[
> + #include <pthread.h>
> +-#ifndef NULL
> +-#define NULL (void*)0
> +-#endif
> +-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
> ++pthread_t thread;
> ++]], [[pthread_detach(thread);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
> +                       ])
> +
> +                       if test $ol_cv_func_pthread_detach = no ; then
> --
> 2.34.1

Though there is a new ntp release, this fix is not included in ntp-4.2.8p18 :-(
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Buildroot] [PATCH v3] package/ntp: fix build with GCC 14.x
  2024-06-03 13:43 [Buildroot] [PATCH v3] package/ntp: fix build with GCC 14.x yegorslists--- via buildroot
  2024-06-03 13:49 ` Yegor Yefremov via buildroot
@ 2024-06-03 21:33 ` Yann E. MORIN
  1 sibling, 0 replies; 3+ messages in thread
From: Yann E. MORIN @ 2024-06-03 21:33 UTC (permalink / raw)
  To: yegorslists; +Cc: Bernd Kuhls, buildroot

Yegor, All,

On 2024-06-03 15:43 +0200, yegorslists--- via buildroot spake thusly:
> From: Yegor Yefremov <yegorslists@googlemail.com>
> 
> Fix pthread_detach() detection that is broken when building
> with GCC 14.x:
> 
> checking for pthread_kill... yes
> checking for pthread_rwlock_destroy with <pthread.h>... yes
> checking for pthread_detach with <pthread.h>... no
> configure: error: could not locate pthread_detach()
> make[1]: *** [package/pkg-generic.mk:273:
> /home/user/buildroot/bsp-barebox/build/ntp-4.2.8p17/.stamp_configured]
> Error 1
> make: *** [Makefile:82: _all] Error 2
> 
> Reference: https://bugs.ntp.org/show_bug.cgi?id=3926
> 
> Additionally, refresh patch 0002 to fix the offset of hunk 1.
> 
> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>

Applied to master, thanks.

Regards,
Yann E. MORIN.

> ---
> Changes v1 -> v2:
>  - add upstream reference (Yann E. MORIN)
>  - rework 0002 refresh reason (Yann E. MORIN)
>  - add error log
> 
> Changes v2 -> v3:
>  - add proper Upstream tag to the 0003-fix-pthread-detach-check.patch
>    file
> 
>  package/ntp/0002-ntp-syscalls-fallback.patch  |  9 ++++---
>  .../ntp/0003-fix-pthread-detach-check.patch   | 26 +++++++++++++++++++
>  2 files changed, 31 insertions(+), 4 deletions(-)
>  create mode 100644 package/ntp/0003-fix-pthread-detach-check.patch
> 
> diff --git a/package/ntp/0002-ntp-syscalls-fallback.patch b/package/ntp/0002-ntp-syscalls-fallback.patch
> index 535fc93dfd..46704b9d3f 100644
> --- a/package/ntp/0002-ntp-syscalls-fallback.patch
> +++ b/package/ntp/0002-ntp-syscalls-fallback.patch
> @@ -8,10 +8,11 @@ Signed-off-by: James Knight <james.knight@rockwellcollins.com>
>   configure.ac | 4 ++--
>   1 file changed, 2 insertions(+), 2 deletions(-)
> 
> -diff --git a/configure.ac b/configure.ac
> ---- a/configure.ac
> -+++ b/configure.ac
> -@@ -1523,11 +1523,11 @@ AC_CACHE_CHECK(
> +Index: ntp-4.2.8p17/configure.ac
> +===================================================================
> +--- ntp-4.2.8p17.orig/configure.ac
> ++++ ntp-4.2.8p17/configure.ac
> +@@ -1472,11 +1472,11 @@ AC_CACHE_CHECK(
>       [ntp_cv_var_ntp_syscalls],
>       [
>   	ntp_cv_var_ntp_syscalls=no
> diff --git a/package/ntp/0003-fix-pthread-detach-check.patch b/package/ntp/0003-fix-pthread-detach-check.patch
> new file mode 100644
> index 0000000000..894b422f2c
> --- /dev/null
> +++ b/package/ntp/0003-fix-pthread-detach-check.patch
> @@ -0,0 +1,26 @@
> +fix pthread_detach check
> +
> +Upstream: https://bugs.ntp.org/show_bug.cgi?id=3926
> +
> +Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> +---
> + sntp/m4/openldap-thread-check.m4 |    6 ++----
> + 1 file changed, 2 insertions(+), 4 deletions(-)
> +
> +Index: ntp-4.2.8p17/sntp/m4/openldap-thread-check.m4
> +===================================================================
> +--- ntp-4.2.8p17.orig/sntp/m4/openldap-thread-check.m4
> ++++ ntp-4.2.8p17/sntp/m4/openldap-thread-check.m4
> +@@ -262,10 +262,8 @@ pthread_rwlock_t rwlock;
> + 				dnl save the flags
> + 				AC_LINK_IFELSE([AC_LANG_PROGRAM([[
> + #include <pthread.h>
> +-#ifndef NULL
> +-#define NULL (void*)0
> +-#endif
> +-]], [[pthread_detach(NULL);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
> ++pthread_t thread;
> ++]], [[pthread_detach(thread);]])],[ol_cv_func_pthread_detach=yes],[ol_cv_func_pthread_detach=no])
> + 			])
> +
> + 			if test $ol_cv_func_pthread_detach = no ; then
> --
> 2.34.1
> 
> _______________________________________________
> buildroot mailing list
> buildroot@buildroot.org
> https://lists.buildroot.org/mailman/listinfo/buildroot

-- 
.-----------------.--------------------.------------------.--------------------.
|  Yann E. MORIN  | Real-Time Embedded | /"\ ASCII RIBBON | Erics' conspiracy: |
| +33 662 376 056 | Software  Designer | \ / CAMPAIGN     |  ___               |
| +33 561 099 427 `------------.-------:  X  AGAINST      |  \e/  There is no  |
| http://ymorin.is-a-geek.org/ | _/*\_ | / \ HTML MAIL    |   v   conspiracy.  |
'------------------------------^-------^------------------^--------------------'
_______________________________________________
buildroot mailing list
buildroot@buildroot.org
https://lists.buildroot.org/mailman/listinfo/buildroot

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2024-06-03 21:33 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-06-03 13:43 [Buildroot] [PATCH v3] package/ntp: fix build with GCC 14.x yegorslists--- via buildroot
2024-06-03 13:49 ` Yegor Yefremov via buildroot
2024-06-03 21:33 ` Yann E. MORIN

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.