Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Jun 2012 16:46:32 -0400
From:      Mike Meyer <mwm@mired.org>
To:        freebsd-hackers@freebsd.org
Subject:   Re: EFI development tools
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>

next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 18 Jun 2012 13:42:27 -0500
Nathan Whitehorn <nwhitehorn@freebsd.org> wrote:

> On 06/17/12 19:43, Mike Meyer wrote:
> > Eric McCorkle<eric@shadowsun.net>  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.

	<mike
-- 
Mike Meyer <mwm@mired.org>		http://www.mired.org/
Independent Software developer/SCM consultant, email for more information.

O< ascii ribbon campaign - stop html mail - www.asciiribbon.org



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20120618164632.0c11695b>