Port to C99
Related to: <https://fedoraproject.org/wiki/Changes/PortingToModernC> <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
parent
f69912872d
commit
e4ebf37410
104
xfsprogs-c99.patch
Normal file
104
xfsprogs-c99.patch
Normal file
@ -0,0 +1,104 @@
|
||||
Patch posted upstream: https://marc.info/?l=linux-xfs&m=167584946813673
|
||||
|
||||
From: Arjun Shankar <arjun@redhat.com>
|
||||
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 <arjun@redhat.com>
|
||||
|
||||
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 <linux/fs.h>
|
||||
#include <linux/fiemap.h>
|
||||
+#include <sys/ioctl.h>
|
||||
|
||||
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 <sys/uio.h>
|
||||
|
||||
int
|
||||
@@ -15619,6 +15620,7 @@ $as_echo_n "checking for struct sg_io_hdr ... " >&6; }
|
||||
/* end confdefs.h. */
|
||||
|
||||
#include <scsi/sg.h>
|
||||
+#include <sys/ioctl.h>
|
||||
|
||||
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 <linux/hdreg.h>,
|
||||
+#include <linux/hdreg.h>
|
||||
+#include <sys/ioctl.h>
|
||||
|
||||
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 <linux/fs.h>
|
||||
#include <linux/fiemap.h>
|
||||
+#include <sys/ioctl.h>
|
||||
]], [[
|
||||
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 <sys/uio.h>
|
||||
]], [[
|
||||
pwritev2(0, 0, 0, 0, 0);
|
||||
@@ -454,6 +455,7 @@ AC_DEFUN([AC_HAVE_SG_IO],
|
||||
AC_COMPILE_IFELSE(
|
||||
[ AC_LANG_PROGRAM([[
|
||||
#include <scsi/sg.h>
|
||||
+#include <sys/ioctl.h>
|
||||
]], [[
|
||||
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 <linux/hdreg.h>,
|
||||
+#include <linux/hdreg.h>
|
||||
+#include <sys/ioctl.h>
|
||||
]], [[
|
||||
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 <unicode/ustring.h>
|
||||
#include <unicode/unorm2.h>
|
||||
#include <unicode/uspoof.h>
|
||||
+#include <unicode/uclean.h>
|
||||
#include "libfrog/paths.h"
|
||||
#include "xfs_scrub.h"
|
||||
#include "common.h"
|
||||
@ -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 <arjun@redhat.com> - 6.1.0-3
|
||||
- Port to C99
|
||||
|
||||
* Sat Jan 21 2023 Fedora Release Engineering <releng@fedoraproject.org> - 6.1.0-2
|
||||
- Rebuilt for https://fedoraproject.org/wiki/Fedora_38_Mass_Rebuild
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user