Package: blktrace
Version: 1.2.0-5
Severity: minor
Tags: patch
User: ubuntu-devel@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,