devbean / QtCipherSqlitePlugin

A Qt plugin for cipher SQLite.
http://qtciphersqliteplugin.galaxyworld.org
GNU Lesser General Public License v2.1
380 stars 155 forks source link

error: inlining failed in call to always_inline '_mm_aesimc_si128': target specific option mismatch #48

Open luppiterw opened 2 years ago

luppiterw commented 2 years ago
E:\Applications\Qt\Tools\mingw730_64\lib\gcc\x86_64-w64-mingw32\7.3.0\include\wmmintrin.h:77: error: inlining failed in call to always_inline '_mm_aesimc_si128': target specific option mismatch
 _mm_aesimc_si128 (__m128i __X)
 ^~~~~~~~~~~~~~~~

E:/Applications/Qt/Tools/mingw730_64/lib/gcc/x86_64-w64-mingw32/7.3.0/include/wmmintrin.h:77:1: error: inlining failed in call to always_inline '_mm_aesimc_si128': target specific option mismatch
 _mm_aesimc_si128 (__m128i __X)
 ^~~~~~~~~~~~~~~~
D:\Projects\GithubProjects\QtCipherSqlitePlugin\sqlitecipher\sqlite3\sqlite3mc_amalgamation.c:254177:26: note: called from here
         keySchedule[j] = _mm_aesimc_si128(tempKeySchedule[j]);
                          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
mingw32-make[2]: *** [Makefile.Debug:300: .obj/debug/sqlite3mc_amalgamation.o] Error 1

SOS! How can I handle this error?

devbean commented 2 years ago

Which version of Qt? Qt 5 or Qt 6?

dfaure-kdab commented 3 months ago

I'm having the same error message when building with my own buildsystem which doesn't pass -march=native like sqlitecipher.pro does. However AFAIU that flag can be problematic (code built on my machine might not run on a machine with an older CPU), so it would be better to use something like -march=core-avx2 which sets the bar much lower in terms of CPU requirement, no? I'm not 100% sure what the right flag would be, actually.

dfaure-kdab commented 3 months ago

Actually, I used the script from https://stackoverflow.com/questions/43128698/inlining-failed-in-call-to-always-inline-mm-mullo-epi32-target-specific-opti and it says the right flags are -maes -msse4.1.

_mm_aesimc_si128 requires -maes and _mm_extract_epi32 requires -msse4.1 (at least on gcc/linux).