cryptopp/crc_simd.cpp:148:13: error: always_inline function '_mm_crc32_u8' requires target feature 'popcnt', but would be inlined into function 'CRC32C_Update_SSE42' that is compiled without support for 'popcnt'
c = _mm_crc32_u8(c, *s);
^
cryptopp/crc_simd.cpp:151:13: error: always_inline function '_mm_crc32_u32' requires target feature 'popcnt', but would be inlined into function 'CRC32C_Update_SSE42' that is compiled without support for 'popcnt'
c = _mm_crc32_u32(c, *(const word32 *)(void*)s);
^
/cryptopp/crc_simd.cpp:154:13: error: always_inline function '_mm_crc32_u8' requires target feature 'popcnt', but would be inlined into function 'CRC32C_Update_SSE42' that is compiled without support for 'popcnt'
c = _mm_crc32_u8(c, *s);
^
3 errors generated.
Source for the function is wrapped by CRYPTOPP_SSE42_AVAILABLE and that checks for CRYPTOPP_APPLE_CLANG_VERSION >= 40000.
However, compiler flags do not have SSE4.2 enabled by default:
crypto++8.0.0 release
macOS 10.14.2, Xcode 10.1 $ clang --version Apple LLVM version 10.0.0 (clang-1000.11.45.5) Target: x86_64-apple-darwin18.2.0
Cmake (from cryptopp-cmake project) static lib $ cmake --version cmake version 3.12.2
Building for macOS target. Not iPhone simulator.
Copied from weidei/cryptopp issue
crypto++7 built fine
Source for the function is wrapped by CRYPTOPP_SSE42_AVAILABLE and that checks for CRYPTOPP_APPLE_CLANG_VERSION >= 40000.
However, compiler flags do not have SSE4.2 enabled by default:
In Xcode this can be overrode with the "Enable Additional Vector Extensions" whose raw name is "CLANG_X86_VECTOR_INSTRUCTIONS".