PR target/47779 - detecting when compiling libgcc

Ian Lance Taylor iant@google.com
Tue Jun 7 14:01:00 GMT 2011


"Henderson, Stuart" <Stuart.Henderson@analog.com> writes:

> In order to fix PR target/47779, an enum in a uClibc header (sys/ucontext.h) must be excluded during the compilation of libgcc to avoid a name clash between it and the various register macros in insn-constants.h.
>
> Is there an established/good practice way to do this?
>
> The only macro I can see that is defined specifically during the compilation of libgcc is IN_LIBGCC2, however this is in the user's namespace so can't be used in the header.  Is this by design to prevent the use of the macro in headers?

As I tried to say last time around, the fix is for gcc to not define
those macros when it includes sys/ucontext.h.  As Joseph says in the PR,
the clean way to do this is to avoid including tm.h.  The ugly but much
simpler way is to avoid defining those macros in tm.h, either by never
defining them or by only defining them when IN_LIBGCC2 is not defined.

That is, don't try to fix sys/ucontext.h.  Fix gcc.

Ian



More information about the Gcc-help mailing list