ebiggers / libdeflate

Heavily optimized library for DEFLATE/zlib/gzip compression and decompression

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

BUILD: target specific option mismatch

goodpaperman opened this issue · comments

see detail:
transmission/transmission#6820

version 1.20, back to 1.18 can pass compile, what's wrong..

/ext/tools/gcc-8.2/lib/gcc/x86_64-pc-linux-gnu/8.2.0/include/vpclmulqdqintrin.h:90:1: error: inlining failed in call to always_inline ‘_mm256_clmulepi64_epi128’: target specific option mismatch
_mm256_clmulepi64_epi128 (__m256i __A, __m256i __B, const int __C)

It looks like the problem is that gcc 8.2 has a bug where it assumes that the 256-bit wide vpclmulqdq (carryless multiplication) intrinsic depends on AVX512 support. In fact, it should only depend on AVX. This was fixed in gcc 9.1 (gcc-mirror/gcc@a62fd9d) and backported to gcc 8.3 (gcc-mirror/gcc@8604d90). This fix was merged over 5 years ago.

To avoid this bug, I'll make libdeflate only build crc32_x86_vpclmulqdq_avx2() if gcc is 8.3 or later (if the compiler is gcc), instead of 8.1 or later as it currently does.

As always I would also encourage you to upgrade your compiler. It's free!

#373 should fix this by disabling some of the optimized CRC-32 code with gcc 8.1 and gcc 8.2.

Thanks a million