[PATCH] gnu: libaio: Fix build with newer GCC versions.

  • Done
  • quality assurance status badge
Details
One participant
  • Jonathan Brielmaier
Owner
unassigned
Submitted by
Jonathan Brielmaier
Severity
normal

Debbugs page

Jonathan Brielmaier wrote 4 years ago
(address . guix-patches@gnu.org)(name . Jonathan Brielmaier)(address . jonathan.brielmaier@web.de)
20210602100107.28577-1-jonathan.brielmaier@web.de
* gnu/packages/patches/libaio-fix-build.patch: New file.
* gnu/local.mk (dist_patch_DATA): Register it.
* gnu/packages/linux.scm (libaio): Use the patch.
---
gnu/local.mk | 1 +
gnu/packages/linux.scm | 1 +
gnu/packages/patches/libaio-fix-build.patch | 46 +++++++++++++++++++++
3 files changed, 48 insertions(+)
create mode 100644 gnu/packages/patches/libaio-fix-build.patch

Toggle diff (76 lines)
diff --git a/gnu/local.mk b/gnu/local.mk
index d5a832146e..1e8dab8989 100644
--- a/gnu/local.mk
+++ b/gnu/local.mk
@@ -1251,6 +1251,7 @@ dist_patch_DATA = \
%D%/packages/patches/jfsutils-include-systypes.patch \
%D%/packages/patches/julia-SOURCE_DATE_EPOCH-mtime.patch \
%D%/packages/patches/kdbusaddons-kinit-file-name.patch \
+ %D%/packages/patches/libaio-fix-build.patch \
%D%/packages/patches/libblockdev-glib-compat.patch \
%D%/packages/patches/libffi-3.3-powerpc-fixes.patch \
%D%/packages/patches/libffi-float128-powerpc64le.patch \
diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index cf020a153b..427335c8d5 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -4861,6 +4861,7 @@ Linux Device Mapper multipathing driver:
(uri (list
(string-append "https://releases.pagure.org/libaio/"
name "-" version ".tar.gz")))
+ (patches (search-patches "libaio-fix-build.patch"))
(sha256
(base32
"14mlqdapjqq1dhpkdgy5z83mvsaz36fcxca7a4z6hinmr7r6415b"))))
diff --git a/gnu/packages/patches/libaio-fix-build.patch b/gnu/packages/patches/libaio-fix-build.patch
new file mode 100644
index 0000000000..68b69a5fb2
--- /dev/null
+++ b/gnu/packages/patches/libaio-fix-build.patch
@@ -0,0 +1,46 @@
+From b9e17f6afdc4d0e81b1598aecea7b80d0c54b13a Mon Sep 17 00:00:00 2001
+From: Guillem Jover <guillem@hadrons.org>
+Date: Jul 29 2019 16:26:10 +0000
+Subject: harness: Use destination strncpy() expression for sizeof() argument
+
+
+Even though this is the same size, as the sizeof() is derived from the
+source expression, recent gcc versions will emit a warning, which is
+turned into an error by -Werror:
+
+ error: argument to ‘sizeof’ in ‘strncpy’ call is the same expression
+ as the source; did you mean to use the size of the destination?
+ [-Werror=sizeof-pointer-memaccess]
+
+Signed-off-by: Guillem Jover <guillem@hadrons.org>
+Signed-off-by: Jeff Moyer <jmoyer@redhat.com>
+
+---
+
+diff --git a/harness/cases/19.t b/harness/cases/19.t
+index 4989510..5c3e0d6 100644
+--- a/harness/cases/19.t
++++ b/harness/cases/19.t
+@@ -41,7 +41,7 @@ open_temp_file(void)
+ int fd;
+ char template[sizeof(TEMPLATE)];
+
+- strncpy(template, TEMPLATE, sizeof(TEMPLATE));
++ strncpy(template, TEMPLATE, sizeof(template));
+ fd = mkostemp(template, O_DIRECT);
+ if (fd < 0) {
+ perror("mkstemp");
+diff --git a/harness/cases/21.t b/harness/cases/21.t
+index 441eaa8..fe33a9d 100644
+--- a/harness/cases/21.t
++++ b/harness/cases/21.t
+@@ -43,7 +43,7 @@ open_temp_file()
+ int fd;
+ char temp_file[sizeof(TEMPLATE)];
+
+- strncpy(temp_file, TEMPLATE, sizeof(TEMPLATE));
++ strncpy(temp_file, TEMPLATE, sizeof(temp_file));
+ fd = mkstemp(temp_file);
+ if (fd < 0) {
+ perror("mkstemp");
+
--
2.31.1
Jonathan Brielmaier wrote 4 years ago
(address . 48788@debbugs.gnu.org)
3e89f49c-5e75-4150-5424-9ec6d34aa44a@web.de
This should go to core-updates as libaio is failing there due to a newer
GCC version.
Jonathan Brielmaier wrote 4 years ago
(address . 48788-done@debbugs.gnu.org)
0a20967f-0c7e-8f1b-9bbc-1767b737f832@web.de
Not required anymore. libaio builds fine one core-updates now without
this patch.
Closed
?
Your comment

This issue is archived.

To comment on this conversation send an email to 48788@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 48788
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help