Hi All,
I'm trying to compile flac-1.3.2 on a gentoo system with gcc 5.4.0.
Whn compiling without LTO, the compilation ends without errors, while when enabling lto flag, the compilation stops with a lot of errors like this:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/immintrin.h:41:0,
from /var/tmp/portage/media-libs/flac-1.3.2/work/flac-1.3.2/src/libFLAC/lpc_intrin_avx2.c:48:
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/avxintrin.h:894:1: error: inlining failed in call to always_inline ‘_mm256_loadu_si256’: target specific option mismatch
_mm256_loadu_si256 (__m256i const *__P)
or:
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/immintrin.h:41:0,
from /var/tmp/portage/media-libs/flac-1.3.2/work/flac-1.3.2/src/libFLAC/lpc_intrin_avx2.c:48:
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/avxintrin.h:900:1: error: inlining failed in call to always_inline ‘_mm256_storeu_si256’: target specific option mismatch
_mm256_storeu_si256 (__m256i *__P, __m256i __A)
Not really a big deal as the compilation is ok without LTO feature enabled, but maybe this can be an useful info for developers.
If more info is needed, just let me know.
Cheers,
Fabio.
How are you configuring this? Or more specifically, how are you enabling LTO?
This is an excerpt from compilation logs. If you like, I can post the whole log from compilation:
libtool: compile: x86_64-pc-linux-gnu-gcc -m32 -DHAVE_CONFIG_H -I. -I/var/tmp/portage/media-libs/flac-1.3.2/work/flac-1.3.2/src/libFLAC -I../.. -I../.. -I/var/tmp/portage/media-libs/flac-1.3.2/work/flac-1.3.2/src/libFLAC/include -I/var/tmp/portage/media-libs/flac-1.3.2/work/flac-1.3.2/include -DDEBUG -DFLAC__USE_VISIBILITY_ATTR -O2 -fpic -pipe -march=native -fstack-protector-strong -flto=4 -fuse-linker-plugin -Wall -Wextra -Wstrict-prototypes -Wmissing-prototypes -Waggregate-return -Wcast-align -Wnested-externs -Wshadow -Wundef -Wmissing-declarations -Winline -Wdeclaration-after-statement -fvisibility=hidden -msse2 -c /var/tmp/portage/media-libs/flac-1.3.2/work/flac-1.3.2/src/libFLAC/stream_decoder.c -fPIC -DPIC -o .libs/stream_decoder.o
In file included from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/xmmintrin.h:1249:0,
from /usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/immintrin.h:29,
from /var/tmp/portage/media-libs/flac-1.3.2/work/flac-1.3.2/src/libFLAC/lpc_intrin_avx2.c:48:
/var/tmp/portage/media-libs/flac-1.3.2/work/flac-1.3.2/src/libFLAC/lpc_intrin_avx2.c: In function ‘FLAC__lpc_compute_residual_from_qlp_coefficients_16_intrin_avx2’:
/usr/lib/gcc/x86_64-pc-linux-gnu/5.4.0/include/emmintrin.h:1497:1: error: inlining failed in call to always_inline ‘_mm_cvtsi32_si128’: target specific option mismatch
_mm_cvtsi32_si128 (int __A)
Sorry, that's not what I ased for. Once you have the extracted the code from the tarball, how do you start the build process to enable LTO?
Looks like a compiler bug.
Probably related:
https://bugs.freedesktop.org/show_bug.cgi?id=77580
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=71991
Last edit: lvqcl 2017-01-05