[asterisk-dev] Re: zaptel 1.4.1 gendigits + HOSTCC

Tzafrir Cohen tzafrir.cohen at xorcom.com
Fri Mar 23 04:20:28 MST 2007


On Fri, Mar 23, 2007 at 10:43:46AM +0000, Tony Mountifield wrote:
> In article <2d9149cd0703222341w8ae3a14y80c4a0c38b62f1de at mail.gmail.com>,
> Kristian Kielhofner <kristian.kielhofner at gmail.com> wrote:
> > Hey everyone,
> > 
> >   In the Zaptel Makefile (confirmed in 1.4.1) why isn't gendigits
> > built with HOSTCC instead of CC?
> 
> Hi Kris,
> 
> The use of HOSTCC in Zaptel has historically been very confused. See bug
> number 9207, which I raised in Mantis.
> 
> Until last July, the Zaptel Makefile used HOSTCC to build kernel modules,
> and CC to build user-space utilities. This distinction was quite important
> on earlier Fedora releases based on the 2.4 kernel, because the kernel
> was built with gcc32 and user-space utils were built with gcc (v3.3).
> So on such systems, I always used to build with HOSTCC=gcc32 to ensure
> the Zaptel kernel modules were built with the correct compiler (otherwise
> I would get loads of compiler warnings about __set_64bit_var or something).
> 
> When I recently discovered that the distinction between kernel-space
> and user-space object compilation had disappeared (uses of $(HOSTCC) had
> been changed to $(CC)), I raised the above-mentioned bug, which turned
> out to be a very frustrating experience.
> 
> I originally thought this was a standard usage of HOSTCC, but it turns
> out that the original use of HOSTCC in Zaptel was opposite to conventions
> elsewhere, which probably accounts for the confusion. However, there
> still needs to be a way to distinguish between kernel-space and
> user-space compilation, which there currently is not.
> 
> When the bug report hit a brick wall, I did correspond privately with Kevin
> and Russell, but then it all went quiet without the issue being addressed
> at all. I really can't be bothered to pursue it any more - at least I know
> how to fix it on my own systems as required, even if TPTB want it to remain
> wrong in SVN! When I submit a patch, it's not to pursue an agenda of my own,
> but because I want to improve Asterisk/Zaptel for everyone else!
> 
> Of course, if you are cross-compiling, there are potentially three compilers
> to distinguish between: one for kernel-space modules on the target, one for
> user-space programs for the target, and one for build utilities on the host!

There is evengreater confusion because we try to combine three separate
makefile into one:

1. Userspace utilities (such as ztmonitor and ztcfg).
2. Kernel 2.6 modules. Done by recursively calling the kernel build
system. The kernel build system is supposed to ignore most of the
variables. Hopefully.
3. Kernel 2.4 modules.

(1) and (2) are very easy to do and generally well-tested. (3) is
responsible for much of the mess. More mes and confusion comes from
tryin to combine all three of them in the same makefile.

Helper utilities (gendigits, makefw, etc.) are part of the modules
building.

There is an outstanding bug for Debian that certain automated building 
of the zaptel-source package to zaptel-modules fails. After much messing
I came to the conclusion that the only way forward there is to include
all the generated headers in the zaptel-source zaptel.bz2 tarball, and
avoid any use of the hostcc there. And this is even with the assumption 
of kernel 2.6 alone and no 2.4 .

A proper way to solve this is to separate things:
  
  svn co http://svn.digium.com/team/tzafrir/kernelmove

and let me know if you have any problems.

-- 
               Tzafrir Cohen       
icq#16849755                    jabber:tzafrir at jabber.org
+972-50-7952406           mailto:tzafrir.cohen at xorcom.com       
http://www.xorcom.com  iax:guest at local.xorcom.com/tzafrir


More information about the asterisk-dev mailing list