Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 28 Nov 2007 14:17:43 -0800
From:      Mark Diekhans <markd@kermodei.com>
To:        wb@arb-phys.uni-dortmund.de (W.B. Kloke)
Cc:        freebsd-amd64@freebsd.org
Subject:   Re: How to compile 32bit applications on FreeBSD-amd64?
Message-ID:  <18253.59655.589673.70102@osprey.kermodei.com>
In-Reply-To: <1196266496.551294@vestein.arb-phys.uni-dortmund.de>
References:  <1196266496.551294@vestein.arb-phys.uni-dortmund.de>

next in thread | previous in thread | raw e-mail | index | archive | help

--RbP5SQQdHL
Content-Type: text/plain; charset=us-ascii
Content-Description: message body text
Content-Transfer-Encoding: 7bit

W.B. Kloke <wb@arb-phys.uni-dortmund.de> writes:
> Is there an easy way to build a 32bit application on an amd64 system?

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


--RbP5SQQdHL
Content-Type: text/plain
Content-Disposition: inline;
	filename="start-i386"
Content-Transfer-Encoding: 7bit

#!/bin/sh -e

# start-i386 [cmd ..]
# from http://www.nabble.com/i386-package-building-on-an-amd64-system-t4441068.html

ROOT=/b/jails/i386
REVISION="6.2"
BRANCH="stable"
OSVERSION=602112

UNAME_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@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/bin

cp /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 HOME

if [ $# = 0 ] ; then 
    exec chroot $ROOT /bin/csh
else
    echo "$@" | exec chroot $ROOT /bin/sh
fi

--RbP5SQQdHL--





Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?18253.59655.589673.70102>