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

Long-term mass bug filing for crossbuild support

This is one of the changes sought by Emdebian to support using Debian
on embedded devices where storage space is far from cheap and involves
running counter to the current Debian default of "install everything
that works, every time, every package".


Emdebian has currently built 91 Debian source packages in the
preparation of the basic root filesystem and other testing of the
toolset. All of those have involved some level of patches to support
cross-building with CDBS packages needing the least.

This thread will discuss the type of changes that are needed, which
packages are affected and how these bugs will be identified.

The most common change is simply to retrieve the cross-building
metadata from dpkg-architecture in debian/rules:

DEB_HOST_GNU_TYPE=$(shell dpkg-architecture -qDEB_HOST_GNU_TYPE)
DEB_BUILD_GNU_TYPE=$(shell dpkg-architecture -qDEB_BUILD_GNU_TYPE)

Depending on whether the package uses ./configure:


./configure $(CROSS) ..

or just $(MAKE):


$(MAKE) $(CROSS) ...

Note the use of conditionals to ensure that your Debian build is
completely unaffected by these changes.

I would recommend every maintainer of a compiled package to consider
adding this basic level of cross-building support if it does not exist
already. Some packages retrieve some dpkg-architecture data but not
the foo_GNU_TYPE which can lead to the wrong GNU_TYPE being used.
Some packages retrieve GNU_TYPE and then don't pass that on
to ./configure or $(MAKE).

Note that CDBS is inherently *easier* to crossbuild than any other
build system in Debian. Only one change is necessary:


added to debian/rules. I will investigate a bug report against CDBS for
this change as it would seem that the preset script environment is now
out of sync with the current cross-building requirements.

I know lots of DD's and sponsors don't like CDBS but I liked it before
I started with Emdebian and I like it even more now that I've had to
try and fix all those debhelper/dpkg/dbs packages.

These issues are particularly problematic in the core packages and bugs
will be filed against these packages first. 

Such bugs will be filed as wishlist and use the usertag 'crossbuilt'
for my user:


In due course, it would be good if 'crossbuilt' could be supported as
an ordinary tag instead of as a usertag. (Don?)

These bugs will be filed after manual rebuilds of each affected package
and filing will continue for a *long* time - certainly after Lenny - at
which point the 'crossbuilt' tag could be used by Emdebian users and
developers who discover bugs that appear in packages when crossbuilt as
well as bugs that appear due to regressions after the package
crossbuilds successfully.

It is important to note that the cross-building support in Debian has
been rewritten recently and will continue to evolve and adapt. Packages
that crossbuilt successfully before Etch will likely now fail to
crossbuild and packages that crossbuild successfully before Lenny may
need subsequent patches to cope with other changes elsewhere at any
later time. In particular, #439979 means that 'dpkg-buildpackage -a'
does not work at this time - to test your packages for cross-building,
you will need Debian sid, 'emdebian-tools' and a toolchain installed by
'emsetup'. See http://www.emdebian.org/docs/howto.html

You can see which packages have currently been built using the
emtargetcmp program in 'emdebian-tools'.

(The package search index on emdebian.org is, unfortunately, out of
date as far as versions are concerned.)

Current Emdebian patches are held in Emdebian SVN:

All offers of help gratefully accepted . . . .


Neil Williams

Attachment: pgpKNlibt_1cq.pgp
Description: PGP signature

Reply to: