Re: Plan needed for switching m68k to 32-bit alignment
On Sun, 2024-10-27 at 14:47 +1100, Finn Thain wrote:
> On Sun, 27 Oct 2024, Thorsten Glaser wrote:
>
> > > https://gcc.gnu.org/wiki/RustFrontEnd
> >
> > That’s assuming it can build the same stuff the same way so it can be
> > used in packaging.
> >
>
> Not an assumption. I simply pointed out an opportunity for collaboration,
> because I see the primary problem facing the m68k port is a lack of
> resources.
There is hardly anyone to collaborate with. Plus, the problem is that 99%
the upstream projects will not carry any patches that unbreak their software
on m68k.
> > > I expect alignment assumptions like that will end up putting more
> > > platforms in the same predicament in future.
> >
> > No, all the other platforms use natural alignment.
> >
> > > "Natural" alignment is meaningless in the context of portable data
> > > structures, as they exist without reference to any particular integer
> >
> > Yeah, but in practice, all we have is ILP32 and LP64;
>
> ... for now.
Sorry, but this a moot argument. Arguing with what could be in 50 years isn't
helpful here if it just intended to quench the discussion.
> > the Windows® world has LLP64 in addition. And natural alignment just
> > means that all the data types’ alignment is their size. (Which kind of
> > makes sense, so you can read them without getting an unalignment trap on
> > SPARC or so.)
> >
>
> That would mean __alignof__(foo.b) == sizeof(foo.b) but that's not the
> case on my Linux/i686 system. 4 != 8:
>
> struct baa {
> int a;
> long long b;
> } foo;
>
> > > Q. What is the size of this struct, assuming baa.b is naturally aligned?
> > >
> > > struct baa {
> > > int a;
> > > long long b;
> > > };
> >
> > For ILP32, LP64 and LLP64, it’s 4 (a) + 4 (padding) + 8 (b) = 16 chars.
>
> So natural alignment is portable if you first assume a data model. But the
> struct definition itself is not portable, since it doesn't specify a data
> model.
>
> > More importantly, and relevant for Qt, struct baa is also 8-byte
> > aligned...
> >
>
> If the struct itself is not naturally aligned, it too will eventually
> break someone's assumption of natural alignment.
All this discussion doesn't help solve the real world problems with the m68k port.
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Reply to: