amd64/119771: troubles w/ -m32 executables on both amd64 and i386

Scot Hetzel swhetzel at gmail.com
Sat Jan 19 12:20:03 PST 2008


The following reply was made to PR amd64/119771; it has been noted by GNATS.

From: "Scot Hetzel" <swhetzel at gmail.com>
To: A.Yu.Isupov <isupov at moonhe.jinr.ru>
Cc: bug-followup at freebsd.org
Subject: Re: amd64/119771: troubles w/ -m32 executables on both amd64 and i386
Date: Sat, 19 Jan 2008 14:18:43 -0600

 On 1/19/08, A.Yu.Isupov <isupov at moonhe.jinr.ru> wrote:
 > *From:* "Scot Hetzel" <swhetzel at gmail.com>
 > *Date:* Fri, 18 Jan 2008 10:07:26 -0600
 >
 > >Currently, building i386 programs under FreeBSD/amd64 is not
 > >supported. The reason for this is you need the i386 includes to build
 > >your program, but they are not installed during a installworld (see
 > >stage 5.1 in src/Makefile.inc1).
 >
 >   I assume, that all needed includes are the same under amd64 and i386...
 > Problems are not connected with sizeof(int) or prototyping.
 
 The includes are not the same between amd64 and i386.
 
 sys/types.h pulls in machine/endian.h and machine/_types.h.  These two
 includes are different.
 
 That is why you would need to build the includes for i386 under amd64.
  An example of building the includes is in stage 5.1 of buildworld.
 
 >   Unfortunately, I can't port my program (that is cernlib) to 64-bit
 > (I try !), because one intensively uses int (and integer*4 :) to store
 > pointers, so I need to compile it in 32-bit environment - if possible,
 > on FreeBSD/amd64, if not - I should choose to continue using the
 > FreeBSD/i386 on 64-bit CPU :(
 
 You would need to create a 32-bit build environment similar to how
 buildworld stage 5.1 build the 32-bit libraries, or install
 FreeBSD/i386 into its own partition/directory and build it from there.
 
 1. Create directory to install FreeBSD/i386 into:
 
 mkdir /usr/home/build32
 
 2. Mount FreeBSD/i386 disc1 iso
 
 mount -t cd9660 /dev/cd0 /mnt
 
 or
 
 mount -t cd9660 /dev/`mdconfig -f 6.3-RELEASE-i386-disc1.iso` /mnt
 
 
 3. Install FreeBSD/i386 into /usr/home/build32
 
 cd /mnt/6.3-RELEASE/base
 DESTDIR=/usr/home/build32 install.sh
 
 4. link ld-elf.so.1 to ld-elf32.so.1
 
 cd /usr/home/build32/libexec
 ln -s ld-elf.so.1 ld-elf32.so.1
 cd ../usr/libexec
 ln -s ld-elf.so.1 ld-elf32.so.1
 
 Now place your source some where under /usr/home/build32, then chroot
 /usr/home/build32.  Change to the location of your sources and build
 your binary.
 
 Scot


More information about the freebsd-amd64 mailing list