unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Olivier Dion via Guix-patches via <guix-patches@gnu.org>
To: 52499@debbugs.gnu.org
Cc: Olivier Dion <olivier.dion@polymtl.ca>
Subject: [bug#52499] [PATCH] gnu: Fix build error of libpfm4.
Date: Tue, 14 Dec 2021 21:21:41 -0500	[thread overview]
Message-ID: <ecd23fe8f2021d89717fe8b4ced75c680d4ca337.1639534814.git.olivier.dion@polymtl.ca> (raw)

For some reason, the build recently failed with:

        pfmlib_perf_event_pmu.c:349:36: error: ?%s? directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
          349 |   snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name);
              |                                    ^~
        pfmlib_perf_event_pmu.c:349:3: note: ?snprintf? output between 2 and 4352 bytes into a destination of size 4096
          349 |   snprintf(d2path, MAXPATHLEN, "%s/%s", debugfs_mnt, d1->d_name);
              |   ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        pfmlib_perf_event_pmu.c:399:58: error: ?%s? directive output may be truncated writing up to 255 bytes into a region of size between 0 and 4095 [-Werror=format-truncation=]
          399 |                         snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name);
              |                                                          ^~
        pfmlib_perf_event_pmu.c:399:25: note: ?snprintf? output between 5 and 4355 bytes into a destination of size 4096
          399 |                         snprintf(idpath, MAXPATHLEN, "%s/%s/id", d2path, d2->d_name);
              |                         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
        cc1: all warnings being treated as errors

* gnu/packages/linux.scm (libpfm4): Fix build.
(%standard-phases) Add `-Wno-format-truncation` to CFLAGS in build phase.
---
 gnu/packages/linux.scm | 1 +
 1 file changed, 1 insertion(+)

diff --git a/gnu/packages/linux.scm b/gnu/packages/linux.scm
index c752df7996..a1c9408e89 100644
--- a/gnu/packages/linux.scm
+++ b/gnu/packages/linux.scm
@@ -7632,6 +7632,7 @@ (define-public libpfm4
                     (lambda* (#:key inputs outputs #:allow-other-keys)
                       (let* ((out (assoc-ref outputs "out")))
                         (setenv "CC" "gcc")
+                        (setenv "CFLAGS" "-Wno-format-truncation")
                         (invoke "make")
                         #t)))
                   (replace 'install
-- 
2.34.0





             reply	other threads:[~2021-12-15  2:23 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-15  2:21 Olivier Dion via Guix-patches via [this message]
2021-12-15  5:41 ` [bug#52499] [PATCH] gnu: Fix build error of libpfm4 Leo Famulari

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ecd23fe8f2021d89717fe8b4ced75c680d4ca337.1639534814.git.olivier.dion@polymtl.ca \
    --to=guix-patches@gnu.org \
    --cc=52499@debbugs.gnu.org \
    --cc=olivier.dion@polymtl.ca \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).