On 07/31/2016 01:40 PM, Mick wrote:
Hi All,

I am dipping my toe into cross-compile territory, in order to build i686
binaries for a 32bit box, which is too old to do its own emerges.

An excellent idea. As one who has performed the upgrade/downgrade surgery on many systems; the single biggest issue is burning up
old hard drives and mobos. Keep the old hardware as cool as possible.
I place them under the vents of a 'window AC' set as cold as possible.
I'm thinking about modifying and old fridge to get around 40 degrees F
and low humidity, with a ethernet hub inside and single hole for the
hub to outside cables, packed off with rubber grommets and silicon caulk. I'm tired of old hardware going dead on me....




I am using
an amd64 box which is significantly faster to do all the heavy lifting and
started applying this page:

https://wiki.gentoo.org/wiki/Embedded_Handbook/General/Creating_a_cross-compiler


Good reference. I would emphasize a few points.

1. Copy off (/var/lib/portage/world file and the /etc/*)
and others to another system.

2. Remove as many packages as possible before the compiling starts, including window managers. I now keep my profile(s), for both servers
and workstations, as simple as possible.

3. At the last stage put the packages back that you need/want to complete your tasks. Less complicated the packages are (KDE stands out) the easier the work and cross-compiling is.

HEAT is your enemy and HEAT's last name is Murphy.....


which I followed up with:

https://wiki.gentoo.org/wiki/Cross_build_environment

and attempted to build @system:
=========================
# i686-pc-linux-gnu-emerge -uva @system

 * IMPORTANT: 3 news items need reading for repository 'gentoo'.
 * Use eselect news read to view new items.


These are the packages that would be merged, in order:

Calculating dependencies... done!
[ebuild  N     ] sys-apps/busybox-1.24.2::gentoo to /usr/i686-pc-linux-gnu/
USE="make-symlinks static -debug -ipv6 -livecd -math -mdev -pam -savedconfig (-
selinux) -sep-usr -syslog -systemd" 0 KiB

Total: 1 package (1 new), Size of downloads: 0 KiB

Would you like to merge these packages? [Yes/No] y
 * ARCH is not set... Are you missing the '/usr/i686-pc-linux-
 * gnu/etc/portage/make.profile' symlink? Is the symlink correct? Is your
 * portage tree complete?
===============

As far as I can tell the link is there:

# ls -la /usr/i686-pc-linux-gnu/etc/portage/
total 8
drwxr-xr-x 1 root root   56 Jul 31 19:32 .
drwxr-xr-x 1 root root   20 Jul 31 18:32 ..
-rw-r--r-- 1 root root 1019 Jul 31 19:32 make.conf
lrwxrwxrwx 1 root root   30 Jul 31 17:48 make.profile ->
/usr/portage/profiles/embedded
drwxr-xr-x 1 root root   32 Jul 31 18:16 profile

and it was created when I ran 'crossdev --stable -v -t i686-pc-linux-gnu'.

My make.conf looks like this:
==============================
# cat /usr/i686-pc-linux-gnu/etc/portage/make.conf
CHOST=i686-pc-linux-gnu
CBUILD=x86_64-pc-linux-gnu
ARCH=x86

HOSTCC=x86_64-pc-linux-gnu-gcc

ROOT=/usr/${CHOST}/

ACCEPT_KEYWORDS="x86"

USE="${ARCH} -pam"

CFLAGS="-march=prescott -O2 -pipe -fomit-frame-pointer"
CXXFLAGS="${CFLAGS}"
MAKEOPTS="-j5"
AUTOCLEAN="yes"
USE="a52 aac aalib acpi apache2 -arts asf avi cdda cddb cdparanoia crypt css
dri dts dv dvd dvdr dvdread divx -eds encode -esd flac fuse gif gimp gmedia -
gnome -gtk hpijs imlib -java lcms -libav live lzo mjpeg mmx mng modplug
mozdevelop mp3 mysql ncurses npp nptlonly nsplugin pdf ppds quicktime real
realmedia rtmp scanner semantic-desktop sse sse2 smp svg theora tiff usb utf8
vcd vhosts vorbis vram v4l webdav wmf wmp xcomposite xine xinerama xulrunner
xv xvid xvmc x264 yv12"
FEATURES="-collision-protect sandbox buildpkg noman noinfo nodoc"
# Be sure we dont overwrite pkgs from another repo..
PKGDIR=${ROOT}packages/
PORTAGE_TMPDIR=/var/tmp

ELIBC="glibc"

PKG_CONFIG_PATH="${ROOT}usr/lib/pkgconfig/"
#PORTDIR_OVERLAY="/usr/portage/local/"
============================


What am I missing?  How would/do you go about achieving the same objective?

The masters of gentoo cross compiling are mostly found on the gentoo-embedded channel, just so you know. Mostly a collection of brilliant pricks and posers, but some kind kind-hearted folks therein too.


Cross compiling on clusters is a very hot area of interest right now, but that is not for the faint-at-heart, atm. I'd stick with the fastest multi-core single system you have access to and avoid distcc atm. ymmv.

hth,

James


Reply via email to