chrooting in a 32-bit world from a 64-bit kernel+world

Olivier Smedts olivier at
Tue Sep 30 19:14:25 UTC 2008

Hello hackers,

I'm trying to cross-compile an i386 FreeBSD system (kernel+world+ports) under
my amd64 host :
% uname -srm
FreeBSD 8.0-CURRENT amd64

I updated my CURRENT sources yesterday.

So far I've got a working FreeBSD (kernel+world) in a 512MB image I can dump
on a CompactFlash card :
# cd /usr/src
# make buildworld TARGET=i386
# make buildkernel TARGET=i386
# mount /dev/md0a /mnt
(md0 is a 512MB file backed image I bsdlabel'd and newfs'd before)
# make installworld TARGET=i386 DESTDIR=/mnt
# make distribution TARGET=i386 DESTDIR=/mnt
# make installkernel TARGET=i386 DESTDIR=/mnt

The problem is that I can't chroot in this 32-bit world.
Say I want to install the sysutils/screen port in /mnt :

# mkdir /mnt/usr/ports
# mount -t nullfs /usr/ports /mnt/usr/ports
# mount -t devfs devfs /mnt/dev
# chroot /mnt /bin/sh -c "cd /usr/ports/sysutils/screen && make BATCH=yes \
  install clean"
ELF interpreter /libexec/ not found
Abort trap

Of course it's the same with the new (new since a year or so) ports DESTDIR
since it's based on chroot :
# cd /usr/ports/sysutils/screen
# make DESTDIR=/mnt install clean
===>  Creating some important subdirectories
===>  Starting chrooted make in /mnt...
ELF interpreter /libexec/ not found
Abort trap
===>  Chrooted make in /mnt failed
===>  Cleaning up...

I can directly execute /mnt/bin/sh or any program in /mnt without problems.

As expected, file gives me :
/libexec/     ELF 64-bit LSB shared object, x86-64, version 1 (FreeBSD), stripped
/mnt/libexec/ ELF 32-bit LSB shared object, Intel 80386, version 1 (FreeBSD), dynamically linked, stripped

Host kernel with COMPAT_IA32 and world without WITHOUT_LIB32 didn't help.
I tried temporarily replacing /mnt/libexec/ with the 64-bit one,
but the same problem occurs.

Using is not an
option because I don't use default OPTIONS.
Is there a way or another to chroot in this i386 world from my amd64 host ?


Olivier Smedts                                              _
                          ASCII ribbon campaign            ( )
e-mail: olivier at - against HTML email & vCards      X
www: - against proprietary attachments / \

 "Il y a seulement 10 sortes de gens dans le monde :
 ceux qui comprennent le binaire,
 et ceux qui ne le comprennent pas."

More information about the freebsd-questions mailing list