QtCipherSqlitePlugin
QtCipherSqlitePlugin copied to clipboard
Do not build with Qt 5.15 and Qt 6.2.1/6.2.4
After this commit "3a3ca590 Trim option values." everything crashed when building it. Before it evrything ok for Qt 5.15
I have this troubles on MacOS with Qt 5.15 and Qt 6.2.1.
/Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250606:34: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes temp = _mm_extract_epi32(_mm_aeskeygenassist_si128(_mm_setr_epi32(0, temp, 0, 0), 0), 1); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/__wmmintrin_aes.h:136:12: note: expanded from macro '_mm_aeskeygenassist_si128' (__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R)) ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250611:34: error: '__builtin_ia32_aeskeygenassist128' needs target feature aes temp = _mm_extract_epi32(_mm_aeskeygenassist_si128(_mm_setr_epi32(0, temp, 0, 0), 0), 0); ^ /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/lib/clang/12.0.0/include/__wmmintrin_aes.h:136:12: note: expanded from macro '_mm_aeskeygenassist_si128' (__m128i)__builtin_ia32_aeskeygenassist128((__v2di)(__m128i)(C), (int)(R)) ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250665:26: error: always_inline function '_mm_aesimc_si128' requires target feature 'aes', but would be inlined into function 'aesGenKeyDecrypt' that is compiled without support for 'aes' keySchedule[j] = _mm_aesimc_si128(tempKeySchedule[j]); ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250714:18: error: always_inline function '_mm_aesenc_si128' requires target feature 'aes', but would be inlined into function 'aesEncryptCBC' that is compiled without support for 'aes' feedback = _mm_aesenc_si128(feedback, key[j]); ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250716:16: error: always_inline function '_mm_aesenclast_si128' requires target feature 'aes', but would be inlined into function 'aesEncryptCBC' that is compiled without support for 'aes' feedback = _mm_aesenclast_si128(feedback, key[j]); ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250737:18: error: always_inline function '_mm_aesenc_si128' requires target feature 'aes', but would be inlined into function 'aesEncryptCBC' that is compiled without support for 'aes' feedback = _mm_aesenc_si128(feedback, key[j]); ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250739:16: error: always_inline function '_mm_aesenclast_si128' requires target feature 'aes', but would be inlined into function 'aesEncryptCBC' that is compiled without support for 'aes' feedback = _mm_aesenclast_si128(feedback, key[j]); ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250786:14: error: always_inline function '_mm_aesdec_si128' requires target feature 'aes', but would be inlined into function 'aesDecryptCBC' that is compiled without support for 'aes' data = _mm_aesdec_si128(data, key[numberOfRounds - j]); ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250788:12: error: always_inline function '_mm_aesdeclast_si128' requires target feature 'aes', but would be inlined into function 'aesDecryptCBC' that is compiled without support for 'aes' data = _mm_aesdeclast_si128(data, key[numberOfRounds - j]); ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250801:14: error: always_inline function '_mm_aesdec_si128' requires target feature 'aes', but would be inlined into function 'aesDecryptCBC' that is compiled without support for 'aes' data = _mm_aesdec_si128(data, key[numberOfRounds - j]); ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250803:12: error: always_inline function '_mm_aesdeclast_si128' requires target feature 'aes', but would be inlined into function 'aesDecryptCBC' that is compiled without support for 'aes' data = _mm_aesdeclast_si128(data, key[numberOfRounds - j]); ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250827:14: error: always_inline function '_mm_aesdec_si128' requires target feature 'aes', but would be inlined into function 'aesDecryptCBC' that is compiled without support for 'aes' data = _mm_aesdec_si128(data, key[numberOfRounds - j]); ^ /Users/alexandr/Tools/QtCipherSqlitePlugin/sqlitecipher/sqlite3/sqlite3mc_amalgamation.c:250829:12: error: always_inline function '_mm_aesdeclast_si128' requires target feature 'aes', but would be inlined into function 'aesDecryptCBC' that is compiled without support for 'aes' data = _mm_aesdeclast_si128(data, key[numberOfRounds - j]);
@alexandrkirilov Add -maes
option to your compiler flags.
Check the last line of sqlitecipher/sqlitecipher.pro
.
I've just got it working for MacOS with:
macos { QMAKE_CFLAGS += -march=native } QMAKE_CFLAGS += -maes
Added to sqlitecipher/sqlitecipher.pro
file
For iOS need to make trick with SDK. There are trouble with sys/random.h
It's not presented in iOS SDK, but it presented in MacOS SDK. Just copy this file from MacOS SDK include/sys
folder to iOS SDK folder include/sys
.
For iOS build this piece of code QMAKE_CFLAGS += -march=native
should be disabled
You should be building for DEBUG and RELEASE separately. It's not working for both of them like previous version.
For Android:
-- when you build it with QtCreator it ends with error, but all built OK
-- when you trying to run make install
like in previous version it's got failed, you need just copy the plugin file manually into Android QT plugin directory
But plugin itself working on device.
All of versions built with Qt 6.2.3 on MacOS Catalina
I have commented #include <sys/random.h>
for iOS and it works too.
Could you please make a pull request to fix this problem?
Could you please make a pull request to fix this problem?
What do you mean?
I mean if you could make a pull request about what you change? Just add macos { QMAKE_CFLAGS += -march=native } QMAKE_CFLAGS += -maes
to sqlitecipher/sqlitecipher.pro
is enough?
I mean if you could make a pull request about what you change? Just add
macos { QMAKE_CFLAGS += -march=native } QMAKE_CFLAGS += -maes
tosqlitecipher/sqlitecipher.pro
is enough?
Sure I could. Contact me in private. But this commit won't be solving all of troubles that connected to iOS and Android. There are few steps that should be done manually outside of your plugin. I could show how it works for and we can try find solution that can automate building process of your plugin. BTW- it's great job you done!
Forgotten to add for Qt 5.15.8 all is working perfectly without any tricks for any platform.
Just tested with Qt 6.2.4 All is working with previous commentaries. But make install
working now for all platforms.
Qt 6.6.1
/Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:96: error: static_assert failed due to requirement 'is_complete<sqlite3, void>::value' "Pointer Meta Types must either point to fully-defined types or be declared with Q_DECLARE_OPAQUE_POINTER(T *)"
In file included from /Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:40:
In file included from /Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/QCoreApplication:1:
In file included from /Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qcoreapplication.h:11:
In file included from /Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qeventloop.h:7:
In file included from /Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qobject.h:18:
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qmetatype.h:1189:13: error: static_assert failed due to requirement 'is_complete<sqlite3, void>::value' "Pointer Meta Types must either point to fully-defined types or be declared with Q_DECLARE_OPAQUE_POINTER(T *)"
static_assert(is_complete<Pointed, void>::value,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:96:1: note: in instantiation of function template specialization 'QtPrivate::checkTypeIsSuitableForMetaType<sqlite3 >' requested here
Q_DECLARE_METATYPE(sqlite3)
^
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qmetatype.h:1504:34: note: expanded from macro 'Q_DECLARE_METATYPE'
#define Q_DECLARE_METATYPE(TYPE) Q_DECLARE_METATYPE_IMPL(TYPE)
^
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qmetatype.h:1511:34: note: expanded from macro 'Q_DECLARE_METATYPE_IMPL'
static_assert(QtPrivate::checkTypeIsSuitableForMetaType<TYPE>());
^
/Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:97: error: static_assert failed due to requirement 'is_complete<sqlite3_stmt, void>::value' "Pointer Meta Types must either point to fully-defined types or be declared with Q_DECLARE_OPAQUE_POINTER(T *)"
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qmetatype.h:1189:13: error: static_assert failed due to requirement 'is_complete<sqlite3_stmt, void>::value' "Pointer Meta Types must either point to fully-defined types or be declared with Q_DECLARE_OPAQUE_POINTER(T *)"
static_assert(is_complete<Pointed, void>::value,
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:97:1: note: in instantiation of function template specialization 'QtPrivate::checkTypeIsSuitableForMetaType<sqlite3_stmt >' requested here
Q_DECLARE_METATYPE(sqlite3_stmt)
^
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qmetatype.h:1504:34: note: expanded from macro 'Q_DECLARE_METATYPE'
#define Q_DECLARE_METATYPE(TYPE) Q_DECLARE_METATYPE_IMPL(TYPE)
^
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qmetatype.h:1511:34: note: expanded from macro 'Q_DECLARE_METATYPE_IMPL'
static_assert(QtPrivate::checkTypeIsSuitableForMetaType<TYPE>());
^
/Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:99: error: explicit specialization of 'QtPrivate::IsPointerDeclaredOpaque<sqlite3 *>' after instantiation
/Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:99:1: error: explicit specialization of 'QtPrivate::IsPointerDeclaredOpaque<sqlite3 >' after instantiation
Q_DECLARE_OPAQUE_POINTER(sqlite3)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qmetatype.h:1498:24: note: expanded from macro 'Q_DECLARE_OPAQUE_POINTER'
template <> struct IsPointerDeclaredOpaque<POINTER>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qmetatype.h:1187:48: note: implicit instantiation first required here
if constexpr (std::is_pointer_v<T> && !IsPointerDeclaredOpaque<T>::value) {
^
/Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:100: error: explicit specialization of 'QtPrivate::IsPointerDeclaredOpaque<sqlite3_stmt *>' after instantiation
/Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:100:1: error: explicit specialization of 'QtPrivate::IsPointerDeclaredOpaque<sqlite3_stmt >' after instantiation
Q_DECLARE_OPAQUE_POINTER(sqlite3_stmt)
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qmetatype.h:1498:24: note: expanded from macro 'Q_DECLARE_OPAQUE_POINTER'
template <> struct IsPointerDeclaredOpaque<POINTER>
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qmetatype.h:1187:48: note: implicit instantiation first required here
if constexpr (std::is_pointer_v<T> && !IsPointerDeclaredOpaque<T>::value) {
^
/Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:1372: warning: 'qAsConst<QList<SQLiteResult *>>' is deprecated: Use std::as_const() instead. [-Wdeprecated-declarations]
/Users/jk/Downloads/QtCipherSqlitePlugin-1.3/sqlitecipher/sqlitecipher.cpp:1372:28: warning: 'qAsConst<QList<SQLiteResult *>>' is deprecated: Use std::as_const() instead. [-Wdeprecated-declarations]
for (auto result : qAsConst(d->results)) {
^
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qttypetraits.h:32:1: note: 'qAsConst<QList<SQLiteResult *>>' has been explicitly marked deprecated here
QT_DEPRECATED_VERSION_X_6_6("Use std::as_const() instead.")
^
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qtdeprecationmarkers.h:175:44: note: expanded from macro 'QT_DEPRECATED_VERSION_X_6_6'
define QT_DEPRECATED_VERSION_X_6_6(text) QT_DEPRECATED_X(text)
^
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qtdeprecationmarkers.h:27:33: note: expanded from macro 'QT_DEPRECATED_X'
define QT_DEPRECATED_X(text) Q_DECL_DEPRECATED_X(text)
^
/Users/jk/Applications/Qt/6.6.1/macos/lib/QtCore.framework/Headers/qcompilerdetection.h:985:36: note: expanded from macro 'Q_DECL_DEPRECATED_X'
define Q_DECL_DEPRECATED_X(x) [[deprecated(x)]]
^
:-1: error: [sqlitecipher.o] Error 1