emdebian logo
 

About Emdebian
 Emdebian & Debian
 Purpose
 Customisations
 Tdeb support

Cross toolchains
 Toolchain packages
 Toolchain Status

Packages
 Root Filesystem
 Build Tools
 Target packages
 Repository Key  Crossbuild bugs

Documentation
 Introductory Guide
 Emdebian Wiki
 Emdebian FAQ
 Packaging rules
 Packaging infrastructure
 Packaging guideline
 DebConf paper

Support
 Contact Us
 Mailing List Archives

Help Emdebian
 Developers' Info
 Subversion
 ToDo list

News

History
 Slind
 Stag
 Emdebsys

Links
 Emdebian Bootldr
 Emdebian Kernel
 Emdebian JTAG
 Scratchbox
 QEmu
 CELF

Valid HTML 4.01!

 
   

[ Toolchains ] [ Root filesystem ] [ Mixing Emdebian and Debian ]


Emdebian Howto (continued)

Cross-building Debian packages

Building your own packages

emdebuild - building the Emdebian way

Omit this section if you just want to use Emdebian packages for ARM. To use Emdebian for other architectures or with uClibc, you will need to build your own packages using the existing patches and emsource. To extend Emdebian to other package sets, including Qt, you will need to build new packages from scratch - including fixing all the crossbuilding bugs that are likely in the packages in Debian.

Cross-building Debian packages can be a complicated process and can require a detailed knowledge of a variety of Debian packaging methods and tools. Fixing cross-builds can absorb significant amounts of time. If you want to use the Emdebian binaries for your chosen architecture to prepare a rootfs, you can skip this section.

Getting the source

Emdebian uses Debian packages as the original source rather than going to the actual upstream. This provides some insurance and assistance because the package is known to compile natively on the host architecture and build logs for that version are available from the debian website. The Debian packaging methods and tools are increasingly supportive of cross-building and provide a flexible platform for implementing general fixes. Emdebian supports two methods of building packages:

  • $ apt-get source
  • $ emsource

emsource uses subversion to retrieve any existing Emdebian patches and also runs the em_make and emlocale scripts from emdebian-tools to prepare a package suitable for Emdebian. Most Debian packages will not currently cross-build without such patches so emsource is strongly recommended.

Checking for common problems

As Emdebian develops, a set of common problems is appearing. In general, these can be fixed within Debian without affecting native builds and work is ongoing to implement these solutions. In the meantime, emdebian-tools implements fixes for some common issues (removal of manpages and documentation etc.) and the Emdebian wiki contains other hints for common package problems. In time, bugs filed in Debian should improve the situation.

e.g. The patches used by Emdebian are not suitable for direct implementation in Debian because the patch will remove commands like dh_installman in order to remove the manpages. Changes in dpkg to support filtering packages during the build will allow Emdebian to retain the Debian commands but simply filter out their effects.

emdebuild - building the Emdebian way

emdebuild is a wrapper around dpkg-buildpackage -a that handles the Emdebian patch sets, locally and in SVN.

using apt-cross for cross dependencies

apt-cross can download, build and install foreign versions of shared libraries and development packages to support cross-building by making the necessary host architecture library binaries available to the cross-compiler. If the build fails during ./configure or later with a "Missing file" error, use dpkg -S foo.h to identify the package and apt-cross -a $ARCH -v -i libfoo-dev to install the library binary for the host architecture on the build machine. There is outline support for a debian/xcontrol file that can be used to specify these packages as Build-Cross-Depends.

Supporting CC_FOR_BUILD

Some packages use 'gcc' to compile and run internal tools during the package build to ease the Debian build process. When cross-building, it is common for these tools to successfully compile using the cross-compiler but then fail to execute on the build machine. Errors from internal tools commonly end with "unable to execute file foo". emdebian-tools and supporting Debian packages are implementing fixes for these problems and if the package fails to build, check for CC_FOR_BUILD support in the upstream Makefile. Adding support for CC_FOR_BUILD in ./configure and specifying CC=@CC_FOR_BUILD@ in the Makefile rule that builds the tool (or the directory containing the tool if no other source files are compiled in that directory) will allow the cross-build to compile just that tool with 'gcc' while compiling the rest of the package with, e.g. 'arm-linux-gnu-gcc'.

Once built, emdebuild shows details of the packages built. If you have Emdebian SVN commit access, you can update the Emdebian SVN patches for that package.


[ Installing toolchains ] [ Root filesystem ]


See the emdebian contact page for information on contacting us.

Last Modified: Mon, Mar 10 02:00:17 UTC 2008
Copyright © 2000-2008 The Embedded Debian Project;
Emdebian is an offical subproject of Debian.