On Sat, 3 Nov 2018 at 23:23, Iain Buclaw <ibuc...@gdcproject.org> wrote:
>
> On Wed, 31 Oct 2018 at 10:40, Rainer Orth <r...@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?
>

Actually, turns out I'm wrong and was grepping for the wrong name.

It is supported in the form of #pragma pack(8)

https://www.digitalmars.com/ctg/pragmas.html#pack

-- 
Iain

Reply via email to