Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 19 Mar 2004 17:56:35 -0800
From:      Peter Wemm <peter@wemm.org>
To:        freebsd-amd64@freebsd.org
Cc:        Andrew Gallatin <gallatin@cs.duke.edu>
Subject:   Re: freebsd32 organization?
Message-ID:  <200403191756.35502.peter@wemm.org>
In-Reply-To: <16474.3985.214325.22127@grasshopper.cs.duke.edu>
References:  <16474.3985.214325.22127@grasshopper.cs.duke.edu>

next in thread | previous in thread | raw e-mail | index | archive | help
On Thursday 18 March 2004 01:07 pm, Andrew Gallatin wrote:
> What's the "standard" way of installing 32-bit freebsd libraries
> so as to be able to run a 32-bit binary?
>
> What I did was to copy ld-elf.so.1 from a 4.9 machine to
> /libexec/ld-elf-32.so.1, and then copy the 4.9 libs
> to a lib32 directory, and then launch 32-bit binaries
> with a wrapper script that sets LD_LIBRARY_PATH to lib32.
>
> This is a total hack,  and I assume there must be a better way.

The are better ways, the best is probably to grab the ld-elf-32.so.1 
from http://people.freebsd.org/~peter/ld-elf-32.so.1

I do have a slightly more refined system in the p4 tree, but it is still 
an evil hack.  I think I've figured out how to get the tree impact down 
to an acceptable level.

I've split out the 32 bit libraries part of my current WIP. You can see 
it here:  http://people.freebsd.org/~peter/lib32.diff

Note that there is one small kernel diff there.  You use this by doing a 
buildworld/installworld, and after that is finished, run the build32.sh
script.  That sets up a temporary include tree, builds 32 bit libraries,
installs them, and builds a ld-elf32.so.1.  You can set paths for it via 
the "-32"  flag to ldconfig.

> FWIW, I'm doing this because firefox (built from ports cvsupped
> today) exits randomly, so I'm running mozilla built on a 4.9 box..

This is a libpthread problem, for reasons I haven't been able to track 
down yet.  The best cheat method is to use libmap to translate all
the libpthread.so.1 references to libc_r.so.5.  It turns out to be quite 
robust with libc_r.  The libpthread problem appears to be the good old 
misaligned stack problem lurking somewhere.

I'll be tackling this next.  I do recommend using the 64 bit firefox 
though, it is rock solid with libc_r.

-- 
Peter Wemm - peter@wemm.org; peter@FreeBSD.org; peter@yahoo-inc.com
"All of this is for nothing if we don't go to the stars" - JMS/B5



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