Created attachment 408940 [details] build.log While the new masked compiler is able to compile this xorg-server version, it can't build it with LTO enabled. I am using binutils-9999 (git version) and GCC 5.2. /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/xkb/xkbInit.c:731:22: warning: type of 'XkbDfltAccessXOptions' does not match original declaration extern unsigned char XkbDfltAccessXOptions; ^ /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/xkb/xkbAccessX.c:58:16: note: previously declared here unsigned short XkbDfltAccessXOptions = ^ /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/events.c: In function 'XineramaConfineCursorToWindow': /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/events.c:615:13: warning: iteration 2147483647 invokes undefined behavior [-Waggressive-loop-optimizations] while (i--) { ^ /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/events.c:615:11: note: containing loop while (i--) { ^ /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/events.c:611:49: error: array subscript is below array bounds [-Werror=array-bounds] RegionCopy(&pSprite->Reg1, &pSprite->windows[i]->borderSize); ^ /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/events.c:612:31: error: array subscript is below array bounds [-Werror=array-bounds] off_x = screenInfo.screens[i]->x; ^ /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/events.c:616:39: error: array subscript is below array bounds [-Werror=array-bounds] x = off_x - screenInfo.screens[i]->x; ^ /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/events.c:623:38: error: array subscript is below array bounds [-Werror=array-bounds] &pSprite->windows[i]->borderSize); ^ /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/events.c:625:35: error: array subscript is below array bounds [-Werror=array-bounds] off_x = screenInfo.screens[i]->x; ^ /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/ptrveloc.c: In function 'AccelSetProfileProperty': /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/ptrveloc.c:204:13: warning: 'profile' may be used uninitialized in this function [-Wmaybe-uninitialized] if (GetAccelerationProfile(vel, profile) == NULL) ^ /tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2/dix/ptrveloc.c:188:9: note: 'profile' was declared here int profile, *ptr = &profile; ^ LTRANS statistics [LTRANS] read 492229 SCCs of average size 1.636370 [LTRANS] 805469 tree bodies read in total [LTRANS] # of input files: 324 [LTRANS] # of input cgraph nodes: 6263 [LTRANS] # of function bodies: 1795 [LTRANS] Size of mmap'd section decls: 11223261 bytes [LTRANS] Size of mmap'd section function_body: 2677122 bytes [LTRANS] Size of mmap'd section statics: 0 bytes [LTRANS] Size of mmap'd section symtab: 0 bytes [LTRANS] Size of mmap'd section refs: 42734 bytes [LTRANS] Size of mmap'd section asm: 0 bytes [LTRANS] Size of mmap'd section jmpfuncs: 303003 bytes [LTRANS] Size of mmap'd section pureconst: 17525 bytes [LTRANS] Size of mmap'd section reference: 0 bytes [LTRANS] Size of mmap'd section profile: 6358 bytes [LTRANS] Size of mmap'd section symbol_nodes: 242135 bytes [LTRANS] Size of mmap'd section opts: 0 bytes [LTRANS] Size of mmap'd section cgraphopt: 0 bytes [LTRANS] Size of mmap'd section inline: 248507 bytes [LTRANS] Size of mmap'd section ipcp_trans: 0 bytes [LTRANS] Size of mmap'd section icf: 51157 bytes [LTRANS] Size of mmap'd section offload_table: 0 bytes [LTRANS] Size of mmap'd section mode_table: 0 bytes lto1: some warnings being treated as errors lto-wrapper: fatal error: /usr/x86_64-pc-linux-gnu/gcc-bin/5.2.0/x86_64-pc-linux-gnu-gcc returned 1 exit status compilation terminated. /usr/lib/gcc/x86_64-pc-linux-gnu/5.2.0/../../../../x86_64-pc-linux-gnu/bin/ld: fatal error: lto-wrapper failed collect2: error: ld returned 1 exit status Makefile:1057: recipe for target 'xtest' failed make[3]: *** [xtest] Error 1 make[3]: Leaving directory '/tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2_build/test' Makefile:1123: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2_build/test' Makefile:955: recipe for target 'all' failed make[1]: *** [all] Error 2 make[1]: Leaving directory '/tmp/portage/x11-base/xorg-server-1.17.2/work/xorg-server-1.17.2_build/test' Makefile:771: recipe for target 'all-recursive' failed make: *** [all-recursive] Error 1
Created attachment 408942 [details] emerge --info
I have a similar issue with gcc 5.1, on amd64 with -O3, but with "array above upper bound" warnings being treated like errors, also xorg-server-1.17.2. Switching to -O2 alleviates it.
(In reply to hellohellodon from comment #2) > I have a similar issue with gcc 5.1, on amd64 with -O3, but with "array > above upper bound" warnings being treated like errors, also > xorg-server-1.17.2. Switching to -O2 alleviates it. I am using -O2 if that matters
The only bug here is that we're still building with -Werror 3 and a half years after bug #416069 was opened.
Fixed by commit 6aaaf15f8882dd112d22454600294e37969fa822 Author: Matt Turner <mattst88@gentoo.org> Date: Sun Jan 29 11:30:39 2017 -0800 xorg-2.eclass: Use --disable-selective-werror.