commit:     7094bf58386e8970a0b96b92938f42e61c6bb656
Author:     Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Sun Oct 17 06:21:32 2021 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Sun Oct 17 06:21:40 2021 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=7094bf58

net-misc/ntp: fix build with glibc-2.34

Closes: https://bugs.gentoo.org/806358
Signed-off-by: Sam James <sam <AT> gentoo.org>

 net-misc/ntp/files/ntp-4.2.8_p15-glibc-2.34.patch | 28 +++++++++++++++++++++++
 net-misc/ntp/ntp-4.2.8_p15.ebuild                 |  1 +
 2 files changed, 29 insertions(+)

diff --git a/net-misc/ntp/files/ntp-4.2.8_p15-glibc-2.34.patch 
b/net-misc/ntp/files/ntp-4.2.8_p15-glibc-2.34.patch
new file mode 100644
index 00000000000..a32f3adabd8
--- /dev/null
+++ b/net-misc/ntp/files/ntp-4.2.8_p15-glibc-2.34.patch
@@ -0,0 +1,28 @@
+https://bugs.gentoo.org/806358
+https://patchwork.openembedded.org/patch/180019/
+
+From: Khem Raj <[email protected]>
+Date: Sat, 31 Jul 2021 10:51:41 -0700
+Subject: [PATCH] libntp: Do not use PTHREAD_STACK_MIN on glibc
+
+In glibc 2.34+ PTHREAD_STACK_MIN is not a compile-time constant which
+could mean different stack sizes at runtime on different architectures
+and it also causes compile failure. Default glibc thread stack size
+or 64Kb set by ntp should be good in glibc these days.
+
+Upstream-Status: Pending
+Signed-off-by: Khem Raj <[email protected]>
+--- a/libntp/work_thread.c
++++ b/libntp/work_thread.c
+@@ -41,7 +41,7 @@
+ #ifndef THREAD_MINSTACKSIZE
+ # define THREAD_MINSTACKSIZE  (64U * 1024)
+ #endif
+-#ifndef __sun
++#if !defined(__sun) && !defined(__GLIBC__)
+ #if defined(PTHREAD_STACK_MIN) && THREAD_MINSTACKSIZE < PTHREAD_STACK_MIN
+ # undef THREAD_MINSTACKSIZE
+ # define THREAD_MINSTACKSIZE PTHREAD_STACK_MIN
+--
+2.32.0
+

diff --git a/net-misc/ntp/ntp-4.2.8_p15.ebuild 
b/net-misc/ntp/ntp-4.2.8_p15.ebuild
index 0809ce703a5..7e9d8bc04c2 100644
--- a/net-misc/ntp/ntp-4.2.8_p15.ebuild
+++ b/net-misc/ntp/ntp-4.2.8_p15.ebuild
@@ -47,6 +47,7 @@ PATCHES=(
        "${FILESDIR}"/${PN}-4.2.8_p10-fix-build-wo-ssl-or-libressl.patch
        "${FILESDIR}"/${PN}-4.2.8_p14-add_cap_ipc_lock.patch #711530
        "${FILESDIR}"/${PN}-4.2.8_p15-gcc10.patch #759409
+       "${FILESDIR}"/${PN}-4.2.8_p15-glibc-2.34.patch
 )
 
 src_prepare() {

Reply via email to