Gentoo NDK

From WebOS Internals
(Redirected from Building a cross toolchain)
Jump to: navigation, search

Install the latest version (sys-devel/crossdev-99999999) of crossdev:

echo 'sys-devel/crossdev **' >> /etc/portage/package.keywords
emerge crossdev

Setup some overlays for crossdev to write to and add PuffTheMagic's special overlay of custom ebuilds:

mkdir /usr/local/portage
git clone git:// /usr/local/puff
echo 'PORTDIR_OVERLAY="/usr/local/portage /usr/local/puff ${PORTDIR_OVERLAY}"' >> /etc/make.conf

Building your toolchain (works for apps and kernels):

It's reported that you should NOT use GNU make newer than version 3.81 to compile the toolchain by User:Divilis[1]. Reference[2]

If you are using the GNU make 3.82, you should temporarily downgrade it with this command:

emerge -av =sys-devel/make-3.81

If you are already using GNU make 3.81, just continuous:

crossdev -t arm-none-linux-gnueabi --libc 2.6.1 --gcc 4.3.3-r2 --binutils 2.19.1-r1 --kernel 2.6.23-r3

Once the toolchain is built run the following command:

emerge-wrapper --init

This will setup '/usr/arm-none-linux-gnueabi' as your staging directory.

Mask some packages so that you compile against the proper versions:

echo '>=sys-libs/zlib-1.2.4' >> /usr/arm-none-linux-gnueabi/etc/portage/package.mask