From owner-freebsd-hackers@FreeBSD.ORG Fri Jul 27 10:20:31 2007 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E621016A419 for ; Fri, 27 Jul 2007 10:20:31 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (c220-239-20-82.belrs4.nsw.optusnet.com.au [220.239.20.82]) by mx1.freebsd.org (Postfix) with ESMTP id 7289E13C4DE for ; Fri, 27 Jul 2007 10:20:31 +0000 (UTC) (envelope-from peterjeremy@optushome.com.au) Received: from turion.vk2pj.dyndns.org (localhost.vk2pj.dyndns.org [127.0.0.1]) by turion.vk2pj.dyndns.org (8.14.1/8.14.1) with ESMTP id l6RAKRJ4001837; Fri, 27 Jul 2007 20:20:27 +1000 (EST) (envelope-from peter@turion.vk2pj.dyndns.org) Received: (from peter@localhost) by turion.vk2pj.dyndns.org (8.14.1/8.14.1/Submit) id l6RAKR7e001836; Fri, 27 Jul 2007 20:20:27 +1000 (EST) (envelope-from peter) Date: Fri, 27 Jul 2007 20:20:27 +1000 From: Peter Jeremy To: Sharad Chandra Message-ID: <20070727102027.GH1152@turion.vk2pj.dyndns.org> References: <200707271513.48639.sharadc@niksun.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="1LKvkjL3sHcu1TtY" Content-Disposition: inline In-Reply-To: <200707271513.48639.sharadc@niksun.com> X-PGP-Key: http://members.optusnet.com.au/peterjeremy/pubkey.asc User-Agent: Mutt/1.5.16 (2007-06-09) Cc: FreeBSD Hackers Subject: Re: gcc -m32 option on amd64. X-BeenThere: freebsd-hackers@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Technical Discussions relating to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 27 Jul 2007 10:20:32 -0000 --1LKvkjL3sHcu1TtY Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On 2007-Jul-27 15:13:48 +0530, Sharad Chandra wrote: >I am trying gcc -m32 on freebsd 6.1 amd64 env, but it does not seems to be= =20 >working. i also installed /usr/port/lang/linux-libgcc/ but did not help >what i did is=3D> >echo "main () {}" > t.c; gcc -m32 t.c >/usr/bin/ld: skipping=20 >incompatible /usr/local/lib/gcc/x86_64-portbld-freebsd6.1/4.2.0/gcc/x86_64= -portbld-freebsd6.1/4.2.0/libgcc.a=20 >when searching for -lgcc >/usr/bin/ld: cannot find -lgcc >collect2: ld returned 1 exit status > >how can we make this working? You are using gcc 4.2 from ports. I suspect this only includes the 64-bit libraries. gcc in the base system includes both 32-bit and 64-bit libraries by default but it still suffers the same problem. I had a go at fixing the problem in amd64/112215 but this has other problems and needs more work. Note that non-trivial code will break because points at amd64 headers whilst the -m32 compiler needs i386 headers in many cases. There's a non-trivial amount of work needed to actually get cross-building working. I suggest you look throught the FreeBSD-amd64 archives. --=20 Peter Jeremy --1LKvkjL3sHcu1TtY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (FreeBSD) iD8DBQFGqcbr/opHv/APuIcRAum1AJ9/Nc57oDejiK+Uod0PTflaVSyXJgCfbeqg egv8cV8WsCKC3WqLF6Alvk0= =RcU8 -----END PGP SIGNATURE----- --1LKvkjL3sHcu1TtY--