Created attachment 734200 [details] build.log of x11-base/xwayland-21.1.2-r2 I have an experience compilation failed of x11-base/xwayland as below, This error looks similar to #467088 (This is xorg-server's bug). [230/419] x86_64-pc-linux-gnu-gcc -Irender/liblibxserver_render.a.p -Irender -I../xwayland-21.1.2/render -IXext -I../xwayland-21.1.2/Xext -IXi -I../xwayland-21.1.2/Xi -Icomposite -I../xwayland-21.1.2/composite -Idamageext -I../xwayland-21.1.2/damageext -Ifb -I../xwayland-21.1.2/fb -Iglamor -I../xwayland-21.1.2/glamor -Imi -I../xwayland-21.1.2/mi -Imiext/damage -I../xwayland-21.1.2/miext/damage -Imiext/sync -I../xwayland-21.1.2/miext/sync -Idbe -I../xwayland-21.1.2/dbe -Idri3 -I../xwayland-21.1.2/dri3 -Iinclude -I../xwayland-21.1.2/include -Ipresent -I../xwayland-21.1.2/present -Irandr -I../xwayland-21.1.2/randr -Ixfixes -I../xwayland-21.1.2/xfixes -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -DHAVE_DIX_CONFIG_H -fno-strict-aliasing -fvisibility=hidden -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -march=corei7 -O2 -pipe -msse4.1 -msse4.2 -mtune=generic -fPIC -pthread -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -MD -MQ render/liblibxserver_render.a.p/picture.c.o -MF render/liblibxserver_render.a.p/picture.c.o.d -o render/liblibxserver_render.a.p/picture.c.o -c ../xwayland-21.1.2/render/picture.c FAILED: render/liblibxserver_render.a.p/picture.c.o x86_64-pc-linux-gnu-gcc -Irender/liblibxserver_render.a.p -Irender -I../xwayland-21.1.2/render -IXext -I../xwayland-21.1.2/Xext -IXi -I../xwayland-21.1.2/Xi -Icomposite -I../xwayland-21.1.2/composite -Idamageext -I../xwayland-21.1.2/damageext -Ifb -I../xwayland-21.1.2/fb -Iglamor -I../xwayland-21.1.2/glamor -Imi -I../xwayland-21.1.2/mi -Imiext/damage -I../xwayland-21.1.2/miext/damage -Imiext/sync -I../xwayland-21.1.2/miext/sync -Idbe -I../xwayland-21.1.2/dbe -Idri3 -I../xwayland-21.1.2/dri3 -Iinclude -I../xwayland-21.1.2/include -Ipresent -I../xwayland-21.1.2/present -Irandr -I../xwayland-21.1.2/randr -Ixfixes -I../xwayland-21.1.2/xfixes -I/usr/include/pixman-1 -I/usr/include/freetype2 -I/usr/include/harfbuzz -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-4 -fdiagnostics-color=always -D_FILE_OFFSET_BITS=64 -Wall -Winvalid-pch -std=gnu99 -DHAVE_DIX_CONFIG_H -fno-strict-aliasing -fvisibility=hidden -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototypes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wunused -Wuninitialized -Wshadow -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implicit -Werror=nonnull -Werror=init-self -Werror=main -Werror=missing-braces -Werror=sequence-point -Werror=return-type -Werror=trigraphs -Werror=array-bounds -Werror=write-strings -Werror=address -Werror=int-to-pointer-cast -Werror=pointer-to-int-cast -march=corei7 -O2 -pipe -msse4.1 -msse4.2 -mtune=generic -fPIC -pthread -D_DEFAULT_SOURCE -D_BSD_SOURCE -DHAS_FCHOWN -DHAS_STICKY_DIR_BIT -MD -MQ render/liblibxserver_render.a.p/picture.c.o -MF render/liblibxserver_render.a.p/picture.c.o.d -o render/liblibxserver_render.a.p/picture.c.o -c ../xwayland-21.1.2/render/picture.c ../xwayland-21.1.2/render/picture.c: In function ‘CreateSolidPicture’: ../xwayland-21.1.2/render/picture.c:874:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[16]’ [-Werror=array-bounds] 874 | pPicture->pSourcePict->type = SourcePictTypeSolidFill; | ^~ ../xwayland-21.1.2/render/picture.c:868:45: note: object of size 16 allocated by ‘malloc’ 868 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictSolidFill)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../xwayland-21.1.2/render/picture.c: In function ‘CreateLinearGradientPicture’: ../xwayland-21.1.2/render/picture.c:906:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] 906 | pPicture->pSourcePict->linear.type = SourcePictTypeLinear; | ^~ ../xwayland-21.1.2/render/picture.c:899:45: note: object of size 32 allocated by ‘malloc’ 899 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictLinearGradient)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ../xwayland-21.1.2/render/picture.c: In function ‘CreateConicalGradientPicture’: ../xwayland-21.1.2/render/picture.c:989:26: error: array subscript ‘union _SourcePict[0]’ is partly outside array bounds of ‘unsigned char[32]’ [-Werror=array-bounds] 989 | pPicture->pSourcePict->conical.type = SourcePictTypeConical; | ^~ ../xwayland-21.1.2/render/picture.c:982:45: note: object of size 32 allocated by ‘malloc’ 982 | pPicture->pSourcePict = (SourcePictPtr) malloc(sizeof(PictConicalGradient)); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ cc1: some warnings being treated as errors 1) above error log is attached as build.log in this report, 2) emerge --info log is also attached as emerge_info.log and I would like to suggest patch to address this problem as below, I am not sure whether this solution is optimal or not. 3) xwayland-werror-array-bounds.patch Thank you in advance for reviewing my bug report and patch.
Created attachment 734203 [details] emerge --info
Created attachment 734206 [details, diff] patch for blocking build of xwayland-21.1.2-r2
> CFLAGS="-march=corei7 ... -mtune=generic" Just a heads up: I don't think this makes any sense. You're asking GCC to use instructions that only corei7 has but then to tune the code for a generic CPU. I suspect you got those reversed.
Might be https://gitlab.freedesktop.org/xorg/xserver/-/issues/1256
Looks fixed in current releases.