How to use older libs in 32bit mode?

Michael R. Wayne amd64 at
Fri Nov 26 10:46:06 PST 2004

On Thu, Nov 25, 2004 at 12:42:33PM -0800, Peter Wemm wrote:
> Things to check:
> * Make sure you have COMPAT_IA32 in your kernel config.  For example,
> this command should work:
> peter at overcee[8:16pm]~/fbp4/hammer/sys/amd64/conf-120> sysctl kern.elf32
> kern.elf32.fallback_brand: -1
> (The important thing is that it prints something, not the value)

   > sysctl kern.elf32 
   kern.elf32.fallback_brand: -1

> * Make sure you have NOT copied ld-elf or libc from an i386 system.
> You *MUST* build at least these two on your machine.  How to check:
> peter at overcee[8:17pm]~-123> strings /libexec/ | grep libmap32
> /etc/libmap32.conf
> If this comes up empty, you're in trouble.  Check that
> /usr/libexec/ and /libexec/ are the same file.

So far OK:
   > strings /libexec/ | grep libmap32
   lrwxr-xr-x  1 root  wheel      22 Nov 15 17:13 /usr/libexec/ -> /libexec/

> These will not be present on a 5.3-release system.

Running 5.3-RELEASE so they are not present, as expected.

> Oh wait a second.  Did you build your libraries with
> WITH_LIB32=yes or by running ?  I have a suspicion
> that will produce a bad library now.

Aha.  Yes, I built with as it was the only way I found to 
do it.  If this is not correct, perhaps someone could put up a 
quick "how-to" page and post a URL?  

It would also be useful to understand how to build a port for i386,
google was not helpful in determining how to do this.

> BTW: it is helpful to do a ktrace/kdump and show the last few lines.
> I suspect there will be a sysarch syscall, followed by a SIGSEGV.

You are correct:
   72509 hello    CALL  sysarch(0x1,0xffffd70c)
   72509 hello    RET   sysarch -1 errno 22 Invalid argument
   72509 hello    PSIG  SIGSEGV SIG_DFL
   72509 hello    NAMI  "hello.core"

So, it looks like is broken on 5.3-RELEASE.  What now?

/\/\ \/\/

More information about the freebsd-amd64 mailing list