Package: dpkg-dev
Version: 1.22.6
during native builds, dpkg-buildflags returns an empty CFLAGS_FOR_BUILD. The same happens for CPPFLAGS_FOR_BUILD, LDFLAGS_FOR_BUILD and other *_FOR_BUILD variables.
Given that CFLAGS_FOR_BUILD is supposed to be used instead of CFLAGS (not
_in addition to_ it), dpkg-buildflags should set CFLAGS_FOR_BUILD to CFLAGS, so that the same set of, say, hardening flags will be used.
On 03/06/24 01:24, Guillem Jover wrote:
I guess we could special case the native build one and then copying
them over, although this could incur build failures at this point in
time. :/
Why should this lead to build failures?
Support for _FOR_BUILD in dpkg-dev is new (not yet shipped in a stable release) and opt-in. In addition, there is only a handful of packages that explicitly deal with _FOR_BUILD variables [1], and pretty much of them use a variation of:
export CFLAGS_FOR_BUILD = $(shell dpkg-architecture -f -a$(DEB_BUILD_ARCH) -c dpkg-buildflags --get CFLAGS)
or:
CFLAGS_FOR_BUILD="$(CFLAGS)" dh_auto_configure
[1] https://codesearch.debian.net/search?q=_FOR_BUILD+path%3Adebian%2Frules&literal=1&perpkg=1
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 546 |
Nodes: | 16 (0 / 16) |
Uptime: | 164:03:41 |
Calls: | 10,385 |
Calls today: | 2 |
Files: | 14,057 |
Messages: | 6,416,517 |