diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/qml/CMakeLists.txt | 1 | ||||
| -rw-r--r-- | src/qml/common/qv4compileddata.cpp | 36 | ||||
| -rw-r--r-- | src/qml/common/qv4compileddata_p.h | 12 | ||||
| -rw-r--r-- | src/qml/compiler/qv4compiler.cpp | 3 |
4 files changed, 5 insertions, 47 deletions
diff --git a/src/qml/CMakeLists.txt b/src/qml/CMakeLists.txt index bd02dd1376..c0ea99b5fa 100644 --- a/src/qml/CMakeLists.txt +++ b/src/qml/CMakeLists.txt @@ -521,7 +521,6 @@ set_source_files_properties(compat/removed_api.cpp # "" #) -qt_declarative_write_tag_header(Qml) set(_qt_qlalr_flags "--no-debug" "--qt") qt_process_qlalr(Qml "${CMAKE_CURRENT_SOURCE_DIR}/parser/qqmljs.g" "${_qt_qlalr_flags}") qt_declarative_generate_reg_exp_jit_tables(Qml) 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 { diff --git a/src/qml/compiler/qv4compiler.cpp b/src/qml/compiler/qv4compiler.cpp index 7a7c8f621b..ad1390a650 100644 --- a/src/qml/compiler/qv4compiler.cpp +++ b/src/qml/compiler/qv4compiler.cpp @@ -9,7 +9,6 @@ #include <private/qv4alloca_p.h> #include <private/qqmljslexer_p.h> #include <private/qqmljsast_p.h> -#include <private/qml_compile_hash_p.h> #include <private/qqmlirbuilder_p.h> #include <QCryptographicHash> #include <QtEndian> @@ -632,8 +631,6 @@ QV4::CompiledData::Unit QV4::Compiler::JSUnitGenerator::generateHeader(QV4::Comp unit.flags = QV4::CompiledData::Unit::IsJavascript; unit.flags |= module->unitFlags; unit.version = QV4_DATA_STRUCTURE_VERSION; - unit.qtVersion = QT_VERSION; - qstrcpy(unit.libraryVersionHash, QML_COMPILE_HASH); memset(unit.md5Checksum, 0, sizeof(unit.md5Checksum)); memset(unit.dependencyMD5Checksum, 0, sizeof(unit.dependencyMD5Checksum)); |
