Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 15 Mar 2011 00:16:41 +0100
From:      Dimitry Andric <dim@FreeBSD.org>
To:        Thomas David Rivers <rivers@dignus.com>
Cc:        freebsd-stable@freebsd.org
Subject:   Re: bin/139146 still not right in FreeBSD 8.2 (-m32 on amd64)?
Message-ID:  <4D7EA1D9.3060602@FreeBSD.org>
In-Reply-To: <201103092015.p29KFd0U077849@dave.dignus.com>
References:  <201103092015.p29KFd0U077849@dave.dignus.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On 2011-03-09 21:15, Thomas David Rivers wrote:
> Just installed a fresh 8.2-stable on a brand-spanking-new 64-bit
> machine...
>
> But, when I try to build 32-bit programs I get problems linking,
> and I stumbled onto PR bin/139146.
...
> /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching for -lgcc
> /usr/bin/ld: skipping incompatible /usr/lib/libgcc.a when searching for -lgcc
> /usr/bin/ld: cannot find -lgcc

I committed a fix for this in r219648, so at least:
- gcc -m32 uses the correct library path to find crt startup objects
- ld uses the correct library path to find libraries
- simple 'hello world' type programs link and run

However, this does *not* solve the problem completely, as the system
headers in /usr/include/machine will still be amd64 specific.  This
can result in various kinds of brokenness.  Please be careful.

If you want to reliably build i386 executables, you should still use a
native i386 installation.



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