x86_64-pc-linux-gnu-gcc -MMD -DDP_FS_BASEDIR=\""/usr/share/quake1"\" -Wall -Wold-style-definition -Wstrict-prototypes -Wsign-compare -Wdeclaration-after-statement -Wmissing-prototypes -DLINK_TO_ZLIB -DLINK_TO_LIBJPEG -D_FILE_OFFSET_BITS=64 -D__KERNEL_STRICT_NAMES -I../../../ -DCONFIG_MENU -DCONFIG_CD -DCONFIG_VIDEO_CAPTURE -pipe -march=native -Og -g -c ../../../dpsoftrast.c -o dpsoftrast.o -msse2 ../../../dpsoftrast.c:239:22: error: size of array element is not a multiple of its alignment 239 | typedef ALIGN(struct DPSOFTRAST_State_Thread_s | ^~~~~~~~~~~~~~~~~~~~~~~~~ ../../../dpsoftrast.c:45:36: note: in definition of macro ‘ALIGN’ 45 | #define ALIGN(var) var __attribute__((__aligned__(16))) ------------------------------------------------------------------- This is an unstable amd64 chroot image at a tinderbox (==build bot) name: 17.1_desktop_gnome_systemd-20210424-085324 ------------------------------------------------------------------- gcc-config -l: [1] x86_64-pc-linux-gnu-10.3.0 [2] x86_64-pc-linux-gnu-11.1.0 * clang version 12.0.0 Target: x86_64-pc-linux-gnu Thread model: posix InstalledDir: /usr/lib/llvm/12/bin /usr/lib/llvm/12 12.0.0 Python 3.8.9 Available Ruby profiles: [1] ruby26 (with Rubygems) [2] ruby30 (with Rubygems) * Available Rust versions: [1] rust-bin-1.51.0 * The following VMs are available for generation-2: *) AdoptOpenJDK 8.292_p10 [openjdk-bin-8] Available Java Virtual Machines: [1] openjdk-bin-8 system-vm The Glorious Glasgow Haskell Compilation System, version 8.10.4 timestamp(s) of HEAD at this tinderbox image: /var/db/repos/gentoo Wed Apr 28 05:05:32 UTC 2021 emerge -qpvO games-fps/darkplaces [ebuild N ] games-fps/darkplaces-20140513-r1 USE="alsa opengl sdl -cdinstall -cdsound -debug -dedicated -demo -lights -oss -textures"
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.