[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 09:29:55 UTC 2013

On 19/06/13 00:57, Jonas Smedegaard wrote:
> Quoting Emilio Pozuelo Monfort (2013-06-18 23:41:47)
>> The hardening instructions in the Debian wiki[1] currently suggest to 
>> include dpkg's buildflags.mk if the maintainer needs to 
>> add/remove/override something, since CDBS doesn't support it (for 
>> packages that don't need to change any *FLAGS, CDBS works perfectly 
>> fine).
> I have now read above 5 times and still not sure what it says.
> Could you please try rephrase, using shorter sentences and avoid 
> paranthesis?
>> I suggest that we make langcore respect those flags so that one can 
>> simply do:
>> DEB_LDFLAGS_MAINT_APPEND = -Wl,-O1 -Wl,--as-needed
>> and CDBS will do the right thing.
> What is "the right thing"?

OK let me rephrase this.

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.

So what I would like is to be able to do:

LDFLAGS += -Wl,-O1 -Wl,--as-needed


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.

Hope that's more clear.


More information about the Build-common-hackers mailing list