Discussion:
Bug#932090: firebird3.0: Please include patch to ensure correct sizes of on-disk structures
(too old to reply)
John Paul Adrian Glaubitz
2019-07-14 23:00:01 UTC
Permalink
Source: firebird3.0
Version: 3.0.5.33100.ds4-3
Severity: normal
Tags: patch
User: debian-***@lists.debian.org
Usertags: m68k

Hi!

firebird3.0 currently fails to build from source on m68k because the native
alignment of 16 bits on this architecture causes the on-disk structures to
have unexpected sizes.

With the attached patch, padding is added to the affected on-disk structures
such that the correct sizes are always guaranteed. Since this particular
padding happens automatically and implicitly for architectures with 32 or
64 bits native alignment, the actual sizes and offsets of the on-disk
structures do not change and therefore no compatibility break is going
to occur.

Using explicit padding has the advantage that the actual sizes and offsets
are completely visible and transparent to anyone reading the code.

I will forward this patch upstream.

Thanks,
Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer - ***@debian.org
`. `' Freie Universitaet Berlin - ***@physik.fu-berlin.de
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
John Paul Adrian Glaubitz
2022-05-12 05:40:01 UTC
Permalink
Hi Damyan!
Can you tell me where was the patch forwarded? I want to check whether
it is part of some upstream branch before applying it to the debian
package.
Patch and discussion can be found here [1].

However, it turns out that my approach is wrong and upstream has already used
a different approach for firebird4.0 [2], although I haven't tested that on
m68k yet.

Will test later.

Adrian
[1] https://github.com/FirebirdSQL/firebird/pull/217
[2] https://github.com/FirebirdSQL/firebird/pull/234/commits
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Thorsten Glaser
2024-03-16 21:30:01 UTC
Permalink
However, it turns out that my approach is wrong and upstream has already u=
sed
a different approach for firebird4.0 [2], although I haven't tested that o=
n
m68k yet.
[2] https://github.com/FirebirdSQL/firebird/pull/234/commits
(use https://github.com/FirebirdSQL/firebird/pull/234.patch in lynx)

Very much not; firebird3.0 also has that now AFAICT, and now the static
asserts fail.

The alignment assumptions must be made explicit: change something like=E2=
=80=A6

struct foo {
=09char a;
=09int b;
};

=E2=80=A6 to:

struct foo {
=09char a;
=09char padding1[3];
=09int b;
};

bye,
//mirabilos
--=20
When he found out that the m68k port was in a pretty bad shape, he did
not, like many before him, shrug and move on; instead, he took it upon
himself to start compiling things, just so he could compile his shell.
How's that for dedication. -- Wouter, about my Debian/m68k revival
Loading...