Package: blktrace
Version: 1.2.0-5
Severity: minor
Tags: patch
User: ubuntu-de...@lists.ubuntu.com
Usertags: origin-ubuntu  ubuntu-patch

Dear maintainers,

In Ubuntu, we found that blktrace was failing to rebuild on ppc64el because
the compiler was wrongly identifying problems with format string handling:

[...]
gcc -o blkparse.o -c -D__DEB_CANARY_CPPFLAGS_4e732ced3463d06de0ca9a15b6153677__ 
-Wdate-time -D_FORTIFY_SOURCE=3 -g -O3 -Werror=implicit-function-declaration 
-Werror=array-bounds -Werror=clobbered -Werror=volatile-register-var 
-D__DEB_CANARY_CFLAGS_4e732ced3463d06de0ca9a15b6153677__ 
-fno-omit-frame-pointer -ffile-prefix-map=/<<PKGBUILDDIR>>=. -flto=auto 
-ffat-lto-objects -fstack-protector-strong -Wformat -Werror=format-security 
-fno-stack-clash-protection 
-fdebug-prefix-map=/<<PKGBUILDDIR>>=/usr/src/blktrace-1.2.0-5build1 -Wall 
-Wextra -Wno-shadow -Werror -g -Wl,-Bsymbolic-functions 
-Wl,-z,deb-canary-4e732ced3463d06de0ca9a15b6153677 -flto=auto -ffat-lto-objects 
-Wl,-z,relro -Wl,-z,now -Wl,--as-needed -D_GNU_SOURCE -D_LARGEFILE_SOURCE 
-D_FILE_OFFSET_BITS=64 blkparse.c
blkparse.c: In function ‘main’:
blkparse.c:376:56: error: ‘%s’ directive argument is null 
[-Werror=format-overflow=]
  376 |                 fprintf(stderr, "Out of memory, device %s (%d)\n", 
name, size);
      |                                                        ^~
[...]
blkparse.c:1885:68: error: ‘):’ directive output may be truncated writing 2 
bytes into a region of size between 1 and 41 [-Werror=format-truncation=]
[...]

  (https://launchpad.net/ubuntu/+source/blktrace/1.2.0-5build1/+build/27931723)

It's possible/likely that this build failure is caused by the use of -O3 by
default for ppc64el builds in Ubuntu; so the attached patch, while it fixes
the problem in Ubuntu and should be harmless in Debian, may not be something
you want to apply as-is.  Perhaps you would prefer to use $(filter -O3,...)
instead?

Thanks for considering,
-- 
Steve Langasek                   Give me a lever long enough and a Free OS
Debian Developer                   to set it on, and I can move the world.
Ubuntu Developer                                   https://www.debian.org/
slanga...@ubuntu.com                                     vor...@debian.org
diff -Nru blktrace-1.2.0/debian/control blktrace-1.2.0/debian/control
--- blktrace-1.2.0/debian/control       2024-03-16 02:13:36.000000000 -0700
+++ blktrace-1.2.0/debian/control       2024-03-22 19:17:48.000000000 -0700
@@ -1,8 +1,7 @@
 Source: blktrace
 Section: utils
 Priority: optional
-Maintainer: Ubuntu Developers <ubuntu-devel-disc...@lists.ubuntu.com>
-XSBC-Original-Maintainer: Bas Zoetekouw <b...@debian.org>
+Maintainer: Bas Zoetekouw <b...@debian.org>
 Uploaders: Dmitry Smirnov <only...@debian.org>
 Build-Depends:
     debhelper (>= 11),
diff -Nru blktrace-1.2.0/debian/rules blktrace-1.2.0/debian/rules
--- blktrace-1.2.0/debian/rules 2019-02-23 14:17:21.000000000 -0800
+++ blktrace-1.2.0/debian/rules 2024-03-22 19:17:33.000000000 -0700
@@ -10,6 +10,9 @@
 export DEB_BUILD_MAINT_OPTIONS = hardening=+all future=+all qa=+all 
reproducible=+all
 export DEB_LDFLAGS_MAINT_APPEND = -Wl,--as-needed
 
+ifeq ($(DEB_HOST_ARCH),ppc64el)
+  export DEB_CFLAGS_MAINT_APPEND = -Wno-error=format-overflow 
-Wno-error=format-truncation
+endif
 # make sure TeX/dvipdfm generates reproducable builds
 export FORCE_SOURCE_DATE=1
 

Reply via email to