Re: Creating debs using a cross-build envronment?

Wookey <[email protected]>
Newsgroups gmane.linux.debian.devel.embedded
Organization Wookware
Message-ID <[email protected]>
+++ Neil Williams [2012-02-23 13:42 +0000]:
> On Thu, 23 Feb 2012 14:16:42 +0100
> Svante Signell <[email protected]> wrote:
> 
> > On Thu, 2012-02-23 at 13:03 +0000, Neil Williams wrote:
> > > You don't need cross-build tools for that. Your doing a native build,
> > > so just use the normal Debian packaging tools (dpkg-buildpackage) and
> > > build for hurd-i386.
> > 
> > I'm doing that natively for most packages already. Some packages are
> > problematic though, so maybe a cross-build can be of use.
> 
> How? When a package will not build natively, it won't cross build
> either.

I don't think that's necessarily true - it depends on the details
(implementation language, significance of architecture differences in
tool ouput).

> > > > b) And to enable support for gnat in GNU/Hurd, either as a deb or
> > > > binaries created by the cross-build environment and copied to the target
> > > > for native .deb builds there.
> > > 
> > > Forget about linux-i386/hurd-i386 cross-building and just change the
> > > package in such a way that it can build a minimal .deb which provides
> > > enough functionality without the complicating dependencies, such that
> > > you can then build the next stage. Cross-building is not the answer
> > > here and even if you are convinced it is, Emdebian cannot provide the
> > > toolchains to do it.
> > 
> > I think cross-building is the _only_ answer here since gnat needs gnat,
> > see my previous mail.
> 
> No, we've been here before in Emdebian. When foo needs foo, foo needs
> to be modified to build mini-foo which doesn't need extra stuff, and
> provides just enough functionality to allow mini-foo to be installed
> (natively) and then support the building of another foo before you maybe
> go on and build the full foo.

THis only works if mini-foo is in a language you already have a
compiler for. So it works for perl, which has a core written in C. It
doesn't work for mono, which has its core written in mono, for
example.

> perl does this, compilers do this. The issue with cross-building is
> that you cannot run the binaries compiled as cross binaries on the
> system which is doing the build. So the best solution here is to build
> natively, building only a small subset of the functionality.

You can't build a language natively if you haven't yet bootstrapped
that language on the target architecture. Sometimes
cross-bootstrapping is the only way to get started. (if the version of
tha language built on another architecure (the BUILD arch) is
sufficiently compatible to be used to compile/intepret the language on
the HOST arch. Usually it is because there has to be _some_ way of
bootstrapping the language.

Several languages have this property: haskell, mono, and I think java
too.

I know nothing about ada, which is the question here. But so far as I
can tell it doesn't have a core C implmentation so you have to have an
ada compiler in order to build it. A cross-gnat compiler seems like
the only general way to get such a thing,  (on x86 linux->hurd it may
be possible to bodge something with the existing i386-linux-gnu ada
compiler, assuming there is some mechanism for running linux binaries
on the hurd?)

> Identifying the subset is the hard part.
> 
> Even if you do a cross-build, you're still going to need to build this
> mini-foo subset natively in order to execute it during the cross-build
> of the rest of the package.

No. other way round. You may have to cross-build mini-foo in order to
be able to natively build either foo or more probably mini-foo
natively. 

Wookey
-- 
Principal hats:  Linaro, Emdebian, Wookware, Balloonboard, ARM
http://wookware.org/
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.