Search:  
Gentoo Wiki

OpenPandora/Install_Crossdev

Contents

Introduction

Useful Tolls

Note: The following are additional useful tools recommended by the Embedded Gentoo Handbook
emerge -av sys-devel/crossdev
emerge sys-devel/binutils-config
emerge sys-devel/gcc-config
emerge app-portage/gentoolkit

HOST make.conf

Edit your host platform's /etc/make.conf

Note: I'm assuming that you are using a i686 platform, change as appropriate for your HOST platform
File: /etc/make.conf
CBUILD="i686-pc-linux-gnu"
CTARGET="arm-unknown-linux-gnueabi"
ROOT="${SYSROOT}"
PORTAGE_CONFIGROOT="${ROOT}"
PORTDIR_OVERLAY="${ROOT}/usr"

Establish a crossdev environment

Working Crossdev Toolchains

arm-unknown-linux-gnueabi arm-unknown-linux-uclibc arm-unknown-linux-uclibceabi
linux-headers-2.6.26 unknown unknown
gcc-4.2.4 unknown unknown
glibc-2.7-r2 unknown unknown
binutils-2.18-r3 unknown unknown

Crossdev Build

crossdev --target arm-unkown-linux-gnueabi -P -v

Establish portage profile links

ln -s /etc/make.globals $SYSROOT/etc/make.globals
ln -s /usr/portage/profiles/default-linux/arm $SYSROOT/etc/make.profile

Useful scripts & settings

xmerge


Create the following file in your favorite text editor and copy the following.

File: /usr/bin/xmerge
#!/bin/sh
export CBUILD=$(portageq envvar CHOST)
export PORTAGE_CONFIGROOT=${SYSROOT}
if [ "$1" = "--root" ] ; then
	export ROOT=$2
	shift 2
else
	export ROOT=${SYSROOT}
fi
exec emerge "$@"
chmod u+x /usr/bin/xmerge

cross-pkg-config


Create another file and copy the following.

File: /usr/bin/cross-pkg-config
#!/bin/sh
CTARGET=${0%-pkg-config}
SYSROOT="/usr/${CTARGET}"
export PKG_CONFIG_LIBDIR="${SYSROOT}/usr/lib/pkgconfig"
unset PKG_CONFIG_PATH PKG_CONFIG_ALLOW_SYSTEM_CFLAGS PKG_CONFIG_ALLOW_SYSTEM_LIBS
exec pkg-config "$@"
chmod u+x /usr/bin/cross-pkg-config

Force autoconf tests

export ac_cv_func_calloc_0_nonnull=yes
export ac_cv_func_malloc_0_nonnull=yes
export gl_cv_func_malloc_0_nonnull=yes
export ac_cv_func_realloc_0_nonnull=yes
export ac_cv_func_memcmp_working=yes
export ac_cv_func_strnlen_working=yes
Retrieved from "http://www.gentoo-wiki.info/OpenPandora/Install_Crossdev"

Last modified: Sat, 11 Oct 2008 02:54:00 +0000 Hits: 24