From e4ebf37410a453ebc4e09b4e0a5f881202c3aa9d Mon Sep 17 00:00:00 2001 From: Arjun Shankar Date: Wed, 8 Feb 2023 11:16:33 +0100 Subject: [PATCH] Port to C99 Related to: --- xfsprogs-c99.patch | 104 +++++++++++++++++++++++++++++++++++++++++++++ xfsprogs.spec | 8 +++- 2 files changed, 110 insertions(+), 2 deletions(-) create mode 100644 xfsprogs-c99.patch diff --git a/xfsprogs-c99.patch b/xfsprogs-c99.patch new file mode 100644 index 0000000..8293254 --- /dev/null +++ b/xfsprogs-c99.patch @@ -0,0 +1,104 @@ +Patch posted upstream: https://marc.info/?l=linux-xfs&m=167584946813673 + +From: Arjun Shankar +Date: Wed, 8 Feb 2023 10:35:05 +0100 +Subject: [PATCH] Remove several implicit function declarations + +During configure, several ioctl checks omit the correspondig include +and a pwritev2 check uses the wrong feature test macro. Also, +scrub/unicrash.c omits the appropriate include for u_init/u_cleanup. +All of the above lead to implicit function declarations at build time. +This commit fixes the same. + +Signed-off-by: Arjun Shankar + +diff --git a/configure b/configure +index cee6a7f8f844cbb7..0de77850b9cff273 100755 +--- a/configure ++++ b/configure +@@ -14839,6 +14839,7 @@ $as_echo_n "checking for fiemap... " >&6; } + #define _GNU_SOURCE + #include + #include ++#include + + int + main () +@@ -14869,7 +14870,7 @@ $as_echo_n "checking for pwritev2... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +-#define _BSD_SOURCE ++#define _GNU_SOURCE + #include + + int +@@ -15619,6 +15620,7 @@ $as_echo_n "checking for struct sg_io_hdr ... " >&6; } + /* end confdefs.h. */ + + #include ++#include + + int + main () +@@ -15648,7 +15650,8 @@ $as_echo_n "checking for struct hd_geometry ... " >&6; } + cat confdefs.h - <<_ACEOF >conftest.$ac_ext + /* end confdefs.h. */ + +-#include , ++#include ++#include + + int + main () +diff --git a/m4/package_libcdev.m4 b/m4/package_libcdev.m4 +index bb1ab49c11e49cd0..f987aa4ab7b5b8de 100644 +--- a/m4/package_libcdev.m4 ++++ b/m4/package_libcdev.m4 +@@ -117,6 +117,7 @@ AC_DEFUN([AC_HAVE_FIEMAP], + #define _GNU_SOURCE + #include + #include ++#include + ]], [[ + struct fiemap *fiemap; + ioctl(0, FS_IOC_FIEMAP, (unsigned long)fiemap); +@@ -153,7 +154,7 @@ AC_DEFUN([AC_HAVE_PWRITEV2], + [ AC_MSG_CHECKING([for pwritev2]) + AC_LINK_IFELSE( + [ AC_LANG_PROGRAM([[ +-#define _BSD_SOURCE ++#define _GNU_SOURCE + #include + ]], [[ + pwritev2(0, 0, 0, 0, 0); +@@ -454,6 +455,7 @@ AC_DEFUN([AC_HAVE_SG_IO], + AC_COMPILE_IFELSE( + [ AC_LANG_PROGRAM([[ + #include ++#include + ]], [[ + struct sg_io_hdr hdr; + ioctl(0, SG_IO, &hdr); +@@ -471,7 +473,8 @@ AC_DEFUN([AC_HAVE_HDIO_GETGEO], + [ AC_MSG_CHECKING([for struct hd_geometry ]) + AC_COMPILE_IFELSE( + [ AC_LANG_PROGRAM([[ +-#include , ++#include ++#include + ]], [[ + struct hd_geometry hdr; + ioctl(0, HDIO_GETGEO, &hdr); +diff --git a/scrub/unicrash.c b/scrub/unicrash.c +index cb0880c1040a73ae..3be0718afa883a19 100644 +--- a/scrub/unicrash.c ++++ b/scrub/unicrash.c +@@ -13,6 +13,7 @@ + #include + #include + #include ++#include + #include "libfrog/paths.h" + #include "xfs_scrub.h" + #include "common.h" diff --git a/xfsprogs.spec b/xfsprogs.spec index f478a41..40450c8 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,12 +1,13 @@ Summary: Utilities for managing the XFS filesystem Name: xfsprogs Version: 6.1.0 -Release: 2%{?dist} +Release: 3%{?dist} License: GPL+ and LGPLv2+ URL: https://xfs.wiki.kernel.org Source0: http://kernel.org/pub/linux/utils/fs/xfs/xfsprogs/%{name}-%{version}.tar.xz Source1: http://kernel.org/pub/linux/utils/fs/xfs/xfsprogs/%{name}-%{version}.tar.sign Source2: https://git.kernel.org/pub/scm/docs/kernel/pgpkeys.git/plain/keys/13F703E6C11CF6F0.asc +Patch0: xfsprogs-c99.patch BuildRequires: make BuildRequires: gcc BuildRequires: libtool, gettext, libattr-devel, libuuid-devel @@ -57,7 +58,7 @@ interface could change at any time! %prep xzcat '%{SOURCE0}' | %{gpgverify} --keyring='%{SOURCE2}' --signature='%{SOURCE1}' --data=- -%setup -q +%autosetup -p1 %build export tagname=CC @@ -125,6 +126,9 @@ rm -rf $RPM_BUILD_ROOT/%{_datadir}/doc/xfsprogs/ %{_libdir}/*.so %changelog +* Wed Feb 08 2023 Arjun Shankar - 6.1.0-3 +- Port to C99 + * Sat Jan 21 2023 Fedora Release Engineering - 6.1.0-2 - Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild