[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: Allowing both cross building and using an alternative compiler



Hi!

On Mon, 2015-05-11 at 01:34:08 +0200, Matthias Klose wrote:
> On 05/10/2015 03:32 AM, Guillem Jover wrote:
> > CC_FOR_BUILD = gcc
> 
> the above mentioned wiki pages still talk about HOSTCC and BUILDCC. Please
> clarify when to use these.

I think HOSTCC and BUILDCC should never be used, because they are either
very confused in their meaning alternating depending on the upstream, or
impose unnecessary work when the default CC should always be considered
the compiler for the host system, because that's the common action to do
and it is an implicit make variable, and as such does not require any
modification to the default build rules. Of course there are upstream
projects using these, so initially it might be easier to map them in
debian/rules from our standard variables than to patch their build system.

There are very few instances of BUILDCC around. There are many more for
HOSTCC, but then we find gems like this:

,---
# HOSTCC and HOSTCFLAGS are used to build executables that will be run as
# part of the build process, i.e. on the build machine.  These will usually
# be the same as CC and CFLAGS, except in a cross-compilation environment.
# Note that HOSTCFLAGS should include any -D flags that affect thread support.
HOSTCC=$(CC)
HOSTCFLAGS=$(CFLAGS)
`---

So these are really BUILD tools not HOST tools…


In any case the wiki page only mentions them as some kind of possible
solution to cover cross-builds, I don't see it as any kind of done deal
decision. I'll let the proposers of that goal update the wiki if they
feel like it.

> Are the names now final?

If you mean the names such as CC and CC_FOR_BUILD, that's the autotools
nomenclature for these, I think it makes sense, and I'd like us to
standardize on them. Final, well this thread was a way to canvas
support/objections for all this stuff. :)

> Also I don't see OBJC and OBJCXX in use, and GOC and GDC are missing.

A quick search on <http://codesearch.debian.net/> at the time revealed
many instances of OBJC and OBJCXX, these are also the variables used
by autotools for Objective C/C++ support via AC_PROG_OBJC and
AC_PROG_OBJCXX. Also GNU make has OBJC as an implicit variable.

I didn't add any other compiler variables (such as GOC or GDC) if they
were missing compiler flags support in dpkg-buildflags. If you want to
get support for them, please send the corresponding appropriate default
flags.

Thanks,
Guillem


Reply to: