From owner-freebsd-arch@FreeBSD.ORG Fri Jul 30 08:53:30 2010 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id A4C61106567C for ; Fri, 30 Jul 2010 08:53:30 +0000 (UTC) (envelope-from tijl@coosemans.org) Received: from mailrelay004.isp.belgacom.be (mailrelay004.isp.belgacom.be [195.238.6.170]) by mx1.freebsd.org (Postfix) with ESMTP id 16E128FC19 for ; Fri, 30 Jul 2010 08:53:29 +0000 (UTC) X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AvsEAAYwUkxbscBD/2dsb2JhbACgF3K+aYU5BA Received: from 67.192-177-91.adsl-dyn.isp.belgacom.be (HELO kalimero.tijl.coosemans.org) ([91.177.192.67]) by relay.skynet.be with ESMTP; 30 Jul 2010 10:53:28 +0200 Received: from kalimero.tijl.coosemans.org (kalimero.tijl.coosemans.org [127.0.0.1]) by kalimero.tijl.coosemans.org (8.14.4/8.14.4) with ESMTP id o6U8rRvK002422; Fri, 30 Jul 2010 10:53:28 +0200 (CEST) (envelope-from tijl@coosemans.org) From: Tijl Coosemans To: Nathan Whitehorn Date: Fri, 30 Jul 2010 10:53:17 +0200 User-Agent: KMail/1.13.5 (FreeBSD/8.1-PRERELEASE; KDE/4.4.5; i386; ; ) References: <201007291718.12687.tijl@coosemans.org> <4C520044.5020002@freebsd.org> In-Reply-To: <4C520044.5020002@freebsd.org> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart2641494.0OStBKXvGs"; protocol="application/pgp-signature"; micalg=pgp-sha256 Content-Transfer-Encoding: 7bit Message-Id: <201007301053.27407.tijl@coosemans.org> Cc: pluknet , freebsd-arch@freebsd.org Subject: Re: Support for cc -m32 X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 30 Jul 2010 08:53:30 -0000 --nextPart2641494.0OStBKXvGs Content-Type: Text/Plain; charset="us-ascii" Content-Transfer-Encoding: 7bit On Friday 30 July 2010 00:27:16 Nathan Whitehorn wrote: > On 07/29/10 17:18, Tijl Coosemans wrote: >> I've put the initial version of some patches online to support cross >> compilation of 32 bit binaries on amd64. It's modelled after how NetBSD >> does this. >> >> With these patches something like "cc -m32 -o test test.c -pthread -lm" >> generates a program that runs on FreeBSD/i386. >> >> http://people.freebsd.org/~tijl/cc-m32-1.diff >> http://people.freebsd.org/~tijl/cc-m32-2.diff >> http://people.freebsd.org/~tijl/cc-m32-3.diff >> >> *cc-m32-1.diff* : Let ld and cc find 32 bit libraries. > > Why not use the GCC multilib code for what patch 1 does? There is > already code in cc_tools/Makefile to handle this for powerpc64 (where > cc -m32 already works). Thanks, it's indeed better to specify this per architecture so I've updated the patch. It changes the output of -print-search-dirs though. With the previous patch "cc -m32 -print-search-dirs" printed: install: /usr/libexec/ programs: =/usr/bin/:/usr/bin/:/usr/libexec/:/usr/libexec/:/usr/libexec/ libraries: =/usr/lib32/:/usr/lib32/ And now it prints: install: /usr/libexec/ programs: =/usr/bin/:/usr/bin/:/usr/libexec/:/usr/libexec/:/usr/libexec/ libraries: =/usr/lib/32/:/usr/lib/../lib32/:/usr/lib/:/usr/lib/ That works, but it's not entirely correct. --nextPart2641494.0OStBKXvGs Content-Type: application/pgp-signature; name=signature.asc Content-Description: This is a digitally signed message part. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.15 (FreeBSD) iF4EABEIAAYFAkxSkwcACgkQfoCS2CCgtisPOAD/QduCN05QUX07YjqhZfH3FTKc tCUmX/svoR98579BkDIA+wbjmTP5n5LnT7E3B6JktpYe9ByYjB8nL2rhBwH4s5SY =SAB4 -----END PGP SIGNATURE----- --nextPart2641494.0OStBKXvGs--