public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
From: "Sam James" <sam@gentoo.org>
To: gentoo-commits@lists.gentoo.org
Subject: [gentoo-commits] repo/gentoo:master commit in: dev-libs/elfutils/files/, dev-libs/elfutils/
Date: Wed, 29 Jan 2025 22:47:56 +0000 (UTC)	[thread overview]
Message-ID: <1738190846.a4aa03f192a3b51ffce6e540220c3b466d3381ae.sam@gentoo> (raw)

commit:     a4aa03f192a3b51ffce6e540220c3b466d3381ae
Author:     Z. Liu <zhixu.liu <AT> gmail <DOT> com>
AuthorDate: Sun Jan 26 17:57:39 2025 +0000
Commit:     Sam James <sam <AT> gentoo <DOT> org>
CommitDate: Wed Jan 29 22:47:26 2025 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=a4aa03f1

dev-libs/elfutils: fix build failed w/ musl

error() is available in glibc, not in musl, configure check header
file "error.h" only. If sys-libs/error-standalone is installed, check
report ok, but link will fail because no "-lerror". So update configure.ac
to check both error.h exist and can be linked without any extra "-l...",
if not then fallback to err.h which cause built-in error() to be used.

Closes: https://bugs.gentoo.org/948878
Signed-off-by: Z. Liu <zhixu.liu <AT> gmail.com>
Signed-off-by: Alfred Wingate <parona <AT> protonmail.com>
Closes: https://github.com/gentoo/gentoo/pull/40322
Signed-off-by: Sam James <sam <AT> gentoo.org>

 dev-libs/elfutils/elfutils-0.191-r2.ebuild         |  3 +-
 dev-libs/elfutils/elfutils-0.192-r1.ebuild         |  3 +-
 ...0.191-musl-configure-better-error-h-check.patch | 32 ++++++++++++++++++++++
 3 files changed, 36 insertions(+), 2 deletions(-)

diff --git a/dev-libs/elfutils/elfutils-0.191-r2.ebuild b/dev-libs/elfutils/elfutils-0.191-r2.ebuild
index ea40e46c2a43..59c2bad3f81f 100644
--- a/dev-libs/elfutils/elfutils-0.191-r2.ebuild
+++ b/dev-libs/elfutils/elfutils-0.191-r2.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2003-2024 Gentoo Authors
+# Copyright 2003-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -65,6 +65,7 @@ PATCHES=(
 	"${FILESDIR}"/${PN}-0.189-musl-aarch64-regs.patch
 	"${FILESDIR}"/${PN}-0.191-musl-macros.patch
 	"${FILESDIR}"/${PN}-0.191-avoid-overriding-libcxx-system-header.patch
+	"${FILESDIR}"/${PN}-0.191-musl-configure-better-error-h-check.patch
 )
 
 src_prepare() {

diff --git a/dev-libs/elfutils/elfutils-0.192-r1.ebuild b/dev-libs/elfutils/elfutils-0.192-r1.ebuild
index 66caa21ab476..531729129380 100644
--- a/dev-libs/elfutils/elfutils-0.192-r1.ebuild
+++ b/dev-libs/elfutils/elfutils-0.192-r1.ebuild
@@ -1,4 +1,4 @@
-# Copyright 2003-2024 Gentoo Authors
+# Copyright 2003-2025 Gentoo Authors
 # Distributed under the terms of the GNU General Public License v2
 
 EAPI=8
@@ -68,6 +68,7 @@ PATCHES=(
 	"${FILESDIR}"/${P}-libelf-static-link-libeu.patch
 	"${FILESDIR}"/${P}-configure-better-error-message.patch
 	"${FILESDIR}"/${P}-stacktrace-maybe-uninit.patch
+	"${FILESDIR}"/${PN}-0.191-musl-configure-better-error-h-check.patch
 )
 
 src_prepare() {

diff --git a/dev-libs/elfutils/files/elfutils-0.191-musl-configure-better-error-h-check.patch b/dev-libs/elfutils/files/elfutils-0.191-musl-configure-better-error-h-check.patch
new file mode 100644
index 000000000000..bdadcbb25d7e
--- /dev/null
+++ b/dev-libs/elfutils/files/elfutils-0.191-musl-configure-better-error-h-check.patch
@@ -0,0 +1,32 @@
+From 43ddbe073025fe2ff454dabb84674ccdbd013487 Mon Sep 17 00:00:00 2001
+From: Alfred Wingate <parona@protonmail.com>
+Date: Wed, 29 Jan 2025 09:32:49 +0200
+Subject: [PATCH] Declare HAVE_ERROR_H only if error symbol is available
+
+Musl doesn't provide error.h. But there exists a standalone implementation
+that installs /usr/include/error.h but requires explicit linkage. This
+leads linkage errors later on due to the assumption that error
+symbols are provided by the libc.
+
+Bug: https://bugs.gentoo.org/948878
+Signed-off-by: Alfred Wingate <parona@protonmail.com>
+---
+ configure.ac | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/configure.ac b/configure.ac
+index 1da2a12c..7a2f2540 100644
+--- a/configure.ac
++++ b/configure.ac
+@@ -477,7 +477,7 @@ AC_CHECK_FUNCS([process_vm_readv mremap])
+ AS_IF([test "x$ac_cv_func_mremap" = "xno"],
+       [AC_MSG_WARN([elf_update needs mremap to support ELF_C_RDWR_MMAP])])
+ 
+-AC_CHECK_HEADERS([error.h])
++AC_CHECK_HEADER([error.h], [AC_CHECK_FUNC([error], AC_DEFINE([HAVE_ERROR_H], [1], [Define if error.h is usable]))])
+ AC_CHECK_HEADERS([err.h])
+ 
+ dnl for debuginfod concurrency heuristics
+-- 
+2.48.1
+


             reply	other threads:[~2025-01-29 22:47 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-01-29 22:47 Sam James [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-09 16:25 [gentoo-commits] repo/gentoo:master commit in: dev-libs/elfutils/files/, dev-libs/elfutils/ Sam James
2023-08-29  6:36 Sam James
2023-04-23 19:05 Sam James
2023-03-25  1:41 Sam James
2021-02-07 19:10 Sergei Trofimovich
2020-09-08 21:23 Sergei Trofimovich
2020-06-12 21:20 Sergei Trofimovich
2019-08-09 20:52 Andreas K. Hüttel
2019-05-13  8:25 Sergei Trofimovich
2017-08-07 21:55 Sergei Trofimovich

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=1738190846.a4aa03f192a3b51ffce6e540220c3b466d3381ae.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