Florian Weimer 2022-12-17 18:20:55 +01:00
parent 35cb0afc6a
commit 5a0a5922f1
2 changed files with 44 additions and 1 deletions

37
kmod-configure-c99.patch Normal file
View File

@ -0,0 +1,37 @@
configure.ac: In _Noreturn check, include <stdlib.h> for exit
Otherwise, an implicit functiona declaration is used, causing
a C99 compatibility issue.
Submitted upstream:
<https://lore.kernel.org/linux-modules/877cyq6kh9.fsf@oldenburg.str.redhat.com/>
diff --git a/configure b/configure
index d053310a8b4a313a..ec1f12d02428f848 100755
--- a/configure
+++ b/configure
@@ -14021,7 +14021,8 @@ rm -f core conftest.err conftest.$ac_objext conftest.beam conftest.$ac_ext
printf %s "checking whether _Noreturn is supported... " >&6; }
cat confdefs.h - <<_ACEOF >conftest.$ac_ext
/* end confdefs.h. */
-_Noreturn int foo(void) { exit(0); }
+#include <stdlib.h>
+ _Noreturn int foo(void) { exit(0); }
_ACEOF
if ac_fn_c_try_compile "$LINENO"
then :
diff --git a/configure.ac b/configure.ac
index 6989e9360da23721..12e0518533201ccf 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,7 +68,8 @@ AC_COMPILE_IFELSE(
AC_MSG_CHECKING([whether _Noreturn is supported])
AC_COMPILE_IFELSE(
- [AC_LANG_SOURCE([[_Noreturn int foo(void) { exit(0); }]])],
+ [AC_LANG_SOURCE([[#include <stdlib.h>
+ _Noreturn int foo(void) { exit(0); }]])],
[AC_DEFINE([HAVE_NORETURN], [1], [Define if _Noreturn is available])
AC_MSG_RESULT([yes])],
[AC_MSG_RESULT([no])])

View File

@ -16,7 +16,7 @@
Name: kmod
Version: 30
Release: 2%{?dist}
Release: 3%{?dist}
Summary: Linux kernel module management utilities
License: GPLv2+
@ -24,6 +24,7 @@ URL: https://git.kernel.org/pub/scm/utils/kernel/kmod/kmod.git
Source0: https://www.kernel.org/pub/linux/utils/kernel/kmod/%{name}-%{version}.tar.xz
Source1: weak-modules
Source2: depmod.conf.dist
Patch0: kmod-configure-c99.patch
Exclusiveos: Linux
BuildRequires: gcc
@ -69,6 +70,8 @@ applications that wish to load or unload Linux kernel modules.
%prep
%autosetup -p1
# Avoid rebuilding the autoconf scripts.
touch -r aclocal.m4 configure*
%build
%configure \
@ -147,6 +150,9 @@ install -m 0644 %{SOURCE2} $RPM_BUILD_ROOT%{_sysconfdir}/depmod.d/dist.conf
%{_libdir}/libkmod.so
%changelog
* Sat Dec 17 2022 Florian Weimer <fweimer@redhat.com> - 30-3
- Port configure script to C99
* Thu Jul 21 2022 Fedora Release Engineering <releng@fedoraproject.org> - 30-2
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild