Cross-compiling SableVM on a Gentoo System ------------------------------------------ This document describes how to cross-compile SableVM on a Gentoo system. General Notes ------------- Note: In the current portage version, stripping does not work for cross-compiled binaries as the native strip program is used. This will be fixed in the next portage version and there is a patch also available. Use FEATURES=nostrip is the simple solution. 0. Install a Gentoo system. 1. Install a cross-compiler toolchain See: http://dev.gentoo.org/~vapier/CROSS-COMPILE-HOWTO See: http://www.sable.mcgill.ca/~dbelan2/crossdev/crossdev-powerpc-i686.html Note I have to do these two modifications to build a cross-compiler toolchain on my systems: a) Build the kernel headers before gcc. Change "make prepare ..." for "make include/linux/version.h" in the headers ebuild. b) Add "--with-sysroot=/" to the gcc configure options in toolchain.eclass. 2. Cross-compile popt ROOT=/usr/local/cross-root \ USE=-nls CHOST=powerpc-unknown-linux-gnu \ CFLAGS="-O2 -g" \ emerge -av --nodeps popt 3. Cross-compile libffi ROOT=/usr/local/cross-root \ USE=-nls \ CHOST=powerpc-unknown-linux-gnu \ CFLAGS="-O2 -g" \ emerge -av --nodeps libffi 4. Cross-compile libtool (for libltdl) ROOT=/usr/local/cross-root \ USE=-nls \ CHOST=powerpc-unknown-linux-gnu \ CFLAGS="-O2 -g" \ emerge -av --nodeps libtool 5. Cross-compile zlib Apply this patch to the zlib ebuild: --- /usr/portage/sys-libs/zlib/zlib-1.2.2.ebuild 2004-12-06 01:39:29.000000000 -0500 +++ /usr/local/portage/sys-libs/zlib/zlib-1.2.2.ebuild 2004-12-16 23:29:41.000000000 -0500 @@ -68,5 +68,5 @@ dosym libz.so.${PV} /$(get_libdir)/libz.so dosym libz.so.${PV} /$(get_libdir)/libz.so.1 # with an extra symlink at /usr/lib - dosym /$(get_libdir)/libz.so.${PV} /usr/$(get_libdir)/libz.so + dosym ${ROOT}$(get_libdir)/libz.so.${PV} /usr/$(get_libdir)/libz.so } ROOT=/usr/local/cross-root \ USE=-nls \ CHOST=powerpc-unknown-linux-gnu \ CFLAGS="-O2 -g" \ emerge -av --nodeps zlib 6. (Optionnally) Cross-compile all required libs for gtk. 7. Cross-compile SableVM Support in ebuild >=dev-java/sablevm-svn-20041216-r1. Available here: http://www.sable.mcgill.ca/~dbelan2/ebuilds/dev-java/sablevm-svn/ ROOT=/usr/local/cross-root \ CHOST=i686-pc-linux-gnu \ CFLAGS="-O2" \ LDFLAGS="-L/usr/local/cross-root/lib \ -L/usr/local/cross-root/usr/lib \ -L/usr/local/cross-root/usr/lib/libffi" \ CPPFLAGS="-I/usr/local/cross-root/usr/include \ -I/usr/local/cross-root/usr/include/libffi" \ emerge -av --nodeps sablevm-svn