Package: libdime-dev
Severity: normal
Hi,
dime.pc ships the full build-time CFLAGS in its Cflags: line, including
-D_FORTIFY_SOURCE=2 (and -g -O2 -fstack-protector-strong -Wformat
-Werror=format-security -Wdate-time -ffile-prefix-map=...):
Cflags: -I${includedir} -g -O2
-ffile-prefix-map=/build/dime-fqJZ8y/dime-0.20111205=. -fstack-protector-strong
-Wformat -Werror=format-security -I${prefix}/include -Wdate-time
-D_FORTIFY_SOURCE=2
lintian flags this as an error:
E: libdime-dev: pkg-config-bad-directive -D_FORTIFY_SOURCE=2
[usr/lib/x86_64-linux-gnu/pkgconfig/dime.pc]
-D_FORTIFY_SOURCE=2 without a matching -O in the *consumer's* own build
can produce a compiler warning/no-op, and if the consumer already
defines _FORTIFY_SOURCE itself (as dpkg-buildflags-based builds
normally do), the duplicate definition causes a "warning: redefining
_FORTIFY_SOURCE" or, with -Werror, an FTBFS. More generally, a .pc
file should not re-inject the library's own build hardening/debug
flags into every reverse dependency's compile line; consumers get
their hardening from their own dpkg-buildflags invocation via
dpkg-dev's default build flags. Cflags: in a .pc file should be
limited to what is actually needed to use the library (essentially
-I${includedir} and any required feature-test macros), not a copy of
the CFLAGS used to build libdime itself.
The .pc file also still contains unexpanded autoconf placeholders:
compiler_is_gcc=@ac_compiler_gnu@
frameworkdir=@frameworkdir@
which indicates dime.pc.in is a stale/unmaintained template that was
never fully adapted for this build.
Please strip the build CFLAGS (and any other build-only flags) from
the Cflags: line in dime.pc.in, keeping only -I${includedir}, and fix
or remove the unexpanded @ac_compiler_gnu@ / @frameworkdir@ lines.
Kind regards
Andreas.
PS: I'd volunteer to work on this problem if you agree with collaborative
maintenance at https://salsa.debian.org/debian and I also volunteer
to create this repository there.
-- System Information:
Debian Release: forky/sid
APT prefers testing
APT policy: (501, 'testing'), (50, 'buildd-unstable'), (50, 'unstable'), (5,
'experimental')
Architecture: amd64 (x86_64)
Kernel: Linux 7.0.13+deb14-amd64 (SMP w/8 CPU threads; PREEMPT)
Kernel taint flags: TAINT_WARN
Locale: LANG=de_DE.UTF-8, LC_CTYPE=de_DE.UTF-8 (charmap=UTF-8), LANGUAGE not set
Shell: /bin/sh linked to /usr/bin/dash
Init: systemd (via /run/systemd/system)
LSM: AppArmor: enabled
Versions of packages libdime-dev depends on:
pn libdime1 <none>
libdime-dev recommends no packages.
libdime-dev suggests no packages.