Gentoo Archives: gentoo-amd64

From: Marco Matthies <marco-ml@×××.net>
To: gentoo-amd64@l.g.o
Subject: Re: [gentoo-amd64] 64-bit or 32-bit?
Date: Tue, 28 Mar 2006 22:50:32
In Reply to: Re: [gentoo-amd64] 64-bit or 32-bit? by Bertrand Jacquin
Bertrand Jacquin wrote:
> How could you compile mplayer or firefox in your 64 bits environnement > to generate 32 bits binary ? I have multilib activated and I can't > build mplayer with CFLAGS="-m32". > > It is needing something else ? > > I don't want too to have and maintain a 32 bit chroot.
I'm assuming you're talking about compiling something by hand here. As other people have mentioned here, support for portage to compile arbitrary apps/libs 32-bit or 64-bit isn't there yet (at least in stable portage which is what i'm using), every ebuild for amd64 at the moment chooses either 32-bit or 64-bit (by setting ABI=x86 or ABI=amd64). You need the 32-bit libs (which should go into /lib32 and /usr/lib32) that your application depends on. At a bare minimum, this is going to be libc for C programs, but usually some other libs as well. To make precompiled dynamically linked 32-bit binaries such as mplayer-bin possible, gentoo also supplies the libs needed for these binary ebuilds in /emul/linux/x86 which are installed by the emul-linux-x86-* ebuilds. So, if the app you want to compile by hand uses only these, you can get away with something along the lines of: ./configure \ CFLAGS="-m32 -L/emul/linux/x86/lib -L/emul/linux/x86/usr/lib" \ LDFLAGS="-m32 -L/emul/linux/x86/lib -L/emul/linux/x86/usr/lib" or ./configure \ CFLAGS="-m32 -L/emul/linux/x86/lib -L/emul/linux/x86/usr/lib" \ LDFLAGS="-m elf_i386 -L/emul/linux/x86/lib -L/emul/linux/x86/usr/lib" Which one of these two lines you need to use depends on if LDFLAGS gets passed to gcc or ld by the makefile. (see /usr/portage/profiles/default-linux/amd64/2006.0/make.defaults) If the app you want to compile needs additional libs, you'll have to compile them yourself, install them under /usr/local and then compile the app you're interested in -- this probably quickly becomes annoying enough to make a 32-bit chroot so you can let portage+ebuilds do all the work for you. Marco -- gentoo-amd64@g.o mailing list


Subject Author
Re: [gentoo-amd64] 64-bit or 32-bit? Bertrand Jacquin <beber.gentoo@×××××.com>