Apply upstream patches to port configure to C99

Related to:

  <https://fedoraproject.org/wiki/Changes/PortingToModernC>
  <https://fedoraproject.org/wiki/Toolchain/PortingToModernC>
This commit is contained in:
Florian Weimer 2022-11-25 11:51:57 +01:00
parent 3a3995cf3c
commit 2681d69152
4 changed files with 1218 additions and 1 deletions

1121
aide-configure-c99-1.patch Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,30 @@
This is no longer relevant upstream as of this commit:
commit ab12f8919f0f7beff0b8db974e98285ede6a285d
Author: Hannes von Haugwitz <hannes@vonhaugwitz.com>
Date: Sun Sep 22 07:26:28 2019 +0200
Use AC_SYS_LARGEFILE for large-file support
- closes #16
- require C99 compatible compiler
- stop using readdir_r in favor of readdir
- remove unused 'size_o member in db_line struct
- '--disable-largefile' now disables LFS
diff --git a/configure.ac b/configure.ac
index cafe16e95ed68c9f..144d55a9146548c0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -574,9 +574,10 @@ AC_CACHE_CHECK([for LFS ino_t],ac_cv_ino_type,[
AC_TRY_RUN([
#include <unistd.h>
#include <stdio.h>
+#include <stdlib.h>
#include <sys/types.h>
#include <sys/stat.h>
-main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
+int main() { struct stat64 st; ino64_t s; if (sizeof(ino_t) == sizeof(ino64_t)) exit(1); exit((lstat64("/dev/null", &st)==0)?0:1); }],
ac_cv_ino_type=ino64_t,ac_cv_ino_type=ino_t,ac_cv_ino_type=cross)])
AIDE_INO_TYPE=$ac_cv_ino_type

View File

@ -0,0 +1,60 @@
Mostly equivalent to this upstream commit:
commit 601113f8a57c8f195af09bb2f14123449fa6bded
Author: Sam James <sam@gentoo.org>
Date: Fri Nov 18 00:04:53 2022 +0000
Fix configure.ac compatibility with Clang 16
Clang 16 makes -Wimplicit-function-declaration and -Wimplicit-int errors by default.
Unfortunately, this can lead to misconfiguration or miscompilation of software as configure
tests may then return the wrong result.
We also fix -Wstrict-prototypes while here as it's easy to do and it prepares
us for C23.
For more information, see LWN.net [0] or LLVM's Discourse [1], the Gentoo wiki [2],
or the (new) c-std-porting mailing list [3].
[0] https://lwn.net/Articles/913505/
[1] https://discourse.llvm.org/t/configure-script-breakage-with-the-new-werror-implicit-function-declaration/65213
[2] https://wiki.gentoo.org/wiki/Modern_C_porting
[3] hosted at lists.linux.dev.
Bug: https://bugs.gentoo.org/881707
Signed-off-by: Sam James <sam@gentoo.org>
diff --git a/configure.ac b/configure.ac
index 144d55a9146548c0..e74911535ddd015f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -279,7 +279,10 @@ AC_CHECK_FUNCS(fcntl ftruncate posix_fadvise asprintf snprintf \
AC_CACHE_CHECK([for open/O_NOATIME], db_cv_open_o_noatime, [
echo "test for working open/O_NOATIME" > __o_noatime_file
AC_TRY_RUN([
+#include <stdlib.h>
#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <fcntl.h>
#ifndef O_NOATIME
#if defined(__linux__) && (defined(__i386__) || defined(__PPC__))
@@ -288,12 +291,15 @@ AC_TRY_RUN([
#define O_NOATIME 0
#endif
#endif
-main() {
+int main() {
int c, fd = open("__o_noatime_file", O_RDONLY | O_NOATIME, 0);
exit ((!O_NOATIME) || (fd == -1) || (read(fd, &c, 1) != 1));
}], [db_cv_open_o_noatime=yes], [db_cv_open_o_noatime=no],
AC_TRY_LINK([
-#include <sys/types.h>
+#include <stdlib.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <unistd.h>
#include <fcntl.h>
#ifndef O_NOATIME
#if defined(__linux__) && (defined(__i386__) || defined(__PPC__))

View File

@ -1,7 +1,7 @@
Summary: Intrusion detection environment Summary: Intrusion detection environment
Name: aide Name: aide
Version: 0.16 Version: 0.16
Release: 20%{?dist} Release: 21%{?dist}
URL: http://sourceforge.net/projects/aide URL: http://sourceforge.net/projects/aide
License: GPLv2+ License: GPLv2+
@ -36,6 +36,9 @@ Patch4: aide-0.15-syslog-format.patch
Patch5: aide-0.16-crypto-disable-haval-and-others.patch Patch5: aide-0.16-crypto-disable-haval-and-others.patch
Patch6: coverity.patch Patch6: coverity.patch
Patch7: aide-0.16-crash-elf.patch Patch7: aide-0.16-crash-elf.patch
Patch8: aide-configure-c99-1.patch
Patch9: aide-configure-c99-2.patch
Patch10: aide-configure-c99-3.patch
%description %description
AIDE (Advanced Intrusion Detection Environment) is a file integrity AIDE (Advanced Intrusion Detection Environment) is a file integrity
@ -80,6 +83,9 @@ mkdir -p -m0700 %{buildroot}%{_localstatedir}/lib/aide
%dir %attr(0700,root,root) %{_localstatedir}/log/aide %dir %attr(0700,root,root) %{_localstatedir}/log/aide
%changelog %changelog
* Fri Nov 25 2022 Florian Weimer <fweimer@redhat.com> - 0.16-21
- Apply upstream patches to port configure to C99
* Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.16-20 * Wed Jul 20 2022 Fedora Release Engineering <releng@fedoraproject.org> - 0.16-20
- Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild - Rebuilt for https://fedoraproject.org/wiki/Fedora_37_Mass_Rebuild