Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 24 Aug 2011 16:01:42 +0300
From:      Kostik Belousov <kostikbel@gmail.com>
To:        Tom Evans <tevans.uk@googlemail.com>
Cc:        freebsd-stable@freebsd.org, Michael Hoffmann <benzene@arcor.de>
Subject:   Re: -m32 on freeBSD 8.2r amd64
Message-ID:  <20110824130142.GO17489@deviant.kiev.zoral.com.ua>
In-Reply-To: <CAFHbX1Lj7MgUJyofapUEZmCjXji0i4joAGAsKFoz7-eHOwkibA@mail.gmail.com>
References:  <201103092015.p29KFd0U077849@dave.dignus.com> <1314084403216-4725801.post@n5.nabble.com> <CAAtReC=NhQq2A7bwgo_H8tN23_x3xxS3ADFnHnpjfmU=27TdSQ@mail.gmail.com> <201108241311.11319.benzene@arcor.de> <CAFHbX1Lj7MgUJyofapUEZmCjXji0i4joAGAsKFoz7-eHOwkibA@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help

--gzCQSLRtB/T+Q+ea
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

On Wed, Aug 24, 2011 at 01:57:02PM +0100, Tom Evans wrote:
> On Wed, Aug 24, 2011 at 12:11 PM, Michael Hoffmann <benzene@arcor.de> wro=
te:
> > Maybe off topic?
> >
> > 1: echo "int main(void) { return 0; }" > t.c
> >
> > 2: setenv LDEMULATION elf_i386_fbsd
> >
> > 3: gcc -c -m32 -o t.o t.c
> >
> > 4: gcc -nostartfiles -o a.out
> > t.o -L/usr/lib32 /usr/lib32/crt1.o /usr/lib32/crti.o
> >
> > 5: file a.out
> > a.out: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD),
> > dynamically linked (uses shared libs), for FreeBSD 8.2, not stripped
> >
> > 6: uname -m
> > amd64
> >
> > 2: q.v. info binutils -> Selecting The Target System
> >
> > Maybe there is a more comfortable way.
> > Michael
> >
>=20
> You don't need to go to all that effort:
>=20
> $ uname -m
> amd64
> $ echo "int main(void) { return 0; }" > t.c
> $ gcc -c -m32 -o t.o t.c
> $ gcc -m32 -o t t.o -B/usr/lib32
> $ file t
> t: ELF 32-bit LSB executable, Intel 80386, version 1 (FreeBSD),
> dynamically linked (uses shared libs), for FreeBSD 8.2 (802510), not
> stripped

Well-known problem is that /usr/include/machine/*.h still contains
amd64 arch definitions. The resulting binary is broken in the quite
subtle ways.

--gzCQSLRtB/T+Q+ea
Content-Type: application/pgp-signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (FreeBSD)

iEYEARECAAYFAk5U9jYACgkQC3+MBN1Mb4gbJQCdEAEVzNoppt0KkUWbXWXb+aok
VicAn3vDgk2hP3gnyz+VvpQ1ztjG2rC2
=NZYe
-----END PGP SIGNATURE-----

--gzCQSLRtB/T+Q+ea--



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