Re: [PATCH 1/3] Add some supporting framework for C11-style atomics.

2025-04-06 Thread Mark Wielaard
Hi Dmitry,

On Fri, Apr 04, 2025 at 04:04:21PM +0300, Dmitry V. Levin wrote:
> On Fri, Apr 04, 2025 at 01:38:01PM +0200, Mark Wielaard wrote:
> > But maybe we should just use AC_CHECK_HEADERS([stdatomic.h]) and drop
> > the AC_COMPILE_IFELSE trick?
> 
> Sure.  And if we want to keep AC_MSG_ERROR, then
>   AC_CHECK_HEADERS([stdatomic.h], [], [AC_MSG_ERROR([stdatomic.h required])])
> should be fine.

That would indeed simplify things. Pushed the attached patch.

Cheers,

Mark>From 3b71249d4396f742d68e774313c2a2d9caf4d668 Mon Sep 17 00:00:00 2001
From: Mark Wielaard 
Date: Sun, 6 Apr 2025 18:04:10 +0200
Subject: [PATCH] configure: Use AC_CHECK_HEADERS to detect stdatomic.h

* configure.ac: Use AC_CHECK_HEADERS instead of
AC_COMPILE_IFELSE.

Suggested-by: Dmitry V. Levin 
Signed-off-by: Mark Wielaard 
---
 configure.ac | 6 +-
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1679a17dd23d..27488e3fe44a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -228,11 +228,7 @@ AS_IF([test "x$ac_cv_tls" != xyes],
 
 dnl Although we test for C11 above that doesn't mean we have stdatomic.h
 dnl We need at least gcc 4.9+ for that.
-AC_CACHE_CHECK([whether gcc provides stdatomic.h], ac_cv_has_stdatomic,
-  [AC_COMPILE_IFELSE([AC_LANG_SOURCE([[#include ]])],
-ac_cv_has_stdatomic=yes, ac_cv_has_stdatomic=no)])
-AS_IF([test "x$ac_cv_has_stdatomic" = "xno"],
-  [AC_MSG_ERROR([stdatomic.h required])])
+AC_CHECK_HEADERS([stdatomic.h], [], [AC_MSG_ERROR([stdatomic.h required])])
 
 dnl This test must come as early as possible after the compiler configuration
 dnl tests, because the choice of the file model can (in principle) affect
-- 
2.49.0



Re: [PATCH] Avoid double-including config.h

2025-04-06 Thread Mark Wielaard
Hi Dmitry,

On Fri, Apr 04, 2025 at 04:07:26PM +0300, Dmitry V. Levin wrote:
> On Fri, Apr 04, 2025 at 01:55:48PM +0200, Mark Wielaard wrote:
> > So to be (pedantically) correct should we include the attached?
> 
> Yes, this should be fine, along with
> 
> --- a/lib/crc32.c
> +++ b/lib/crc32.c
> @@ -28 +28 @@
> -#if HAVE_CONFIG_H
> +#ifdef HAVE_CONFIG_H

Thanks, I had missed that one.
Added and pushed as attached.

Cheers,

Mark>From f33f4c85581045ae493e7f12c6ba1bf5829d8192 Mon Sep 17 00:00:00 2001
From: Mark Wielaard 
Date: Fri, 4 Apr 2025 13:50:04 +0200
Subject: [PATCH] lib: Prevent double inclusion of config.h through system.h

Files that include both  and "system.h" might include
config.h twice. Prevent that by adding a guard check in system.h
before including config.h.

   * lib/crc32.c: Use #ifdef HAVE_CONFIG_H instead of #if.
   * lib/error.h: Check HAVE_CONFIG_H before including config.h.
   * lib/system.h: Check both HAVE_CONFIG_H and whether
   EU_CONFIG_H is defined before including config.h.

Suggested-by: Dmitry V. Levin 
Signed-off-by: Mark Wielaard 
---
 lib/crc32.c  | 2 +-
 lib/error.c  | 4 +++-
 lib/system.h | 7 ++-
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/lib/crc32.c b/lib/crc32.c
index 758602ea02fd..eae658225f76 100644
--- a/lib/crc32.c
+++ b/lib/crc32.c
@@ -25,7 +25,7 @@
the GNU Lesser General Public License along with this program.  If
not, see .  */
 
-#if HAVE_CONFIG_H
+#ifdef HAVE_CONFIG_H
 #include 
 #endif
 
diff --git a/lib/error.c b/lib/error.c
index 5186fc15e9d5..75c9eafb58ba 100644
--- a/lib/error.c
+++ b/lib/error.c
@@ -26,7 +26,9 @@
the GNU Lesser General Public License along with this program.  If
not, see .  */
 
-#include 
+#ifdef HAVE_CONFIG_H
+# include 
+#endif
 
 #if !defined(HAVE_ERROR_H) && defined(HAVE_ERR_H)
 #include 
diff --git a/lib/system.h b/lib/system.h
index 0698e5ffbe2f..c17e2aa0fea1 100644
--- a/lib/system.h
+++ b/lib/system.h
@@ -31,7 +31,12 @@
 #ifndef LIB_SYSTEM_H
 #define LIB_SYSTEM_H   1
 
-#include 
+/* Prevent double inclusion of config.h, config.h includes eu-config.h.  */
+#ifdef HAVE_CONFIG_H
+#ifndef EU_CONFIG_H
+# include 
+#endif
+#endif
 
 #include 
 #include 
-- 
2.49.0



☺ Buildbot (Sourceware): elfutils - build successful (main)

2025-04-06 Thread builder
A restored build has been detected on builder elfutils-debian-ppc64 while 
building elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#/builders/63/builds/480

Build state: build successful
Revision: f33f4c85581045ae493e7f12c6ba1bf5829d8192
Worker: debian-ppc64
Build Reason: (unknown)
Blamelist: Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/6/logs/warnings__3_

- 7: make check ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/7/logs/test-suite_log

- 8: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/8/logs/stdio

- 9: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/9/logs/stdio

- 10: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/10/logs/stdio

- 11: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/11/logs/stdio

- 12: pass .bunsen.source.* ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/12/logs/stdio

- 13: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/13/logs/stdio

- 14: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/14/logs/stdio

- 15: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/480/steps/15/logs/stdio



☺ Buildbot (Sourceware): elfutils - build successful (main)

2025-04-06 Thread builder
A restored build has been detected on builder elfutils-debian-armhf while 
building elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#/builders/6/builds/404

Build state: build successful
Revision: 3b71249d4396f742d68e774313c2a2d9caf4d668
Worker: debian-armhf
Build Reason: (unknown)
Blamelist: Mark Wielaard , Samuel Zeter 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/6/logs/warnings__3_

- 7: make check ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/7/logs/test-suite_log

- 8: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/8/logs/stdio

- 9: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/9/logs/stdio

- 10: fetch bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/10/logs/stdio

- 11: unpack bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/11/logs/stdio

- 12: pass .bunsen.source.* ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/12/logs/stdio

- 13: upload to bunsen ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/13/logs/stdio

- 14: clean up ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/14/logs/stdio

- 15: make distclean ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/6/builds/404/steps/15/logs/stdio

A new failure has been detected on builder elfutils-debian-ppc64 while building 
elfutils.

Full details are available at:
https://builder.sourceware.org/buildbot/#/builders/63/builds/479

Build state: failed test (failure)
Revision: 3b71249d4396f742d68e774313c2a2d9caf4d668
Worker: debian-ppc64
Build Reason: (unknown)
Blamelist: Mark Wielaard 

Steps:

- 0: worker_preparation ( success )

- 1: set package name ( success )

- 2: git checkout ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/2/logs/stdio

- 3: autoreconf ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/3/logs/stdio

- 4: configure ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/4/logs/stdio
- config.log: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/4/logs/config_log

- 5: get version ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/5/logs/stdio
- property changes: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/5/logs/property_changes

- 6: make ( warnings )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/6/logs/stdio
- warnings (3): 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/6/logs/warnings__3_

- 7: make check ( failure )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/7/logs/stdio
- test-suite.log: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/7/logs/test-suite_log

- 8: prep ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/8/logs/stdio

- 9: build bunsen.cpio.gz ( success )
Logs:
- stdio: 
https://builder.sourceware.org/buildbot/#/builders/63/builds/479/steps/9/logs/stdio

- 10: fetch bunsen.cpio.gz ( success )