This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
Re: Fix D compilation on Solaris
- From: Rainer Orth <ro at CeBiTec dot Uni-Bielefeld dot DE>
- To: Iain Buclaw <ibuclaw at gdcproject dot org>
- Cc: gcc-patches <gcc-patches at gcc dot gnu dot org>
- Date: Sun, 04 Nov 2018 17:47:24 +0100
- Subject: Re: Fix D compilation on Solaris
- References: <ydd1s871yng.fsf@CeBiTec.Uni-Bielefeld.DE> <yddwopzzig4.fsf@CeBiTec.Uni-Bielefeld.DE> <CABOHX+dh65O1JBVfGnxOr8PDkLE64=_VP8x6k5qhBThU3R6t5g@mail.gmail.com> <yddsh0mzc6n.fsf@CeBiTec.Uni-Bielefeld.DE> <CABOHX+eJJoa9UaJuJ-Dq4TnELbkV6T2kFXAc-DE0zHf0mLPDig@mail.gmail.com>
Hi Iain,
> On Wed, 31 Oct 2018 at 10:40, Rainer Orth <ro@cebitec.uni-bielefeld.de> wrote:
>>
>> Hi Iain,
>>
>> > My first suspect here would be 'struct UnionExp', see d/dmd/expression.h
>> >
>> > Upstream dmd use a poor man's alignment, from what I recall to be
>> > compatible with the dmc compiler.
>> >
>> > // Ensure that the union is suitably aligned.
>> > real_t for_alignment_only;
>> >
>> > What happens if you were to replace that with marking the type as
>> > __attribute__ ((aligned (8))) ?
>>
>> thanks for the suggestion: this worked just fine. After a couple more
>> libphobos adjustments (described below), I was able to finish the build
>> on both sparc-sun-solaris2.11 and i386-pc-solaris2.11.
>>
>> The link tests still all fail as before, but sparc and x86 are now on
>> par here :-)
>>
>
> Hi Rainer,
>
> On making the relevant change to dmd, this header probably should
> remain compatible with dmc++, which unfortunately doesn't implement
> any __attribute__ extensions. Does s/real_t/long double/ also prevent
> the alignment error from occurring?
it does indeed, as checked by a sparc-sun-solaris2.11 bootstrap.
Thanks.
Rainer
--
-----------------------------------------------------------------------------
Rainer Orth, Center for Biotechnology, Bielefeld University