This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: PATCH: Fix Solaris/SPARC bootstrap without gas


David Miller <davem@davemloft.net> writes:

> From: Rainer Orth <ro@CeBiTec.Uni-Bielefeld.DE>
> Date: Thu, 04 Feb 2010 13:30:26 +0100
>
>> * If we have to revisit this and do it properly, the right way to me
>>   seems to simply check for the gas/as feature we need in configure.ac,
>>   define an appropriate macro, and use that instead of statically
>>   including some header.  It might even be that older versions of gas
>>   don't support what we need (I have no idea, though), so the static
>>   approach is highly problematic.
>
> It's not about features.

We seem to have different ideas of features :-)

> It's about the fact that Solaris's assembler uses different
> section attribute specifiers than any other ELF assembler
> in the world.

Indeed, and this is certainly a feature testable with autoconf:

* Sun as on SPARC at the moment only understands

	.section        ".gcc_except_table",#alloc,#write

* GNU as (at least as of version 2.19) understand both the Sun syntax
  and

	.section        .gcc_except_table,"aw",@progbits

So it should be easy to test for the second form first, then for the
first, and depending on the outcome, #define HAVE_SUN_AS_SECTION_SYNTAX
and use it instead of !HAVE_GNU_AS.  No additional files and more
maintainable.

> That's the only reason the override exists.
>
> So we really, and truly, want to test whether we are using
> GAS or not.

And what happens if Sun as starts supporting the common ELF syntax, too?
I'm all for actually testing for features rather than hardcoding values
that can change.

> Basically, the only configuration that should be using the
> sparc target override function is Solaris without GAS.

At least for the moment, but you achieve this with the test above, too,
and still remain futureproof.

If you agree, I can code such a test, though the full patch will still
require testing on both Solaris and Linux.

	Rainer

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


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]