Summary: | games-fps/darkplaces-20140513-r1 - ../.../dpsoftrast.c: error: size of array element is not a multiple of its alignment | ||
---|---|---|---|
Product: | Gentoo Linux | Reporter: | Toralf Förster <toralf> |
Component: | Current packages | Assignee: | Gentoo Games <games> |
Status: | RESOLVED FIXED | ||
Severity: | normal | CC: | gentoo, ionen, sam |
Priority: | Normal | Keywords: | PATCH |
Version: | unspecified | ||
Hardware: | All | ||
OS: | Linux | ||
See Also: | https://bugs.gentoo.org/show_bug.cgi?id=788616 | ||
Whiteboard: | |||
Package list: | Runtime testing required: | --- | |
Bug Depends on: | |||
Bug Blocks: | 732706 | ||
Attachments: |
emerge-info.txt
emerge-history.txt environment etc.portage.tar.bz2 games-fps:darkplaces-20140513-r1:20210428-055408.log temp.tar.bz2 darkplaces-20140513-align-structs-not-typedefs.patch |
Description
Toralf Förster
2021-04-28 07:14:58 UTC
Created attachment 703059 [details]
emerge-info.txt
Created attachment 703062 [details]
emerge-history.txt
Created attachment 703065 [details]
environment
Created attachment 703068 [details]
etc.portage.tar.bz2
Created attachment 703071 [details]
games-fps:darkplaces-20140513-r1:20210428-055408.log
Created attachment 703074 [details]
temp.tar.bz2
Created attachment 704133 [details, diff] darkplaces-20140513-align-structs-not-typedefs.patch The problem arises because dpsoftrast.c declares overaligned types whose sizes are not multiples of their alignment. The apparent intent was to specify the alignment of the structures, which would add internal padding as necessary to increase the sizes of the structures to a multiple of their alignment, but the attribute was improperly positioned such that it applied to the typedefs rather than to the structure definitions. The attached patch correctly positions the __attribute__((__aligned__(16))) *after* the struct keyword so that the attribute applies to the structure definitions rather than to the type definitions. For more commentary, see: https://bugzilla.redhat.com/show_bug.cgi?id=1937076 games-fps/xonotic-0.8.2 ebuild has this engine bundled and fails with gcc11 on the same file with the same error. The bug has been closed via the following commit(s): https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=bc2ba1cd6fdc5a7ad7d161efb21652b73c6b207e commit bc2ba1cd6fdc5a7ad7d161efb21652b73c6b207e Author: Sergei Trofimovich <slyfox@gentoo.org> AuthorDate: 2021-06-13 18:51:51 +0000 Commit: Sergei Trofimovich <slyfox@gentoo.org> CommitDate: 2021-06-13 18:51:58 +0000 games-fps/darkplaces: tweak for gcc-11 Reported-by: Toralf Förster Closes: https://bugs.gentoo.org/786288 Package-Manager: Portage-3.0.19, Repoman-3.0.3 Signed-off-by: Sergei Trofimovich <slyfox@gentoo.org> games-fps/darkplaces/darkplaces-20140513-r1.ebuild | 2 + .../files/darkplaces-20140513-gcc-11.patch | 43 ++++++++++++++++++++++ 2 files changed, 45 insertions(+) Note that the committed patch implements the fix in a "less preferred" style than the patch I proposed. Per the GCC documentation <https://gcc.gnu.org/onlinedocs/gcc/Type-Attributes.html>: > You may specify type attributes in an enum, struct or union type declaration or definition by placing them immediately after the struct, union or enum keyword. You can also place them just past the closing curly brace of the definition, but this is less preferred because logically the type should be fully defined at the closing brace. |