There's a known upstream bug in gcc-5.1 causing compilation failures when an always_inline function uses memcpy. Reproducible: Always Steps to Reproduce: 1. emerge -v1 xf86-video-intel Actual Results: libtool: compile: x86_64-pc-linux-gnu-gcc -DHAVE_CONFIG_H -I. -I/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna -I../.. -Wall -Wpointer-arith -Wmissing-declarations -Wformat=2 -Wstrict-prototy pes -Wmissing-prototypes -Wnested-externs -Wbad-function-cast -Wold-style-definition -Wdeclaration-after-statement -Wunused -Wuninitialized -Wshadow -Wcast-qual -Wmissing-noreturn -Wmissing-format-attribute -Wredundant-decls -Werror=implic it -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 -fno-strict-aliasing -I/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src -I/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/render_program -fvisibil ity=hidden -I/usr/include/xorg -I/usr/include/X11/dri -I/usr/include/libdrm -I/usr/include/pixman-1 -I/usr/include/libdrm -Wno-cast-qual -Wno-redundant-decls -Wno-maybe-uninitialized -Os -mtune=generic -pipe -c /var/tmp/portage/x11-drivers /xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna_display_fake.c -fPIC -DPIC -o .libs/sna_display_fake.o In file included from /usr/include/features.h:366:0, from /usr/include/stdint.h:25, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/stdint.h:9, from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna.h:40, from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:32: /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c: In function ‘memcpy_from_tiled_x__swizzle_9_11’: /usr/include/bits/string3.h:48:1: error: inlining failed in call to always_inline ‘memcpy’: optimization level attribute mismatch __NTH (memcpy (void *__restrict __dest, const void *__restrict __src, ^ /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:720:4: error: called from here memcpy(dst_row, (const char *)src + offset, length * cpp); ^ In file included from /usr/include/features.h:366:0, from /usr/include/stdint.h:25, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/stdint.h:9, from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna.h:40, from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:32: /usr/include/bits/string3.h:48:1: error: inlining failed in call to always_inline ‘memcpy’: optimization level attribute mismatch __NTH (memcpy (void *__restrict __dest, const void *__restrict __src, ^ /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:732:4: error: called from here memcpy(dst_row, (const char *)src + offset, 64); ^ In file included from /usr/include/features.h:366:0, from /usr/include/stdint.h:25, from /usr/lib/gcc/x86_64-pc-linux-gnu/5.1.0/include/stdint.h:9, from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna.h:40, from /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:32: /usr/include/bits/string3.h:48:1: error: inlining failed in call to always_inline ‘memcpy’: optimization level attribute mismatch __NTH (memcpy (void *__restrict __dest, const void *__restrict __src, ^ /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/blt.c:743:4: error: called from here memcpy(dst_row, (const char *)src + offset, x); ^ Makefile:638: recipe for target 'blt.lo' failed make[4]: *** [blt.lo] Error 1 make[4]: *** Waiting for unfinished jobs.... /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna_accel.c: In function ‘sna_poly_zero_line_blt’: /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna_accel.c:9128:11: warning: variable ‘intersects’ set but not used [-Wunused-but-set-variable] bool intersects; ^ /var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917/src/sna/sna_accel.c:9028:7: warning: variable ‘degenerate’ set but not used [-Wunused-but-set-variable] bool degenerate = true; ^ make[4]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build/src/sna' Makefile:653: recipe for target 'all-recursive' failed make[3]: *** [all-recursive] Error 1 make[3]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build/src/sna' Makefile:598: recipe for target 'all-recursive' failed make[2]: *** [all-recursive] Error 1 make[2]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build/src' Makefile:468: recipe for target 'all-recursive' failed make[1]: *** [all-recursive] Error 1 make[1]: Leaving directory '/var/tmp/portage/x11-drivers/xf86-video-intel-2.99.917/work/xf86-video-intel-2.99.917_build' Makefile:399: recipe for target 'all' failed make: *** [all] Error 2 Expected Results: >>> x11-drivers/xf86-video-intel-2.99.917 merged. Not actually expecting this issue to be fixed here, since it's a regression in gcc-5.1. Reporting it just for reference.
Workaround from https://gcc.gnu.org/bugzilla/show_bug.cgi?id=65873#c10 applies cleanly and seems to work - xf86-video-intel compiles and seems to work properly.
*** Bug 551328 has been marked as a duplicate of this bug. ***
Created attachment 405140 [details, diff] PR65873 Make it easier for those who wish to use it now.
Well, for a quick solution, compile xf86-video-intel with -O0. It compiled were well, although -O0 is not a proper solution. ( for anyone that doesnt want to recompile gcc )
I'm not able to apply this patch, has anybody else had success with it?
This should be fixed with gcc-5.2.0.