diff mbox series

package/ntp: fix build with GCC 14.x

Message ID 20240517120057.3736694-1-yegorslists@googlemail.com
State New
Headers show
Series package/ntp: fix build with GCC 14.x | expand

Commit Message

Frager, Neal via buildroot May 17, 2024, noon UTC
From: Yegor Yefremov <yegorslists@googlemail.com>

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

The patch is taken from a Gentoo repository:

https://gitweb.gentoo.org/repo/gentoo.git/diff/net-misc/ntp/files/ntp-4.2.8_p15-configure-clang16.patch?id=56ef5ce33891feec34cd0c39a0a774a81a587dc7

Bonus: refresh the 0002-ntp-syscalls-fallback.patch file.

Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
---
 package/ntp/0002-ntp-syscalls-fallback.patch  |  9 ++++---
 .../ntp/0003-fix-pthread-detach-check.patch   | 27 +++++++++++++++++++
 2 files changed, 32 insertions(+), 4 deletions(-)
 create mode 100644 package/ntp/0003-fix-pthread-detach-check.patch

Comments

Yann E. MORIN May 17, 2024, 6:25 p.m. UTC | #1
Yegor, All,

On 2024-05-17 14:00 +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.
> 
> The patch is taken from a Gentoo repository:
> 
> https://gitweb.gentoo.org/repo/gentoo.git/diff/net-misc/ntp/files/ntp-4.2.8_p15-configure-clang16.patch?id=56ef5ce33891feec34cd0c39a0a774a81a587dc7
> 
> Bonus: refresh the 0002-ntp-syscalls-fallback.patch file.

Sure, but it's relatively obvious, by looking and the changeset, that
the patch was modified; the interesting information to have in the
commit log is why it was refreshed:

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

> Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> ---
>  package/ntp/0002-ntp-syscalls-fallback.patch  |  9 ++++---
>  .../ntp/0003-fix-pthread-detach-check.patch   | 27 +++++++++++++++++++

    $ make check-package
    package/ntp/0003-fix-pthread-detach-check.patch:0: missing Upstream in the header (https://nightly.buildroot.org/#_additional_patch_documentation)

Yes, you do provide the location where you grabbed the patch from, and
this is very good. Still, we need to know what the upstream status for
that patch is: has it been submitted? If no, why? If yes, what is the
URL to the PR/MR, bug report, email?

It is a bit unfortunate that ntp uses bitkeeper as a VCS, which makes it
a bit more difficult to contribute to, but we still need that in
formation...

I see that the last commits dates from just a few days ago, so the
project is not dead.

Could you please check whether this patch was submitted? Maybe there is
some info about that in the gentoo history for that 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(

Just fixing the line would have made for a smaller delta, with less
useless changes in the diff metadata.

Also, the patch was (almost) git-formatted, which is the preferred form
for bundled patches. Unless it is submitted to, or backported from the
upstream VCS, in which case it should be in a format supported by that
VCS. ;-)

Regards,
Yann E. MORIN.
Yegor Yefremov May 18, 2024, 10 a.m. UTC | #2
Hi Yann,

On Fri, May 17, 2024 at 8:25 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> Yegor, All,
>
> On 2024-05-17 14:00 +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.
> >
> > The patch is taken from a Gentoo repository:
> >
> > https://gitweb.gentoo.org/repo/gentoo.git/diff/net-misc/ntp/files/ntp-4.2.8_p15-configure-clang16.patch?id=56ef5ce33891feec34cd0c39a0a774a81a587dc7
> >
> > Bonus: refresh the 0002-ntp-syscalls-fallback.patch file.
>
> Sure, but it's relatively obvious, by looking and the changeset, that
> the patch was modified; the interesting information to have in the
> commit log is why it was refreshed:
>
>     Addtionally, refresh patch 0002 to fix the offset of hunk 1.
>
> > Signed-off-by: Yegor Yefremov <yegorslists@googlemail.com>
> > ---
> >  package/ntp/0002-ntp-syscalls-fallback.patch  |  9 ++++---
> >  .../ntp/0003-fix-pthread-detach-check.patch   | 27 +++++++++++++++++++
>
>     $ make check-package
>     package/ntp/0003-fix-pthread-detach-check.patch:0: missing Upstream in the header (https://nightly.buildroot.org/#_additional_patch_documentation)
>
> Yes, you do provide the location where you grabbed the patch from, and
> this is very good. Still, we need to know what the upstream status for
> that patch is: has it been submitted? If no, why? If yes, what is the
> URL to the PR/MR, bug report, email?
>
> It is a bit unfortunate that ntp uses bitkeeper as a VCS, which makes it
> a bit more difficult to contribute to, but we still need that in
> formation...
>
> I see that the last commits dates from just a few days ago, so the
> project is not dead.
>
> Could you please check whether this patch was submitted? Maybe there is
> some info about that in the gentoo history for that 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(
>
> Just fixing the line would have made for a smaller delta, with less
> useless changes in the diff metadata.
>
> Also, the patch was (almost) git-formatted, which is the preferred form
> for bundled patches. Unless it is submitted to, or backported from the
> upstream VCS, in which case it should be in a format supported by that
> VCS. ;-)

Now, it is official: https://bugs.ntp.org/show_bug.cgi?id=3926

I'll wait till the patch is committed and then will make v2.

Yegor
Yann E. MORIN May 18, 2024, 10:16 a.m. UTC | #3
Yegor, All,

On 2024-05-18 12:00 +0200, Yegor Yefremov spake thusly:
> Now, it is official: https://bugs.ntp.org/show_bug.cgi?id=3926

That's great, thanks! And upstream looks quite happy with it. :-)

> I'll wait till the patch is committed and then will make v2.

You don't need to wait for the patch to be applied upstream; just add an
upstream tag to the patch, pointing to that bug report:

    Upstream: https://bugs.ntp.org/show_bug.cgi?id=3926
    Signed-off-by: You

That way, the next person to bump ntp can assess whether that patch
needs to be carried/rebased/dropped, by checking the upstream status.

Thanks!

Regards,
Yann E. MORIN.
Yegor Yefremov May 21, 2024, 9:35 a.m. UTC | #4
Yann, All,

On Sat, May 18, 2024 at 12:16 PM Yann E. MORIN <yann.morin.1998@free.fr> wrote:
>
> Yegor, All,
>
> On 2024-05-18 12:00 +0200, Yegor Yefremov spake thusly:
> > Now, it is official: https://bugs.ntp.org/show_bug.cgi?id=3926
>
> That's great, thanks! And upstream looks quite happy with it. :-)
>
> > I'll wait till the patch is committed and then will make v2.
>
> You don't need to wait for the patch to be applied upstream; just add an
> upstream tag to the patch, pointing to that bug report:
>
>     Upstream: https://bugs.ntp.org/show_bug.cgi?id=3926
>     Signed-off-by: You
>
> That way, the next person to bump ntp can assess whether that patch
> needs to be carried/rebased/dropped, by checking the upstream status.

We are almost there. The fix landed at the maintainer's personal repo.

Another show stopper with GCC 14.x is lrzsz. There are a lot of issues
described in this one [1] and without any feedback :-(

[1] https://github.com/UweOhse/lrzsz/issues/3


Yegor
diff mbox series

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..c61b6cc736
--- /dev/null
+++ b/package/ntp/0003-fix-pthread-detach-check.patch
@@ -0,0 +1,27 @@ 
+fix pthread_detach check
+
+Refrence:
+ https://gitweb.gentoo.org/repo/gentoo.git/diff/net-misc/ntp/files/ntp-4.2.8_p15-configure-clang16.patch?id=56ef5ce33891feec34cd0c39a0a774a81a587dc7
+
+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