From owner-freebsd-arch@FreeBSD.ORG Fri Aug 6 23:17:12 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 C8D90106566B for ; Fri, 6 Aug 2010 23:17:12 +0000 (UTC) (envelope-from imp@bsdimp.com) Received: from harmony.bsdimp.com (bsdimp.com [199.45.160.85]) by mx1.freebsd.org (Postfix) with ESMTP id 624908FC31 for ; Fri, 6 Aug 2010 23:17:12 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by harmony.bsdimp.com (8.14.3/8.14.1) with ESMTP id o76N9UvR056603; Fri, 6 Aug 2010 17:09:33 -0600 (MDT) (envelope-from imp@bsdimp.com) Date: Fri, 06 Aug 2010 17:09:53 -0600 (MDT) Message-Id: <20100806.170953.119882392252204233.imp@bsdimp.com> To: tijl@coosemans.org From: "M. Warner Losh" In-Reply-To: <201007291718.12687.tijl@coosemans.org> References: <201007291718.12687.tijl@coosemans.org> X-Mailer: Mew version 6.3 on Emacs 22.3 / Mule 5.0 (SAKAKI) Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Content-Transfer-Encoding: 7bit Cc: pluknet@gmail.com, 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, 06 Aug 2010 23:17:12 -0000 In message: <201007291718.12687.tijl@coosemans.org> Tijl Coosemans writes: : Hi, : : 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. : : *cc-m32-2.diff* : Install i386 headers on amd64. : : With this patch headers for a particular $arch are always installed : under /usr/include/$arch and /usr/include/machine becomes a symlink. This patch is wrong. /usr/include/machine is for sys/$MACHINE/include, not for sys/$MACHINE_ARCH/include. These can (and will) be different. Today in the pc98/i386 case, but in the future in the mipsel/mips, mipseb/mips and armeb/arm cases. Warner