darwin cross compiling breakage
Ian Lance Taylor
iant@google.com
Mon Jun 12 21:07:00 GMT 2006
Mike Stump <mrs@apple.com> writes:
> On Jun 12, 2006, at 12:25 PM, Andrew Pinski wrote:
> > A little more, the default CROSS for a cross compiler defines
> > CROSS_COMPILE and
> > NON_SAME_CROSS_COMPILE while Darwin only defines CROSS_COMPILE.
>
> And so you want all of the existing:
>
> #ifdef CROSS_COMPILE
>
> to be changed to:
>
> #if defined(CROSS_COMPILE) && defined(NON_SAME_CROSS_COMPILE)
>
> save for the two in i386.h? That's doable, but Geoff's already said:
Presumably he means to change every
#ifdef CROSS_COMPILE
to
#ifdef NON_SAME_CROSS_COMPILE
Let me note that I count some 34 uses of CROSS_COMPILE in gcc. Of
those, only 8 are in machine independent code. 3 more are code that
might be used in Darwin. So we're not talking about some sort of
heroic effort here.
The machine independent uses of CROSS_COMPILE can mostly be
characterized as "don't use native tools" and "don't use native header
files and libraries." So we could introduce something like
NO_NATIVE_TOOLS. Then we could change every machine independent
instance of CROSS_COMPILE (all 8 of them) to check NO_NATIVE_TOOLS
instead. We could change other cases, where appropriate, at our
leisure.
Then a normal cross would define both CROSS_COMPILE and
NO_NATIVE_TOOLS. A Darwin -> Darwin cross would define CROSS_COMPILE
but not NO_NATIVE_TOOLS.
I don't think this would be confusing, nor do I think it would cause
an ongoing maintenance burden.
Ian
More information about the Gcc-patches
mailing list