From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: app-metrics/collectd/files/, app-metrics/collectd/
Date: Fri, 14 Apr 2023 03:39:40 +0000 (UTC) [thread overview]
Message-ID: <1681442582.eff1ccb300e56b56ceea1fa204946647366afff3.sam@gentoo> (raw)
commit: eff1ccb300e56b56ceea1fa204946647366afff3
Author: Sam James <sam <AT> gentoo <DOT> org>
AuthorDate: Fri Apr 14 02:50:58 2023 +0000
Commit: Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Fri Apr 14 03:23:02 2023 +0000
URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=eff1ccb3
app-metrics/collectd: fix configure w/ clang 16
Closes: https://bugs.gentoo.org/879633
Closes: https://bugs.gentoo.org/900392
Signed-off-by: Sam James <sam <AT> gentoo.org>
...-5.12.0-r7.ebuild => collectd-5.12.0-r8.ebuild} | 1 +
.../files/collectd-5.12.0-clang16-configure.patch | 127 +++++++++++++++++++++
2 files changed, 128 insertions(+)
diff --git a/app-metrics/collectd/collectd-5.12.0-r7.ebuild b/app-metrics/collectd/collectd-5.12.0-r8.ebuild
similarity index 99%
rename from app-metrics/collectd/collectd-5.12.0-r7.ebuild
rename to app-metrics/collectd/collectd-5.12.0-r8.ebuild
index 9662889050c6..0c8c8c88baa4 100644
--- a/app-metrics/collectd/collectd-5.12.0-r7.ebuild
+++ b/app-metrics/collectd/collectd-5.12.0-r8.ebuild
@@ -173,6 +173,7 @@ REQUIRED_USE="
PATCHES=(
"${FILESDIR}"/${PN}-5.11.0-libsigrok-0.4+.patch
"${FILESDIR}"/${PN}-5.12.0-python3_11.patch
+ "${FILESDIR}"/${PN}-5.12.0-clang16-configure.patch
)
# @FUNCTION: collectd_plugin_kernel_linux
diff --git a/app-metrics/collectd/files/collectd-5.12.0-clang16-configure.patch b/app-metrics/collectd/files/collectd-5.12.0-clang16-configure.patch
new file mode 100644
index 000000000000..578099579c47
--- /dev/null
+++ b/app-metrics/collectd/files/collectd-5.12.0-clang16-configure.patch
@@ -0,0 +1,127 @@
+https://bugs.gentoo.org/879633
+https://bugs.gentoo.org/900392
+https://github.com/collectd/collectd/pull/4106
+
+From f23164e589502ff675b3b54fa598bd9efd1422ed Mon Sep 17 00:00:00 2001
+From: Florian Weimer <fweimer@redhat.com>
+Date: Thu, 6 Apr 2023 19:00:08 +0200
+Subject: [PATCH] Fix glibc feature macro handling for timegm
+
+The way strptime is activated using feature macros, _DEFAULT_SOURCE
+(successor to _BSD_SOURCE) is disabled implicitly, so timegm is
+hidden. Defining _DEFAULT_SOURCE at the same time as the other
+feature macros solves this, and removes the need for the
+TIMEGM_NEEDS_BSD configure macro.
+
+This avoids an implicit declaration of timegm in src/bind.c, and build
+failures with future compilers.
+---
+ configure.ac | 53 ++++++++++++----------------------------------------
+ src/bind.c | 10 +++++-----
+ 2 files changed, 17 insertions(+), 46 deletions(-)
+
+diff --git a/configure.ac b/configure.ac
+index bbe65a7e99..78bbff6624 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -974,6 +974,12 @@ if test "x$have_strptime" = "xyes" && test "x$c_cv_have_strptime_default" = "xno
+ #ifndef _XOPEN_SOURCE
+ # define _XOPEN_SOURCE 500
+ #endif
++ # ifndef _BSD_SOURCE
++ # define _BSD_SOURCE
++ # endif
++ # ifndef _DEFAULT_SOURCE
++ # define _DEFAULT_SOURCE
++ # endif
+ #include <time.h>
+ ]],
+ [[
+@@ -1024,6 +1030,12 @@ AC_CACHE_CHECK([for timegm],
+ # ifndef _XOPEN_SOURCE
+ # define _XOPEN_SOURCE 500
+ # endif
++# ifndef _BSD_SOURCE
++# define _BSD_SOURCE
++# endif
++# ifndef _DEFAULT_SOURCE
++# define _DEFAULT_SOURCE
++# endif
+ #endif
+ #include <time.h>
+ ]]],
+@@ -1039,50 +1051,9 @@ AC_CACHE_CHECK([for timegm],
+ )
+ )
+
+-if test "x$c_cv_have_timegm" != "xyes"
+-then
+- AC_CACHE_CHECK([for timegm with _BSD_SOURCE],
+- [c_cv_have_timegm_bsd],
+- AC_LINK_IFELSE(
+- [AC_LANG_PROGRAM(
+-[[[
+-#if STRPTIME_NEEDS_STANDARDS
+-# ifndef _ISOC99_SOURCE
+-# define _ISOC99_SOURCE 1
+-# endif
+-# ifndef _POSIX_C_SOURCE
+-# define _POSIX_C_SOURCE 200112L
+-# endif
+-# ifndef _XOPEN_SOURCE
+-# define _XOPEN_SOURCE 500
+-# endif
+-#endif
+-#ifndef _BSD_SOURCE
+-# define _BSD_SOURCE 1
+-#endif
+-#include <time.h>
+-]]],
+-[[[
+- time_t t = timegm(&(struct tm){0});
+- if (t == ((time_t) -1)) {
+- return 1;
+- }
+-]]]
+- )],
+- [c_cv_have_timegm_bsd="yes"
+- c_cv_have_timegm="yes"],
+- [c_cv_have_timegm_bsd="no"]
+- )
+- )
+-fi
+-
+ if test "x$c_cv_have_timegm" = "xyes"
+ then
+ AC_DEFINE(HAVE_TIMEGM, 1, [Define if the timegm(3) function is available.])
+- if test "x$c_cv_have_timegm_bsd" = "xyes"
+- then
+- AC_DEFINE(TIMEGM_NEEDS_BSD, 1, [Set to true if timegm is only exported in BSD mode.])
+- fi
+ fi
+
+ CFLAGS="$SAVE_CFLAGS"
+diff --git a/src/bind.c b/src/bind.c
+index a246f1aacf..4a7c024253 100644
+--- a/src/bind.c
++++ b/src/bind.c
+@@ -33,13 +33,13 @@
+ #ifndef _XOPEN_SOURCE
+ #define _XOPEN_SOURCE 500
+ #endif
+-#endif /* STRPTIME_NEEDS_STANDARDS */
+-
+-#if TIMEGM_NEEDS_BSD
+ #ifndef _BSD_SOURCE
+-#define _BSD_SOURCE 1
++#define _BSD_SOURCE
+ #endif
+-#endif /* TIMEGM_NEEDS_BSD */
++#ifndef _DEFAULT_SOURCE
++#define _DEFAULT_SOURCE
++#endif
++#endif /* STRPTIME_NEEDS_STANDARDS */
+
+ #include "collectd.h"
+
+
next reply other threads:[~2023-04-14 3:39 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-04-14 3:39 Sam James [this message]
-- strict thread matches above, loose matches on Subject: below --
2023-12-04 7:32 [gentoo-commits] repo/gentoo:master commit in: app-metrics/collectd/files/, app-metrics/collectd/ Sam James
2022-11-10 23:04 Conrad Kostecki
2022-06-07 17:58 Conrad Kostecki
2022-06-05 14:06 Conrad Kostecki
2020-08-05 15:35 Thomas Deutschmann
2019-08-21 22:53 Thomas Deutschmann
2019-07-20 0:13 Thomas Deutschmann
2018-11-30 19:50 Thomas Deutschmann
2018-08-02 18:40 Thomas Deutschmann
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1681442582.eff1ccb300e56b56ceea1fa204946647366afff3.sam@gentoo \
--to=sam@gentoo.org \
--cc=gentoo-commits@lists.gentoo.org \
--cc=gentoo-dev@lists.gentoo.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox