diff options
Diffstat (limited to 'src/qml/common')
| -rw-r--r-- | src/qml/common/qv4compileddata.cpp | 36 | ||||
| -rw-r--r-- | src/qml/common/qv4compileddata_p.h | 12 |
2 files changed, 5 insertions, 43 deletions
diff --git a/src/qml/common/qv4compileddata.cpp b/src/qml/common/qv4compileddata.cpp index 3959c0c2a5..9ce5f5058f 100644 --- a/src/qml/common/qv4compileddata.cpp +++ b/src/qml/common/qv4compileddata.cpp @@ -4,7 +4,6 @@ #include "qv4compileddata_p.h" #include <private/inlinecomponentutils_p.h> -#include <private/qml_compile_hash_p.h> #include <private/qqmlscriptdata_p.h> #include <private/qqmltypenamecache_p.h> #include <private/qv4resolvedtypereference_p.h> @@ -16,21 +15,6 @@ #include <QtCore/qstandardpaths.h> #include <QtCore/qxpfunctional.h> -static_assert(QV4::CompiledData::QmlCompileHashSpace > QML_COMPILE_HASH_LENGTH); - -#if defined(QML_COMPILE_HASH) && defined(QML_COMPILE_HASH_LENGTH) && QML_COMPILE_HASH_LENGTH > 0 -# ifdef Q_OS_LINUX -// Place on a separate section on Linux so it's easier to check from outside -// what the hash version is. -__attribute__((section(".qml_compile_hash"))) -# endif -const char qml_compile_hash[QV4::CompiledData::QmlCompileHashSpace] = QML_COMPILE_HASH; -static_assert(sizeof(QV4::CompiledData::Unit::libraryVersionHash) > QML_COMPILE_HASH_LENGTH, - "Compile hash length exceeds reserved size in data structure. Please adjust and bump the format version"); -#else -# error "QML_COMPILE_HASH must be defined for the build of QtDeclarative to ensure version checking for cache files" -#endif - QT_BEGIN_NAMESPACE namespace QV4 { @@ -50,12 +34,6 @@ bool Unit::verifyHeader(QDateTime expectedSourceTimeStamp, QString *errorString) return false; } - if (qtVersion != quint32(QT_VERSION)) { - *errorString = QString::fromUtf8("Qt version mismatch. Found %1 expected %2") - .arg(qtVersion, 0, 16).arg(QT_VERSION, 0, 16); - return false; - } - if (sourceTimeStamp) { // Files from the resource system do not have any time stamps, so fall back to the application // executable. @@ -69,20 +47,6 @@ bool Unit::verifyHeader(QDateTime expectedSourceTimeStamp, QString *errorString) } } -#if defined(QML_COMPILE_HASH) && defined(QML_COMPILE_HASH_LENGTH) && QML_COMPILE_HASH_LENGTH > 0 - if (qstrncmp(qml_compile_hash, libraryVersionHash, QML_COMPILE_HASH_LENGTH) != 0) { - *errorString = QStringLiteral("QML compile hashes don't match. Found %1 expected %2") - .arg(QString::fromLatin1( - QByteArray(libraryVersionHash, QML_COMPILE_HASH_LENGTH) - .toPercentEncoding()), - QString::fromLatin1( - QByteArray(qml_compile_hash, QML_COMPILE_HASH_LENGTH) - .toPercentEncoding())); - return false; - } -#else -#error "QML_COMPILE_HASH must be defined for the build of QtDeclarative to ensure version checking for cache files" -#endif return true; } diff --git a/src/qml/common/qv4compileddata_p.h b/src/qml/common/qv4compileddata_p.h index 46112c3034..889df101d0 100644 --- a/src/qml/common/qv4compileddata_p.h +++ b/src/qml/common/qv4compileddata_p.h @@ -51,7 +51,7 @@ QT_BEGIN_NAMESPACE // Also change the comment behind the number to describe the latest change. This has the added // benefit that if another patch changes the version too, it will result in a merge conflict, and // not get removed silently. -#define QV4_DATA_STRUCTURE_VERSION 0x44 // added a flag to mark properties as final from QML +#define QV4_DATA_STRUCTURE_VERSION 0x45 // Removed Qt version and compile hash checks class QIODevice; class QQmlTypeNameCache; @@ -1203,7 +1203,6 @@ struct QmlUnit }; static_assert(sizeof(QmlUnit) == 16, "QmlUnit structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); -enum { QmlCompileHashSpace = 48 }; static const char magic_str[] = "qv4cdata"; struct Unit @@ -1211,12 +1210,11 @@ struct Unit // DO NOT CHANGE THESE FIELDS EVER char magic[8]; quint32_le version; - quint32_le qtVersion; - qint64_le sourceTimeStamp; - quint32_le unitSize; // Size of the Unit and any depending data. // END DO NOT CHANGE THESE FIELDS EVER - char libraryVersionHash[QmlCompileHashSpace]; + quint32_le reserved; // For predictable alignment and size. Used to be Qt version. + qint64_le sourceTimeStamp; + quint32_le unitSize; // Size of the Unit and any depending data. char md5Checksum[16]; // checksum of all bytes following this field. char dependencyMD5Checksum[16]; @@ -1387,7 +1385,7 @@ struct Unit bool verifyHeader(QDateTime expectedSourceTimeStamp, QString *errorString) const; }; -static_assert(sizeof(Unit) == 248, "Unit structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); +static_assert(sizeof(Unit) == 200, "Unit structure needs to have the expected size to be binary compatible on disk when generated by host compiler and loaded by target"); struct TypeReference { |
