From 1e9c41f8f5478d0044dc3dd5443bc9df2640febc Mon Sep 17 00:00:00 2001 From: Gerasim Troeglazov <3dEyes@gmail.com> Date: Thu, 14 Jun 2018 00:22:33 +1000 Subject: [PATCH] QtWebKit: fix segfaults when built with GCC 7 --- .../patches/qtwebkit-5.212.0~alpha2.patchset | 51 +++++++++++++++++++ .../qtwebkit/qtwebkit-5.212.0~alpha2.recipe | 2 +- 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/dev-qt/qtwebkit/patches/qtwebkit-5.212.0~alpha2.patchset b/dev-qt/qtwebkit/patches/qtwebkit-5.212.0~alpha2.patchset index 725ee1e0b..f61375ea6 100644 --- a/dev-qt/qtwebkit/patches/qtwebkit-5.212.0~alpha2.patchset +++ b/dev-qt/qtwebkit/patches/qtwebkit-5.212.0~alpha2.patchset @@ -1250,3 +1250,54 @@ index 0fcd4df..6672ce3 100644 -- 2.16.4 + +From a36365c33c489c8fe5b44f1bfa62a23cbd9e7fc5 Mon Sep 17 00:00:00 2001 +From: Gerasim Troeglazov <3dEyes@gmail.com> +Date: Wed, 13 Jun 2018 21:24:48 +1000 +Subject: WTF::StringImpl::copyChars segfaults when built with GCC 7 + + +diff --git a/Source/WTF/wtf/text/StringImpl.h b/Source/WTF/wtf/text/StringImpl.h +index 5781c1c..a1be756 100644 +--- a/Source/WTF/wtf/text/StringImpl.h ++++ b/Source/WTF/wtf/text/StringImpl.h +@@ -619,25 +619,7 @@ public: + *destination = *source; + return; + } +- +- if (numCharacters <= s_copyCharsInlineCutOff) { +- unsigned i = 0; +-#if (CPU(X86) || CPU(X86_64)) +- const unsigned charsPerInt = sizeof(uint32_t) / sizeof(T); +- +- if (numCharacters > charsPerInt) { +- unsigned stopCount = numCharacters & ~(charsPerInt - 1); +- +- const uint32_t* srcCharacters = reinterpret_cast(source); +- uint32_t* destCharacters = reinterpret_cast(destination); +- for (unsigned j = 0; i < stopCount; i += charsPerInt, ++j) +- destCharacters[j] = srcCharacters[j]; +- } +-#endif +- for (; i < numCharacters; ++i) +- destination[i] = source[i]; +- } else +- memcpy(destination, source, numCharacters * sizeof(T)); ++ memcpy(destination, source, numCharacters * sizeof(T)); + } + + ALWAYS_INLINE static void copyChars(UChar* destination, const LChar* source, unsigned numCharacters) +@@ -855,9 +837,6 @@ private: + return *tailPointer(); + } + +- // This number must be at least 2 to avoid sharing empty, null as well as 1 character strings from SmallStrings. +- static const unsigned s_copyCharsInlineCutOff = 20; +- + enum class CaseConvertType { Upper, Lower }; + template static Ref convertASCIICase(StringImpl&, const CharacterType*, unsigned); + +-- +2.16.4 + diff --git a/dev-qt/qtwebkit/qtwebkit-5.212.0~alpha2.recipe b/dev-qt/qtwebkit/qtwebkit-5.212.0~alpha2.recipe index b943b142c..5a60ed168 100644 --- a/dev-qt/qtwebkit/qtwebkit-5.212.0~alpha2.recipe +++ b/dev-qt/qtwebkit/qtwebkit-5.212.0~alpha2.recipe @@ -10,7 +10,7 @@ HOMEPAGE="https://github.com/annulen/webkit" COPYRIGHT="2015-2017 The Qt Company Ltd." LICENSE="GNU LGPL v2.1 GNU LGPL v3" -REVISION="11" +REVISION="12" SOURCE_URI="https://github.com/annulen/webkit/releases/download/qtwebkit-${portVersion/\~/-}/qtwebkit-${portVersion/\~/-}.tar.xz" CHECKSUM_SHA256="f8f901de567e11fc5659402b6b827eac75505ff9c5072d8e919aa306003f8f8a" SOURCE_DIR="qtwebkit-${portVersion/\~/-}"