GNU bug report logs - #52499
[PATCH] gnu: Fix build error of libpfm4.

Previous Next

Package: guix-patches;

Reported by: Olivier Dion <olivier.dion <at> polymtl.ca>

Date: Wed, 15 Dec 2021 02:23:02 UTC

Severity: normal

Tags: patch

Done: Leo Famulari <leo <at> famulari.name>

Bug is archived. No further changes may be made.

Full log


View this message in rfc822 format

From: help-debbugs <at> gnu.org (GNU bug Tracking System)
To: Leo Famulari <leo <at> famulari.name>
Cc: tracker <at> debbugs.gnu.org
Subject: bug#52499: closed ([PATCH] gnu: Fix build error of libpfm4.)
Date: Wed, 15 Dec 2021 05:42:02 +0000
[Message part 1 (text/plain, inline)]
Your message dated Wed, 15 Dec 2021 00:41:08 -0500
with message-id <Ybl/9C85XOMTZF9z <at> jasmine.lan>
and subject line Re: [bug#52499] [PATCH] gnu: Fix build error of libpfm4.
has caused the debbugs.gnu.org bug report #52499,
regarding [PATCH] gnu: Fix build error of libpfm4.
to be marked as done.

(If you believe you have received this mail in error, please contact
help-debbugs <at> gnu.org.)


-- 
52499: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=52499
GNU Bug Tracking System
Contact help-debbugs <at> gnu.org with problems
[Message part 2 (message/rfc822, inline)]
From: Olivier Dion <olivier.dion <at> polymtl.ca>
To: guix-patches <at> gnu.org
Cc: Olivier Dion <olivier.dion <at> polymtl.ca>
Subject: [PATCH] gnu: Fix build error of libpfm4.
Date: Tue, 14 Dec 2021 21:21:41 -0500
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



[Message part 3 (message/rfc822, inline)]
From: Leo Famulari <leo <at> famulari.name>
To: Olivier Dion via Guix-patches via <guix-patches <at> gnu.org>
Cc: Olivier Dion <olivier.dion <at> polymtl.ca>, 52499-done <at> debbugs.gnu.org
Subject: Re: [bug#52499] [PATCH] gnu: Fix build error of libpfm4.
Date: Wed, 15 Dec 2021 00:41:08 -0500
On Tue, Dec 14, 2021 at 09:21:41PM -0500, Olivier Dion via Guix-patches via wrote:
> 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.

Thanks! Pushed as c7795eccaf432beec7366fa901b4bb6fc24cfead


This bug report was last modified 3 years and 252 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.