From owner-freebsd-hackers@FreeBSD.ORG Mon Jun 18 20:46:38 2012 Return-Path: Delivered-To: freebsd-hackers@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 3EF741065673 for ; Mon, 18 Jun 2012 20:46:38 +0000 (UTC) (envelope-from mwm@mired.org) Received: from mail-qa0-f52.google.com (mail-qa0-f52.google.com [209.85.216.52]) by mx1.freebsd.org (Postfix) with ESMTP id D5E848FC17 for ; Mon, 18 Jun 2012 20:46:37 +0000 (UTC) Received: by qabj34 with SMTP id j34so2125168qab.11 for ; Mon, 18 Jun 2012 13:46:37 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20120113; h=date:from:to:subject:message-id:in-reply-to:references:organization :x-mailer:face:mime-version:content-type:content-transfer-encoding :x-gm-message-state; bh=jV5NEU9Nw5wqiWO6yW9TN/Um4cGPQZLaYOKaU2dNXFw=; b=emLokhlxNGAUV2dLSY4FtB1/m0mYV4fa0DXw/UR9uCS5ErUu3sxDwZneV8Lu3fAMTZ VP9yt1//sqiBPEllv8PdmSqawdrn/ZbmaBKvrv5GimmeZM0LlVUoWI8sv2g+Tbhr9EyE V90KiKMILhdv+nt/ADHesYC+rj1w5X0BZ2Xf5PyBHqb2WxnW3ilRyHSvTV3pAXrEhlQR OQVc3JYQOImHw7ZUtRb8c9OHsLKK+9bDrsEy7TKYOih2yVbRB5wpNMjmdwOD+FPgo8hK G7dkrslZFGT2S5oXOmaX9KS6Kjc67EFP7vut5fdNcQyE6pyyIV9ZFN+4LUfPObfl+2UW fhLA== Received: by 10.229.136.148 with SMTP id r20mr8344170qct.58.1340052396941; Mon, 18 Jun 2012 13:46:36 -0700 (PDT) Received: from bhuda.mired.org (74-140-201-117.dhcp.insightbb.com. [74.140.201.117]) by mx.google.com with ESMTPS id n2sm43499347qap.10.2012.06.18.13.46.36 (version=TLSv1/SSLv3 cipher=OTHER); Mon, 18 Jun 2012 13:46:36 -0700 (PDT) Date: Mon, 18 Jun 2012 16:46:32 -0400 From: Mike Meyer To: freebsd-hackers@freebsd.org Message-ID: <20120618164632.0c11695b@bhuda.mired.org> In-Reply-To: <4FDF7693.6010506@freebsd.org> References: <4FDBBACF.9040809@shadowsun.net> <4FDE5E19.5050705@shadowsun.net> <2d9e0a80-658b-438f-90f0-1f510fb1cdd8@email.android.com> <4FDF7693.6010506@freebsd.org> Organization: Meyer Consulting X-Mailer: Claws Mail 3.8.0 (GTK+ 2.24.6; amd64-portbld-freebsd8.3) Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwBAMAAAClLOS0AAAAG1BMVEXguIzRkGnhyaz069mXhW0WHRnbrnR9WCQ6LB0CchNMAAACSUlEQVQ4jV2TQW7jMAxFGaPQOgQEdZaGMsgBrAvUA03dCxj1Uu4U2gfwQD7AGNax51NK07RcxXz6/CSl0Ij450vkPG1jzpIZM1UwDCl/xB14TWnNX8A00Qj5a0mnVFVbVUz4MeErea2HikSRqZzY894zwg9p2+/AtO8LzxFED+tNAUFeU29iFOLRxlZAcdo9A8wi8ZBMV4BKPde82Oxrvs6BTkulQIClte0DLFzzsKk9j1MBex8iUaP00Bd78S/muyFScrTXz6zLkEUxJp+SabQfNOs4f4Jpx5qSZ/304PWwlEWP1cOn/mJQR7EOD+uKhjcBLziuL7xoY5Xm+VFAUSw/LwwwsHEHxihpwV4EJH0xXRkbw1PkRw+X4pEuSJwBggqk+HEYKkiL5/74/nQkogigzQsAFrakxZyfw3wMIEEZPv4AWMfxwqE5GNxGaERjmH+PG8AE0L4/w9g0lsp1raLYAN5azQa+AOoO9NwcpFkTrG2VKNMNEL5UKUUAw34tha0z7onUG0oBoNtczE04GwFE3wCHc0ChezAJ6A1WMV81AtY7wDAJSlXwV+4cwBvsOsrQMRawfQEBz0deEZ7WNpV2szckIKo5VpDHDSDvF1GItwqqAlG01Hh50BGtVhuUkjkasg/14bYFGCgWg1fSWHvmOoJck2xdp9ZvZBHzDVTzX23TkrOn7qe5U2COEw5D4Vx3qEQpFY2Z/3QFnJxzp7YCmSMG19nOUoe869zZfOQb5ywQuWu0yCn5+8gxZz+BE7vG3j4/wbf4D/sXN9Wug1s7AAAAAElFTkSuQmCC Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Gm-Message-State: ALoCoQmywdUEbJ8OtY5GTFyIIOl0G3YMnwj1zRscsDbgenMRQRoYu3E1AAzdNdvnjMj5SfdDB34J 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 20:46:38 -0000 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. The header unification has been "in progress" for years. We still don't have general-purpose cross-compiling working - at least not for FreeBSD targets. I admit that I haven't been following the issue, as my need for it vanished with my last 32-bit system (years ago), so it may be possible with the right set of ports installed, as it is for non-FreeBSD targets. > 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. Except the headers they do depend on (like ctype.h) depend on system headers. http://www.mired.org/ Independent Software developer/SCM consultant, email for more information. O< ascii ribbon campaign - stop html mail - www.asciiribbon.org