From owner-freebsd-hackers@FreeBSD.ORG Thu Jun 21 12:22:06 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 1520D106564A for ; Thu, 21 Jun 2012 12:22:06 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from bigwig.baldwin.cx (bigknife-pt.tunnel.tserv9.chi1.ipv6.he.net [IPv6:2001:470:1f10:75::2]) by mx1.freebsd.org (Postfix) with ESMTP id D9BA28FC18 for ; Thu, 21 Jun 2012 12:22:05 +0000 (UTC) Received: from jhbbsd.localnet (unknown [209.249.190.124]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 4302AB97F; Thu, 21 Jun 2012 08:22:05 -0400 (EDT) From: John Baldwin To: freebsd-hackers@freebsd.org Date: Thu, 21 Jun 2012 08:07:07 -0400 User-Agent: KMail/1.13.5 (FreeBSD/8.2-CBSD-20110714-p13; KDE/4.5.5; amd64; ; ) References: <4FDBBACF.9040809@shadowsun.net> <4FDF7693.6010506@freebsd.org> <20120618164632.0c11695b@bhuda.mired.org> In-Reply-To: <20120618164632.0c11695b@bhuda.mired.org> MIME-Version: 1.0 Content-Type: Text/Plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Message-Id: <201206210807.07123.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH, not delayed by milter-greylist-4.2.7 (bigwig.baldwin.cx); Thu, 21 Jun 2012 08:22:05 -0400 (EDT) Cc: Mike Meyer 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: Thu, 21 Jun 2012 12:22:06 -0000 On Monday, June 18, 2012 4:46:32 pm Mike Meyer wrote: > On Mon, 18 Jun 2012 13:42:27 -0500 > Nathan Whitehorn wrote: > > > 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. > > It isn't as simple as you make it seem, either. buildworld has been > cross-compiling for years now. But buildworld builds against system > headers/libraries/etc other than those installed on the system, so > making it use the appropriate ones for a cross-compile is a > straightforward modification. Changing a build process that expect to > build against the headers/libraries/etc installed on the system is a > lot more work. Note that all the current boot bits on amd64 use -m32 and work fine. I think this is not nearly as complicated as you are making it out to be. > The header unification has been "in progress" for years. Actually, jilles@ has only been working on that for x86 in the last year or so. -- John Baldwin