]> git.ipfire.org Git - thirdparty/elfutils.git/commitdiff
Declare HAVE_ERROR_H only if error symbol is available
authorAlfred Wingate <parona@protonmail.com>
Wed, 29 Jan 2025 07:32:49 +0000 (09:32 +0200)
committerMark Wielaard <mark@klomp.org>
Wed, 29 Jan 2025 12:32:06 +0000 (13:32 +0100)
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
Bug: https://sourceware.org/bugzilla/show_bug.cgi?id=32548
Signed-off-by: Alfred Wingate <parona@protonmail.com>
configure.ac

index 1da2a12c0a00504dc34a4f92ea193002b13aac0d..e57d39275591f1ef5f6aea9ec8d0d0f6434e1853 100644 (file)
@@ -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