How to compile 32bit applications on FreeBSD-amd64
With sufficient disk space, its straight forward. I set up a fake root
directory, extract a minimal i386 FreeBSD system into it. The attached
script is used to start a 32bit chroot-ed environment, either to run
a command or start a shell. I have successfully built a large number
of 32-bit ports on a amd64 bit server this way.
Let me know if you have more questions.
Mark
————– next part ————–
#!/bin/sh -e
# start-i386 [cmd ..]
# from http://www.nabble.com/i386-package-building-on-an-amd64-system-t4441068.htmlROOT=/b/jails/i386
REVISION=”6.2″
BRANCH=”stable”
OSVERSION=602112UNAME_s=”FreeBSD”
UNAME_m=”i386″
UNAME_p=”i386″
UNAME_r=$REVISION-$BRANCH
UNAME_v=”$UNAME_s $UNAME_r #6: Sun Sep 23 11:41:48 PDT 2007 root at osprey.kermodei.com:/usr/src/sys/i386/compile/OSPREY”export UNAME_s UNAME_r UNAME_v UNAME_m UNAME_p OSVERSION ROOT
if [ -r $ROOT/dev/zero ]
then
echo dev already mounted
else
mount -t devfs dev $ROOT/dev
fi
ln -sf ld-elf.so.1 $ROOT/libexec/ld-elf32.so.1
echo “libpthread.so.2 libthr.so.2
libpthread.so libthr.so” > ${ROOT}/etc/libmap.conf
cp ${ROOT}/etc/libmap.conf ${ROOT}/etc/libmap32.conf
mkdir -p ${ROOT}/usr/local/bincp /usr/local/bin/bsdmake ${ROOT}/usr/local/bin
cp /etc/make.conf ${ROOT}/etc/
cp /etc/resolv.conf ${ROOT}/etc/
cp /etc/hosts ${ROOT}/etc/HOME=/root
export HOMEif [ $# = 0 ] ; then
exec chroot $ROOT /bin/csh
else
echo “$@” | exec chroot $ROOT /bin/sh
fi
http://lists.freebsd.org/pipermail/freebsd-amd64/2007-November/010466.html
最新评论