From owner-freebsd-hackers@FreeBSD.ORG Sun Jun 17 22:45:47 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 EB5FE1065670 for ; Sun, 17 Jun 2012 22:45:47 +0000 (UTC) (envelope-from eric@shadowsun.net) Received: from mail.atlantawebhost.com (dns1.atlantawebhost.com [66.223.40.39]) by mx1.freebsd.org (Postfix) with ESMTP id 855698FC17 for ; Sun, 17 Jun 2012 22:45:47 +0000 (UTC) Received: (qmail 9071 invoked from network); 17 Jun 2012 18:45:46 -0400 Received: from c-71-192-38-198.hsd1.ma.comcast.net (HELO Macintosh-21.local) (71.192.38.198) by mail.atlantawebhost.com with SMTP; 17 Jun 2012 18:45:46 -0400 Message-ID: <4FDE5E19.5050705@shadowsun.net> Date: Sun, 17 Jun 2012 18:45:45 -0400 From: Eric McCorkle User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.5; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 MIME-Version: 1.0 To: freebsd-hackers@freebsd.org References: <4FDBBACF.9040809@shadowsun.net> In-Reply-To: <4FDBBACF.9040809@shadowsun.net> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit 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: Sun, 17 Jun 2012 22:45:48 -0000 On 6/15/12 6:44 PM, Eric McCorkle wrote: > However, the EFI programs I produce using the EDK system work > properly, and don't have the same issues as the ones I produce using > what's in the base system. > Okay, after a whole lot of slogging, I figured out the root of the problems I've been seeing, and it needs to be addressed ASAP. When I compile the following program: #include #include #include #include int main() { printf("%d\n", UINT64); return 0; } as follows: gcc -o test -O2 -m32 -I${HEAD}/sys/boot/efi/include -I${HEAD}/sys/boot/efi/include/i386 -I${HEAD}/sys/boot/common test.c and run it, the output is 4, not 8 as it should be. You can replace UINT64 with uint64_t and see the same (erroneous) behavior. 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.