[PATCH] replace LIBGCC2_WORDS_BIG_ENDIAN with __WORDS_BIG_ENDIAN__

Mark Mitchell mark@codesourcery.com
Thu Oct 14 00:36:00 GMT 2010


On 10/13/2010 5:10 PM, Nathan Froyd wrote:

> But your point about this being a public API raises an interesting
> question: what to do about those macros which are legitimately used in
> both the compiler and libgcc?  (Examples include HAS_INIT_SECTION,
> EH_FRAME_SECTION_NAME, and CLEAR_CACHE.)

I think CLEAR_CACHE is actually a built-in now, right?  So, that should
be no problem.

For the other ones, I think a compiler pre-defined macro is reasonable.
 That's the only method I can think of that doesn't require replicating
configuration information, other than autoconf tests.  And, if this
information is useful in libgcc, it might well be useful in some other
low-level context.

I suppose autoconf tests are a possibility, but that seems pretty
fragile; for example, we'd have to compile something with initializers
and then grep around in the generated .s file to figure out whether
HAS_INIT_SECTION did something or not.

-- 
Mark Mitchell
CodeSourcery
mark@codesourcery.com
(650) 331-3385 x713



More information about the Gcc-patches mailing list