When building libjpeg-turbo for qemuppc, gcc encounters an internal compiler error: | powerpc-oe-linux-libtool: compile: powerpc-oe-linux-gcc -m32 -mhard-float -mcpu=7400 -mno-spe --sysroot=/ala-lpggp22/rmacleod/src/distro/yocto/b/ljp/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.1-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I../../libjpeg-turbo-1.5.1/simd -I.. -I../../libjpeg-turbo-1.5.1 -Wall -maltivec -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/ala-lpggp22/rmacleod/src/distro/yocto/b/ljp/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.1-r0=/usr/src/debug/libjpeg-turbo/1_1.5.1-r0 -fdebug-prefix-map=/ala-lpggp22/rmacleod/src/distro/yocto/b/ljp/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.1-r0/recipe-sysroot-native= -fdebug-prefix-map=/ala-lpggp22/rmacleod/src/distro/yocto/b/ljp/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.1-r0/recipe-sysroot= -c ../../libjpeg-turbo-1.5.1/simd/jdcolor-altivec.c -fPIC -DPIC -o .libs/libsimd_altivec_la-jdcolor-altivec.o | In file included from ../../libjpeg-turbo-1.5.1/simd/jdcolor-altivec.c:42:0: | ../../libjpeg-turbo-1.5.1/simd/jdcolext-altivec.c: In function 'jsimd_ycc_rgb_convert_altivec': | ../../libjpeg-turbo-1.5.1/simd/jdcolext-altivec.c:222:17: internal compiler error: Segmentation fault | edgeh = vec_ld(min(num_cols - 1, RGB_PIXELSIZE * 16), outptr); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | In file included from ../../libjpeg-turbo-1.5.1/simd/jdmerge-altivec.c:42:0: | ../../libjpeg-turbo-1.5.1/simd/jdmrgext-altivec.c: In function 'jsimd_h2v1_merged_upsample_altivec': | ../../libjpeg-turbo-1.5.1/simd/jdmrgext-altivec.c:247:17: internal compiler error: Segmentation fault | edgeh = vec_ld(min(num_cols - 1, RGB_PIXELSIZE * 16), outptr); | ~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | Please submit a full bug report, | with preprocessed source if appropriate. | See <https://gcc.gnu.org/bugs/> for instructions. | Makefile:626: recipe for target 'libsimd_altivec_la-jdcolor-altivec.lo' failed | make[3]: *** [libsimd_altivec_la-jdcolor-altivec.lo] Error 1 | make[3]: *** Waiting for unfinished jobs.... | Please submit a full bug report, | with preprocessed source if appropriate. | See <https://gcc.gnu.org/bugs/> for instructions. | Makefile:633: recipe for target 'libsimd_altivec_la-jdmerge-altivec.lo' failed | make[3]: *** [libsimd_altivec_la-jdmerge-altivec.lo] Error 1 | make[3]: Leaving directory '/ala-lpggp22/rmacleod/src/distro/yocto/b/ljp/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.1-r0/build/simd' | Makefile:480: recipe for target 'all' failed | make[2]: *** [all] Error 2
I have used creduce to generate a remarkably small reproducer: $ cat testcase.i jsimd_ycc_extbgrx_convert_altivec_outptr; __attribute__ ( ( altivec ( __builtin_vec_ld ( 1, jsimd_ycc_extbgrx_convert_altivec_outptr ) -------------------------------------------- Using this script: $ cat check.sh #!/bin/sh # gcc -c -O -Wfatal-errors $1 2>&1 | grep 'internal compiler error' set -x TESTCASE=${1:-testcase.i} powerpc-oe-linux-gcc -Wfatal-errors -m32 -mhard-float -mcpu=7400 -mno-spe -Wall -Wextra --sysroot=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.2-r0/recipe-sysroot -DHAVE_CONFIG_H -I. -I/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.2-r0/libjpeg-turbo-1.5.2/simd -I/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.2-r0/libjpeg-turbo-1.5.2 -I../../libjpeg-turbo-1.5.2 -Wall -maltivec -O2 -pipe -g -feliminate-unused-debug-types -fdebug-prefix-map=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.2-r0=/usr/src/debug/libjpeg-turbo/1_1.5.2-r0 -fdebug-prefix-map=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.2-r0/recipe-sysroot-native= -fdebug-prefix-map=/buildarea/rmacleod/src/distro/yocto/b/sd-ppc/tmp-glibc/work/ppc7400-oe-linux/libjpeg-turbo/1_1.5.2-r0/recipe-sysroot= -fPIC -DPIC -o .libs/libsimd_altivec_la-jdcolor-altivec.o -c testcase.i 2>&1 | grep 'internal compiler error:' if ! test $? = 0; then exit 1 fi exit 0 --------------- then: $ creduce check.sh testcase.i where testcase.i is initially the preprocessor output generated by the compiler command line in the initial bug report with the -save-temps flag used.
The bug also seems to still occur with the snapshot of the upcoming 7.1.1 release: gcc-7.1.1.inc:RELEASE = "7-20170629" using the gcc-7.1.1 recipes that I put together. I was able to build core-image-minimal and the right bits appear to be downloaded and patched without any changes to the existing list of patches. I'll report the bug upstream once my account has been enabled.
Created attachment 3858 [details] gcc: Update to 7.1.1 pre-release Patch attached in case anyone else wants to confirm or work with the newer version of the toolchain.
gcc defect: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=81317
The GCC devs has committed a fix upstream, I'll be testing it this week.
The test fixed one of the minimal reproducers that I found but not the main bug. I've tested with gcc-7.2 and the problem and the functionally identical stacktrace remain. I've updated the gcc defect.
The gcc dev can't reproduce this bug and I haven't heard of anyone other than me encountering the error so it makes sense to push it to 2.5. We may get the Wind River toolchain team to work on it but they are not available at the moment.
A local toolchain expert has started working on this defect.
We have a fix but I need to test it and get it upstream.
Works for me on the thud and master branches. The toolchain patches that I had didn't apply to the older branch since people updated the toolchain to fix spectre/meltdown bugs. If this error affects you, and you can reproduce it using poky, please re-open the defect.