[Build-common-hackers] Bug#841761: Bug#841761: cdbs: improve cross compilation with makefile and cmake classes

Helmut Grohne helmut at subdivi.de
Sat Oct 14 11:23:45 UTC 2017


Hi Jonas,

On Tue, Jun 27, 2017 at 05:08:58PM +0200, Jonas Smedegaard wrote:
> > The cmake class defaults to passing $(CC) as CMAKE_C_COMPILER. 
> > Unfortunately, CC defaults to cc and cdbs does nothing to fix that. I 
> > propose that 1/class/langcore.mk changes CC and CXX such that if they 
> > are still at their default values, it will go and substitute 
> > triplet-prefixed versions. Note that for doing so, it should in 
> > principle include 1/rules/buildvars.mk which sets up DEB_HOST_GNU_TYPE 
> > (not done in patch). I wasn't sure whether that is ok, and didn't add 
> > it in my patch. If it is, add the include and drop the "ifneq 
> > ($(DEB_HOST_GNU_TYPE),)".
> 
> I added what I believe is in same spirit but less intrusive: Set to 
> host-specific binaries only when cross-compiling, else use the 
> Debian-default gcc/g++ names.
> 
> Also, adapted to late expansion and use ?= (not :=) (see above).

Unfortunately, this doesn't work. CC and CXX do have defaults. Thus a ?=
assignment is a noop.

> I wonder if then also safe to include /usr/share/dpkg/buildflags.mk in 
> langcore.mk - I would appreciate your sharp eyes on that, as my messing 
> with that has caused problems in the past.

I cannot assess safety by looking at it. If you want to know, I
recommend doing an archive rebuild (of 3000 source packages) with that
change.

> Changes pushed to git.debian.org:/git/build-common/cdbs but not yet 
> released, in case you might want to have a look and comment first.

These have reached unstable at the time of this writing, but due to the
?= assignment above, don't help at all. Thus it seemed to me as if
nothing had been applied while most hunks went in.

So from a practical pov, this bug is pretty much unsolved (even though
most of the work is done). Can you fix the CC and CXX assignments and
when doing so just close this bug?

Thus I'll notice when to retest affected packages and can reopen if
necessary of file followup bug reports for other aspects. (This time not
conflating a huge pile into one bug.)

Thanks for bearing with me.

Helmut



More information about the Build-common-hackers mailing list