Mike Stump <mikest...@comcast.net> writes:

> On May 30, 2011, at 8:43 AM, Rainer Orth wrote:
>> * The three users of MD_UNWIND_SUPPORT are modified to unconditionally
>>  include a new md-unwind-support.h header which is created from the
>>  info in config.host: if md_unwind_header exists, it is included in
>>  md-unwind-support.h, otherwise the generated header is empty.
>
>> diff --git a/gcc/config/rs6000/darwin.h b/gcc/config/rs6000/darwin.h
>> --- a/gcc/config/rs6000/darwin.h
>> +++ b/gcc/config/rs6000/darwin.h
>> @@ -381,10 +381,6 @@ extern int darwin_emit_branch_islands;
>> #include <stdbool.h>
>> #endif
>> 
>> -#if !defined(__LP64__) && !defined(DARWIN_LIBSYSTEM_HAS_UNWIND)
>> -#define MD_UNWIND_SUPPORT "config/rs6000/darwin-unwind.h"
>> -#endif
>> -
>
> So, I'm wondering, can we just roll this check into the header, so instead of:
>
> #if A
> #include file
> #endif
>
> file:
> bla
>
> we have:
>
> #include file
>
> file:
> #if A
> bla
> #endif
>
> The advantages, any wrapping code is handled the exact same way.  Once this 
> is done, then the transformation to port is identical to every other port.  
> Also, this general rule would apply to the other corner cases as well, if I 
> read them right.
>
> ?

The problem with this approach is that some of the macros tested only
live in gcc, not libgcc once the libgcc sources no longer include tm.h
etc.  E.g. look at i386/mingw32.h:

#if !TARGET_64BIT_DEFAULT && !defined (TARGET_BI_ARCH)
#define MD_UNWIND_SUPPORT "config/i386/w32-unwind.h"
#endif

Both TARGET_64BIT_DEFAULT and TARGET_BI_ARCH live in gcc only, so at
least in the medium term, we need different tests here.

> Oh, once this is done, I think:
>
> /* libSystem contains unwind information for signal frames.  */
> #define DARWIN_LIBSYSTEM_HAS_UNWIND
>
> is only used by libgcc.  Does it have to move at the same time?  If so, then 
> it needs moving.  If it doesn't have to move, you can leave it behind if you 
> want, though my preference would be to move it.

It doesn't have to, but it could.  On the other hand, my question still
stands: DARWIN_LIBSYSTEM_HAS_UNWIND is defined in gcc/config/darwin9.h.
So if every release up to Darwin 8 on PowerPC is 32-bit only (I honestly
don't know), then we could just restrict rs6000/darwin-unwind.h to
darwin < 9 and be done with it, no need for the macros above.

> I think the darwin bits are Ok with this change.

I can certainly do it this way for now, but if we could do away with the
tests completely, that would be cleaner.

Thanks.
        Rainer

-- 
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University

Reply via email to