[Build-common-hackers] Bug#712729: Bug#712729: cdbs: langcore.mk: support dpkg-buildflags' DEB_CFLAGS_MAINT_APPEND and similar

Emilio Pozuelo Monfort pochu at debian.org
Wed Jun 19 22:29:14 UTC 2013

On 19/06/13 19:14, Jonas Smedegaard wrote:
> Quoting Emilio Pozuelo Monfort (2013-06-19 11:29:55)
>> Currently if you use CDBS' autotools.mk, gnome.mk, cmake.mk or similar 
>> and you don't mess with CFLAGS, LDFLAGS, CPPFLAGS... then you will get 
>> dpkg-buildflags' default CFLAGS, LDFLAGS... automatically. Which is 
>> great.
>> However many packages need to tweak some flag. For example in GNOME we 
>> have many packages that do
>> LDFLAGS += -Wl,-O1 -Wl,--as-needed
>> This means LDFLAGS now gets set to -Wl,-O1 -Wl,--as-needed and loses 
>> all the flags returned by dpkg-buildflags. That is AFAICS because CDBS 
>> will only set LDFLAGS to what dpkg-buildflags returns if LDFLAGS is 
>> not set.
> Correct. Reason for this is to keep backwards compatibility: Changing 
> this behaviour may break existing packages.
>> So what I would like is to be able to do:
>> LDFLAGS += -Wl,-O1 -Wl,--as-needed
> This may break existing packages.  I would love to simplify both CDBS 
> code and its usage, but that requires either that someone analyze and 
> ensures that no packages in Debian rely on old behaviour (preferrably in 
> stable and oldstable too, to ease backporting CDBS itself).
> I see no other way to improve than that or bumping compatibility level - 
> which is more work.

Yeah I know changing that could break things. So we should probably only
consider that for a possibly future compat 2 (which is unlikely to happen
anytime soon).

>> Or
>> DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,--as-needed
>> and get my package built with LDFLAGS="dpkg build flags plus my other 
>> flags".
>> There are other kind of DEB_LDFLAGS_MAINT_ vars, which are _PREPEND, 
>> _SET and _STRIP. CDBS should honor all of them so if I set one, I will 
>> get the right flags.
> Anyone wanting that logic can simply do this:
>   include /usr/share/dpkg/buildflags.mk
> No need for CDBS to replicate code provided by dpkg IMO.

Perhaps CDBS' buildflags can include that file and let it do its magic. But that
may or may not be possible as it may unconditionally set *FLAGS (I don't
remember and can't check right now). I thought it'd be cool if one wouldn't need
to do extra includes. But I understand it may not be straightforward and not
worth it.

>> Hope that's more clear.
> Yes, was great now - or maybe I simply needed a good nights sleep :-)



More information about the Build-common-hackers mailing list