From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 18 18:42:38 2012 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 8CCB1106564A for ; Mon, 18 Jun 2012 18:42:38 +0000 (UTC) (envelope-from nwhitehorn@freebsd.org) Received: from adsum.doit.wisc.edu (adsum.doit.wisc.edu [144.92.197.210]) by mx1.freebsd.org (Postfix) with ESMTP id 5BAF98FC0A for ; Mon, 18 Jun 2012 18:42:38 +0000 (UTC) MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII; format=flowed Received: from avs-daemon.smtpauth1.wiscmail.wisc.edu by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) id <0M5T00C04TAWLJ00@smtpauth1.wiscmail.wisc.edu> for freebsd-hackers@freebsd.org; Mon, 18 Jun 2012 13:42:32 -0500 (CDT) Received: from wanderer.tachypleus.net (i3-user-nat.icecube.wisc.edu [128.104.255.12]) by smtpauth1.wiscmail.wisc.edu (Sun Java(tm) System Messaging Server 7u2-7.05 32bit (built Jul 30 2009)) with ESMTPSA id <0M5T005NWTARLY10@smtpauth1.wiscmail.wisc.edu>; Mon, 18 Jun 2012 13:42:27 -0500 (CDT) Date: Mon, 18 Jun 2012 13:42:27 -0500 From: Nathan Whitehorn In-reply-to: <2d9e0a80-658b-438f-90f0-1f510fb1cdd8@email.android.com> To: Mike Meyer Message-id: <4FDF7693.6010506@freebsd.org> X-Spam-Report: AuthenticatedSender=yes, SenderIP=128.104.255.12 X-Spam-PmxInfo: Server=avs-13, Version=5.6.1.2065439, Antispam-Engine: 2.7.2.376379, Antispam-Data: 2012.6.18.183016, SenderIP=128.104.255.12 References: <4FDBBACF.9040809@shadowsun.net> <4FDE5E19.5050705@shadowsun.net> <2d9e0a80-658b-438f-90f0-1f510fb1cdd8@email.android.com> User-Agent: Mozilla/5.0 (X11; FreeBSD amd64; rv:12.0) Gecko/20120502 Thunderbird/12.0 Cc: freebsd-hackers@freebsd.org, Eric McCorkle Subject: Re: EFI development tools 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: Mon, 18 Jun 2012 18:42:38 -0000 On 06/17/12 19:43, Mike Meyer wrote: > Eric McCorkle wrote: > >> The -m32 flag seems to be the culprit; removing it fixes the problem. >> >> This is why I was having problems, as the offsets in EFI_SYSTEM_TABLE >> were wrong. >> >> In any case, this is a pretty serious error, and someone should try to >> reproduce it and take a look at it. > This is a known issue, and had been around for a long time. You can't reliably build 32 bit binaries (what the -m32 flag specifies) on a 64 bit system. The header files (and possibly other things) are wrong. > > Doesn't look like anyone has opened a PR for it. > This isn't as complicated as you make it seem. buildworld already does it to build the things in lib32 and on some platforms (mips and powerpc) the headers are the same for both 32- and 64-bit systems and so -m32 works perfectly already. All that is needed on x86 is some further header unification, which seems to be in progress. Moreover, if you are building standalone binaries (which the EFI stuff probably is) it should just work now, since standalone code doesn't depend on system headers. -Nathan