Backport upstream patch for C99 compatibility issue

This commit is contained in:
Florian Weimer 2023-11-15 20:32:47 +01:00
parent 27033fb194
commit fadb60f99b
2 changed files with 45 additions and 1 deletions

40
cpio-configure-c99.patch Normal file
View File

@ -0,0 +1,40 @@
commit 8179be21e664cedb2e9d238cc2f6d04965e97275
Author: Sergey Poznyakoff <gray@gnu.org>
Date: Thu May 11 10:18:44 2023 +0300
configure: Include needed header for major/minor macros
This helps in avoiding the warning about implicit function declaration
which is elevated as error with newer compilers e.g. clang 16
Signed-off-by: Khem Raj <raj.khem@gmail.com>
diff --git a/configure.ac b/configure.ac
index de479e7454e5d035..c60102972282b63b 100644
--- a/configure.ac
+++ b/configure.ac
@@ -43,8 +43,22 @@ AC_TYPE_UID_T
AC_CHECK_TYPE(gid_t, int)
AC_HEADER_DIRENT
-AX_COMPILE_CHECK_RETTYPE([major], [0])
-AX_COMPILE_CHECK_RETTYPE([minor], [0])
+AX_COMPILE_CHECK_RETTYPE([major], [0], [
+#include <sys/types.h>
+#ifdef MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif])
+AX_COMPILE_CHECK_RETTYPE([minor], [0], [
+#include <sys/types.h>
+#ifdef MAJOR_IN_MKDEV
+# include <sys/mkdev.h>
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+# include <sys/sysmacros.h>
+#endif])
AC_CHECK_FUNCS([fchmod fchown])
# This is needed for mingw build

View File

@ -1,7 +1,7 @@
Summary: A GNU archiving program
Name: cpio
Version: 2.14
Release: 4%{?dist}
Release: 5%{?dist}
License: GPL-3.0-or-later
URL: https://www.gnu.org/software/cpio/
Source0: https://ftp.gnu.org/gnu/cpio/cpio-%{version}.tar.bz2
@ -45,6 +45,7 @@ Patch8: cpio-2.11-crc-fips-nit.patch
# Upstream patch
# https://www.mail-archive.com/bug-cpio@gnu.org/msg00605.html
Patch11: cpio-2.14-restore-access-and-modification-times-of-symlinks.patch
Patch12: cpio-configure-c99.patch
Provides: bundled(gnulib)
Provides: bundled(paxutils)
@ -109,6 +110,9 @@ make check || {
%{_infodir}/*.info*
%changelog
* Wed Nov 15 2023 Florian Weimer <fweimer@redhat.com> - 2.14-5
- Backport upstream patch for C99 compatibility issue
* Wed Jul 19 2023 Fedora Release Engineering <releng@fedoraproject.org> - 2.14-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_39_Mass_Rebuild