[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".

http://lists.debian.org/debian-devel/2007/11/msg00116.html

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:
http://wiki.debian.org/EmdebianGuide

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:
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS= --build $(DEB_BUILD_GNU_TYPE) --host $(DEB_HOST_GNU_TYPE)
else
CROSS=
endif

...

./configure $(CROSS) ..

or just $(MAKE):
ifneq ($(DEB_HOST_GNU_TYPE),$(DEB_BUILD_GNU_TYPE))
CROSS=CC=$(DEB_HOST_GNU_TYPE)-gcc
else
CROSS=
endif

...

$(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:

DEB_CONFIGURE_SCRIPT_ENV :=

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.
http://www.linux.codehelp.co.uk/emdebian/man/re03.html

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:

http://bugs.debian.org/cgi-bin/pkgreport.cgi?tag=crossbuilt;users=codehelp@debian.org

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:
http://buildd.emdebian.org/svn/browser/current/target/trunk/

All offers of help gratefully accepted . . . .

-- 


Neil Williams
=============
http://www.data-freedom.org/
http://www.nosoftwarepatents.com/
http://www.linux.codehelp.co.uk/

Attachment: pgp7Oy44XH2Wx.pgp
Description: PGP signature


Reply to: