From owner-freebsd-ports@FreeBSD.ORG Wed Apr 21 11:25:45 2010 Return-Path: Delivered-To: ports@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 4D48D106566B for ; Wed, 21 Apr 2010 11:25:45 +0000 (UTC) (envelope-from cjk32@cam.ac.uk) Received: from ppsw-43.csi.cam.ac.uk (ppsw-43.csi.cam.ac.uk [131.111.8.143]) by mx1.freebsd.org (Postfix) with ESMTP id 153B58FC1A for ; Wed, 21 Apr 2010 11:25:44 +0000 (UTC) X-Cam-AntiVirus: no malware found X-Cam-SpamDetails: not scanned X-Cam-ScannerInfo: http://www.cam.ac.uk/cs/email/scanner/ Received: from nat2.cjkey.org.uk ([88.97.163.221]:59887 helo=[192.168.2.59]) by ppsw-43.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:465) with esmtpsa (PLAIN:cjk32) (TLSv1:DHE-RSA-AES256-SHA:256) id 1O4XmL-0000Ch-DV (Exim 4.70) for ports@freebsd.org (return-path ); Wed, 21 Apr 2010 12:07:37 +0100 Message-ID: <4BCEDC78.7050202@cam.ac.uk> Date: Wed, 21 Apr 2010 12:07:36 +0100 From: Christopher Key User-Agent: Thunderbird 2.0.0.24 (Windows/20100228) MIME-Version: 1.0 To: ports@freebsd.org X-Enigmail-Version: 0.95.7 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: Subject: Compiling for i386 on amd64 using tinderbox X-BeenThere: freebsd-ports@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Porting software to FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 21 Apr 2010 11:25:45 -0000 Hello, I've recently been experimenting with building ports for i386 and amd64 using tinderbox on an amd64 machine. Most ports aren't architecture specific, and just use the toolchain provided within the tinderbox jail, blindly producing i386/amd64 binaries as appropriate. However, some ports are architecture specific, e.g. those that have assembler optimised routines, and they cause problems when compiling for i386 on my amd64 machine. Generally, they detect their host environment using uname, and get amd64 back from the kernel. They then proceeed to build, passing amd64 code the the i386 assembler, and fail. I'm not sure what the best solution is to this problem. The purist approach would be to have tinderbox work harder to emulate the target environment, and patch uname to return the appropriate answer. An alternative solutions seems to be to try to get ports to prevent autodetection of the architecture, and use ARCH instead. This can be set in make.conf within the tinderbox jail, overriding the autodetection performed by the port build system. For most ports, the should be fairly straightforward. For example the only change needed in qt4-corelib is [1] Is this something that should be fixed? Do either of the above solutions make sense? It certainly seems desirable to be able to cross compile ports like this, both for testing and for producing packages. Kind regards, Christopher Key [1] --- devel/qt4-corelib/Makefile 2010-03-25 14:52:17.000000000 +0000 +++ devel/qt4-corelib/Makefile 2010-04-21 11:35:20.000000000 +0100 @@ -27,6 +27,7 @@ ALL_TARGET= first CONFIGURE_ENV?= QTDIR=${WRKSRC} PATH=${WRKSRC}/bin:$$PATH +CONFIGURE_ARGS?= -arch ${ARCH:S/amd64/x86_64/} MAKE_ENV?= QTDIR=${WRKSRC} LD_LIBRARY_PATH=${WRKSRC}/lib \ PATH=${WRKSRC}/bin:$$PATH