2006-01-09

Gentoo Crossdev

Syntax:
$ crossdev --target i586-pc-linux-gnu
1) Target
C3-2 Samuel:   i586-pc-linux-gnu / i586-pc-linux-uclibc
2) Setup categories
$ mkdir -p /etc/portage
$ echo cross-i586-pc-linux-gnu >> /etc/portage/categories
3) Setup PORTDIR_OVERLAY=/usr/local/portage
$ mkdir -p /usr/local/portage/cross-i586-pc-linux-gnu
$ cd /usr/local/portage/cross-i586-pc-linux-gnu
$ ln -s /usr/portage/sys-devel/binutils binutils
$ ln -s /usr/portage/sys-devel/gcc gcc
$ ln -s /usr/portage/sys-kernel/linux-headers linux-headers
$ ln -s /usr/portage/sys-libs/glibc glibc
4) binutils
$ emerge cross-i586-pc-linux-gnu/binutils
5) gcc [C compiler only]
$ USE=nocxx emerge cross-i586-pc-linux-gnu/gcc
$ gcc-config 
6) linux headers
$ emerge cross-i586-pc-linux-gnu/linux-headers
7) glibc
$ USE=x86 emerge cross-i586-pc-linux-gnu/glibc
8) gcc [C and C++ compiler]
$ emerge cross-i586-pc-linux-gnu/gcc
9) Build stuff!
10) install a basic system into a target area
# use a stage-tarball OR
# check your USE variable!
# Many variables are needed for the root: $CTARGET $CHOST $CBUILD
$ ROOT="/tmp/minime" emerge uclibc busybox baselayout-lite dropbear
# When compiling glibc, you might notice that 'prefix' == /usr. This is OK, even if $ROOT points elsewhere
11) install other packages
$ ROOT="/tmp/minime" INSTALL_MASK="*.h" emerge mypackage
12) strip all symbols
You can add the following to your make.conf or export it in your environment.

PORTAGE_STRIP_FLAGS="--strip-unneeded -R .comment"
If your not using java and have no plans of it you can remove the .jcr as well or use this patch.

No comments: