diff options
author | Florian Bruhin <git@the-compiler.org> | 2015-05-11 10:27:29 +0200 |
---|---|---|
committer | Florian Bruhin <git@the-compiler.org> | 2015-05-11 10:27:29 +0200 |
commit | 9622b7e1fae47adbe15134751731eb4476b93681 (patch) | |
tree | 35bb1ed69b83a702ff2f30862cfa50357af505e5 | |
parent | 5ca403372fdf5dc66a5af5dc378dab5961baca10 (diff) | |
download | qt-debug-pkgbuild-9622b7e1fae47adbe15134751731eb4476b93681.tar.gz qt-debug-pkgbuild-9622b7e1fae47adbe15134751731eb4476b93681.zip |
Update Qt to arch -6
-rw-r--r-- | qt5/0001-Require-fPIC-instead-of-just-fPIE-for-reduce-relocat.patch | 130 | ||||
-rw-r--r-- | qt5/0001-Revert-Rotate-images-according-to-Exif-orientation.patch | 290 | ||||
-rw-r--r-- | qt5/PKGBUILD | 14 |
3 files changed, 432 insertions, 2 deletions
diff --git a/qt5/0001-Require-fPIC-instead-of-just-fPIE-for-reduce-relocat.patch b/qt5/0001-Require-fPIC-instead-of-just-fPIE-for-reduce-relocat.patch new file mode 100644 index 0000000..b0acd03 --- /dev/null +++ b/qt5/0001-Require-fPIC-instead-of-just-fPIE-for-reduce-relocat.patch @@ -0,0 +1,130 @@ +From 36d6eb721e7d5997ade75e289d4088dc48678d0d Mon Sep 17 00:00:00 2001 +From: Thiago Macieira <thiago.macieira@intel.com> +Date: Tue, 5 May 2015 08:43:42 -0700 +Subject: [PATCH] Require -fPIC instead of just -fPIE for -reduce-relocations + +GCC 5 combined with a recent binutils have a new optimization that +allows them to generate copy relocations even in -fPIE code. Clang has +the same functionality when compiling an executable with -flto. We need +to let the compilers know that they cannot use copy relocations, so they +need to use really position-independent code. + +Position independent code throughout is not really required. We just +need the compilers to use position-independent access to symbols coming +from the Qt libraries, but there's currently no other way of doing that. + +Task-number: QTBUG-45755 +Change-Id: I0d4913955e3745b69672ffff13db5df7377398c5 +Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> +Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> +--- + mkspecs/common/gcc-base.conf | 2 +- + mkspecs/common/qcc-base.conf | 2 +- + mkspecs/linux-icc/qmake.conf | 2 +- + src/corelib/Qt5CoreConfigExtras.cmake.in | 2 +- + src/corelib/global/qglobal.h | 4 ++-- + tests/auto/tools/moc/tst_moc.cpp | 6 +++--- + 6 files changed, 9 insertions(+), 9 deletions(-) + +diff --git a/mkspecs/common/gcc-base.conf b/mkspecs/common/gcc-base.conf +index a149f4d..e4ccbd7 100644 +--- a/mkspecs/common/gcc-base.conf ++++ b/mkspecs/common/gcc-base.conf +@@ -42,7 +42,7 @@ QMAKE_CFLAGS_RELEASE += $$QMAKE_CFLAGS_OPTIMIZE + QMAKE_CFLAGS_DEBUG += -g + QMAKE_CFLAGS_SHLIB += -fPIC + QMAKE_CFLAGS_STATIC_LIB += -fPIC +-QMAKE_CFLAGS_APP += -fPIE ++QMAKE_CFLAGS_APP += -fPIC + QMAKE_CFLAGS_ISYSTEM = -isystem + QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses + QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden +diff --git a/mkspecs/common/qcc-base.conf b/mkspecs/common/qcc-base.conf +index f529d7f..8276316 100644 +--- a/mkspecs/common/qcc-base.conf ++++ b/mkspecs/common/qcc-base.conf +@@ -23,7 +23,7 @@ QMAKE_CFLAGS_RELEASE_WITH_DEBUGINFO += $$QMAKE_CFLAGS_OPTIMIZE -g + QMAKE_CFLAGS_DEBUG += -g + QMAKE_CFLAGS_SHLIB += -fPIC -shared + QMAKE_CFLAGS_STATIC_LIB += -fPIC +-QMAKE_CFLAGS_APP += -fPIE ++QMAKE_CFLAGS_APP += -fPIC + QMAKE_CFLAGS_YACC += -Wno-unused -Wno-parentheses + QMAKE_CFLAGS_HIDESYMS += -fvisibility=hidden + QMAKE_CFLAGS_SSE2 += -msse2 +diff --git a/mkspecs/linux-icc/qmake.conf b/mkspecs/linux-icc/qmake.conf +index 8119c8a..9190aa9 100644 +--- a/mkspecs/linux-icc/qmake.conf ++++ b/mkspecs/linux-icc/qmake.conf +@@ -12,7 +12,7 @@ QMAKE_LEXFLAGS = + QMAKE_YACC = yacc + QMAKE_YACCFLAGS = -d + QMAKE_CFLAGS = +-QMAKE_CFLAGS_APP = -fPIE ++QMAKE_CFLAGS_APP = -fPIC + QMAKE_CFLAGS_DEPS = -M + QMAKE_CFLAGS_WARN_ON = -w1 -Wall -Wcheck -wd1572,873,2259,2261 + QMAKE_CFLAGS_WARN_OFF = -w +diff --git a/src/corelib/Qt5CoreConfigExtras.cmake.in b/src/corelib/Qt5CoreConfigExtras.cmake.in +index 7213a84..48d5f21 100644 +--- a/src/corelib/Qt5CoreConfigExtras.cmake.in ++++ b/src/corelib/Qt5CoreConfigExtras.cmake.in +@@ -71,7 +71,7 @@ set(_qt5_corelib_extra_includes) + # macro to add it. + set(Qt5_POSITION_INDEPENDENT_CODE True) + set_property(TARGET Qt5::Core PROPERTY INTERFACE_POSITION_INDEPENDENT_CODE \"ON\") +-set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIE\") ++set(Qt5Core_EXECUTABLE_COMPILE_FLAGS \"-fPIC\") + !!ENDIF + + !!IF !isEmpty(QT_NAMESPACE) +diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h +index 455582e..ef84662 100644 +--- a/src/corelib/global/qglobal.h ++++ b/src/corelib/global/qglobal.h +@@ -1047,9 +1047,9 @@ Q_CORE_EXPORT int qrand(); + # define QT_NO_SHAREDMEMORY + #endif + +-#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && !defined(__PIC__) && !defined(__PIE__) ++#if !defined(QT_BOOTSTRAPPED) && defined(QT_REDUCE_RELOCATIONS) && defined(__ELF__) && !defined(__PIC__) + # error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\ +- "Compile your code with -fPIC or -fPIE." ++ "Compile your code with -fPIC." + #endif + + namespace QtPrivate { +diff --git a/tests/auto/tools/moc/tst_moc.cpp b/tests/auto/tools/moc/tst_moc.cpp +index edb6488..748cb82 100644 +--- a/tests/auto/tools/moc/tst_moc.cpp ++++ b/tests/auto/tools/moc/tst_moc.cpp +@@ -662,7 +662,7 @@ void tst_Moc::oldStyleCasts() + + QStringList args; + args << "-c" << "-x" << "c++" << "-Wold-style-cast" << "-I" << "." +- << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIE" << "-"; ++ << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-"; + proc.start("gcc", args); + QVERIFY(proc.waitForStarted()); + proc.write(mocOut); +@@ -732,7 +732,7 @@ void tst_Moc::inputFileNameWithDotsButNoExtension() + + QStringList args; + args << "-c" << "-x" << "c++" << "-I" << ".." +- << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIE" << "-"; ++ << "-I" << qtIncludePath << "-o" << "/dev/null" << "-fPIC" << "-"; + proc.start("gcc", args); + QVERIFY(proc.waitForStarted()); + proc.write(mocOut); +@@ -1011,7 +1011,7 @@ void tst_Moc::ignoreOptionClashes() + // If -pthread wasn't ignored, it was parsed as a prefix of "thread/", which breaks compilation. + QStringList gccArgs; + gccArgs << "-c" << "-x" << "c++" << "-I" << ".." +- << "-I" << qtIncludePath << "-I" << includeDir << "-o" << "/dev/null" << "-fPIE" << "-"; ++ << "-I" << qtIncludePath << "-I" << includeDir << "-o" << "/dev/null" << "-fPIC" << "-"; + proc.start("gcc", gccArgs); + QVERIFY(proc.waitForStarted()); + proc.write(mocOut); +-- +2.3.6 + diff --git a/qt5/0001-Revert-Rotate-images-according-to-Exif-orientation.patch b/qt5/0001-Revert-Rotate-images-according-to-Exif-orientation.patch new file mode 100644 index 0000000..0b1756d --- /dev/null +++ b/qt5/0001-Revert-Rotate-images-according-to-Exif-orientation.patch @@ -0,0 +1,290 @@ +From 518f886b6128331ce47932edd637471d58d0d877 Mon Sep 17 00:00:00 2001 +From: Rainer Keller <rainer.keller@theqtcompany.com> +Date: Fri, 17 Apr 2015 10:43:19 +0200 +Subject: [PATCH] Revert "Rotate images according to Exif orientation" + +Due to a behavior change. + +This reverts commit 9157087334186ff3ef811f2ec234a3bf5d4a4889. +This reverts commit 16c32c6dfbca03a46d1a2bb87b6c1c365e6179d5. + +Task-number: QTBUG-37946 +Task-number: QTBUG-45552 +Task-number: QTBUG-43563 +Change-Id: Idf8df7d8f22465e8f6b51acb68993ac97208b184 +Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> +Reviewed-by: Gunnar Sletta <gunnar@sletta.org> +--- + src/gui/image/qjpeghandler.cpp | 150 +---------------------------- + tests/auto/gui/image/qimage/tst_qimage.cpp | 33 ------- + 2 files changed, 1 insertion(+), 182 deletions(-) + +diff --git a/src/gui/image/qjpeghandler.cpp b/src/gui/image/qjpeghandler.cpp +index 9cf9947..14c8b4c 100644 +--- a/src/gui/image/qjpeghandler.cpp ++++ b/src/gui/image/qjpeghandler.cpp +@@ -726,7 +726,7 @@ public: + }; + + QJpegHandlerPrivate(QJpegHandler *qq) +- : quality(75), exifOrientation(1), iod_src(0), state(Ready), q(qq) ++ : quality(75), iod_src(0), state(Ready), q(qq) + {} + + ~QJpegHandlerPrivate() +@@ -741,10 +741,8 @@ public: + + bool readJpegHeader(QIODevice*); + bool read(QImage *image); +- void applyExifOrientation(QImage *image); + + int quality; +- int exifOrientation; + QVariant size; + QImage::Format format; + QSize scaledSize; +@@ -762,97 +760,6 @@ public: + QJpegHandler *q; + }; + +-static bool readExifHeader(QDataStream &stream) +-{ +- char prefix[6]; +- if (stream.readRawData(prefix, sizeof(prefix)) != sizeof(prefix)) +- return false; +- if (prefix[0] != 'E' || prefix[1] != 'x' || prefix[2] != 'i' || prefix[3] != 'f' || prefix[4] != 0 || prefix[5] != 0) +- return false; +- return true; +-} +- +-/* +- * Returns -1 on error +- * Returns 0 if no Exif orientation was found +- * Returns 1 orientation is horizontal (normal) +- * Returns 2 mirror horizontal +- * Returns 3 rotate 180 +- * Returns 4 mirror vertical +- * Returns 5 mirror horizontal and rotate 270 CCW +- * Returns 6 rotate 90 CW +- * Returns 7 mirror horizontal and rotate 90 CW +- * Returns 8 rotate 270 CW +- */ +-static int getExifOrientation(QByteArray &exifData) +-{ +- QDataStream stream(&exifData, QIODevice::ReadOnly); +- +- if (!readExifHeader(stream)) +- return -1; +- +- quint16 val; +- quint32 offset; +- +- // read byte order marker +- stream >> val; +- if (val == 0x4949) // 'II' == Intel +- stream.setByteOrder(QDataStream::LittleEndian); +- else if (val == 0x4d4d) // 'MM' == Motorola +- stream.setByteOrder(QDataStream::BigEndian); +- else +- return -1; // unknown byte order +- +- // read size +- stream >> val; +- if (val != 0x2a) +- return -1; +- +- stream >> offset; +- // we have already used 8 bytes of TIFF header +- offset -= 8; +- +- // read IFD +- while (!stream.atEnd()) { +- quint16 numEntries; +- +- // skip offset bytes to get the next IFD +- if (stream.skipRawData(offset) != (qint32)offset) +- return -1; +- +- stream >> numEntries; +- +- for (;numEntries > 0; --numEntries) { +- quint16 tag; +- quint16 type; +- quint32 components; +- quint16 value; +- quint16 dummy; +- +- stream >> tag >> type >> components >> value >> dummy; +- if (tag == 0x0112) { // Tag Exif.Image.Orientation +- if (components !=1) +- return -1; +- if (type != 3) // we are expecting it to be an unsigned short +- return -1; +- if (value < 1 || value > 8) // check for valid range +- return -1; +- +- // It is possible to include the orientation multiple times. +- // Right now the first value is returned. +- return value; +- } +- } +- +- // read offset to next IFD +- stream >> offset; +- if (offset == 0) // this is the last IFD +- break; +- } +- +- // No Exif orientation was found +- return 0; +-} + /*! + \internal + */ +@@ -872,7 +779,6 @@ bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device) + + if (!setjmp(err.setjmp_buffer)) { + jpeg_save_markers(&info, JPEG_COM, 0xFFFF); +- jpeg_save_markers(&info, JPEG_APP0+1, 0xFFFF); // Exif uses APP1 marker + + (void) jpeg_read_header(&info, TRUE); + +@@ -884,8 +790,6 @@ bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device) + format = QImage::Format_Invalid; + read_jpeg_format(format, &info); + +- QByteArray exifData; +- + for (jpeg_saved_marker_ptr marker = info.marker_list; marker != NULL; marker = marker->next) { + if (marker->marker == JPEG_COM) { + QString key, value; +@@ -903,18 +807,9 @@ bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device) + description += key + QLatin1String(": ") + value.simplified(); + readTexts.append(key); + readTexts.append(value); +- } else if (marker->marker == JPEG_APP0+1) { +- exifData.append((const char*)marker->data, marker->data_length); + } + } + +- if (exifData.size()) { +- // Exif data present +- int orientation = getExifOrientation(exifData); +- if (orientation > 0) +- exifOrientation = orientation; +- } +- + state = ReadHeader; + return true; + } +@@ -928,48 +823,6 @@ bool QJpegHandlerPrivate::readJpegHeader(QIODevice *device) + return true; + } + +-void QJpegHandlerPrivate::applyExifOrientation(QImage *image) +-{ +- // This is not an optimized implementation, but easiest to maintain +- QTransform transform; +- +- switch (exifOrientation) { +- case 1: // normal +- break; +- case 2: // mirror horizontal +- *image = image->mirrored(true, false); +- break; +- case 3: // rotate 180 +- transform.rotate(180); +- *image = image->transformed(transform); +- break; +- case 4: // mirror vertical +- *image = image->mirrored(false, true); +- break; +- case 5: // mirror horizontal and rotate 270 CCW +- *image = image->mirrored(true, false); +- transform.rotate(270); +- *image = image->transformed(transform); +- break; +- case 6: // rotate 90 CW +- transform.rotate(90); +- *image = image->transformed(transform); +- break; +- case 7: // mirror horizontal and rotate 90 CW +- *image = image->mirrored(true, false); +- transform.rotate(90); +- *image = image->transformed(transform); +- break; +- case 8: // rotate 270 CW +- transform.rotate(-90); +- *image = image->transformed(transform); +- break; +- default: +- qWarning("This should never happen"); +- } +- exifOrientation = 1; +-} +- + bool QJpegHandlerPrivate::read(QImage *image) + { + if(state == Ready) +@@ -981,7 +834,6 @@ bool QJpegHandlerPrivate::read(QImage *image) + if (success) { + for (int i = 0; i < readTexts.size()-1; i+=2) + image->setText(readTexts.at(i), readTexts.at(i+1)); +- applyExifOrientation(image); + + state = Ready; + return true; +diff --git a/tests/auto/gui/image/qimage/tst_qimage.cpp b/tests/auto/gui/image/qimage/tst_qimage.cpp +index 309d3a8..33302ed 100644 +--- a/tests/auto/gui/image/qimage/tst_qimage.cpp ++++ b/tests/auto/gui/image/qimage/tst_qimage.cpp +@@ -173,9 +173,6 @@ private slots: + void invertPixelsRGB_data(); + void invertPixelsRGB(); + +- void exifOrientation_data(); +- void exifOrientation(); +- + void cleanupFunctions(); + + private: +@@ -2649,36 +2646,6 @@ void tst_QImage::invertPixelsRGB() + QCOMPARE(qBlue(pixel) >> 4, (255 - 96) >> 4); + } + +-void tst_QImage::exifOrientation_data() +-{ +- QTest::addColumn<QString>("fileName"); +- QTest::newRow("Orientation 1, Intel format") << m_prefix + "jpeg_exif_orientation_value_1.jpg"; +- QTest::newRow("Orientation 2, Intel format") << m_prefix + "jpeg_exif_orientation_value_2.jpg"; +- QTest::newRow("Orientation 3, Intel format") << m_prefix + "jpeg_exif_orientation_value_3.jpg"; +- QTest::newRow("Orientation 4, Intel format") << m_prefix + "jpeg_exif_orientation_value_4.jpg"; +- QTest::newRow("Orientation 5, Intel format") << m_prefix + "jpeg_exif_orientation_value_5.jpg"; +- QTest::newRow("Orientation 6, Intel format") << m_prefix + "jpeg_exif_orientation_value_6.jpg"; +- QTest::newRow("Orientation 6, Motorola format") << m_prefix + "jpeg_exif_orientation_value_6_motorola.jpg"; +- QTest::newRow("Orientation 7, Intel format") << m_prefix + "jpeg_exif_orientation_value_7.jpg"; +- QTest::newRow("Orientation 8, Intel format") << m_prefix + "jpeg_exif_orientation_value_8.jpg"; +-} +- +-void tst_QImage::exifOrientation() +-{ +- QFETCH(QString, fileName); +- +- QImage img; +- QRgb px; +- +- QVERIFY(img.load(fileName)); +- +- px = img.pixel(0, 0); +- QVERIFY(qRed(px) > 250 && qGreen(px) < 5 && qBlue(px) < 5); +- +- px = img.pixel(img.width() - 1, 0); +- QVERIFY(qRed(px) < 5 && qGreen(px) < 5 && qBlue(px) > 250); +-} +- + static void cleanupFunction(void* info) + { + bool *called = static_cast<bool*>(info); +-- +2.3.6 + diff --git a/qt5/PKGBUILD b/qt5/PKGBUILD index 9c0a900..c50a011 100644 --- a/qt5/PKGBUILD +++ b/qt5/PKGBUILD @@ -1,4 +1,4 @@ -# $Id: PKGBUILD 238550 2015-05-06 14:38:05Z fyan $ +# $Id: PKGBUILD 238860 2015-05-10 08:32:12Z foutrelis $ # Maintainer: Felix Yan <felixonmars@archlinux.org> # Contributor: Andrea Scarpino <andrea@archlinux.org> @@ -28,7 +28,7 @@ pkgname=('qt5-base' 'qt5-x11extras' 'qt5-xmlpatterns') pkgver=5.4.1 -pkgrel=5 +pkgrel=6 arch=('i686' 'x86_64') url='http://qt-project.org/' license=('GPL3' 'LGPL' 'FDL' 'custom') @@ -42,8 +42,12 @@ makedepends=('libxcb' 'xcb-proto' 'xcb-util' 'xcb-util-image' 'xcb-util-wm' 'xcb groups=('qt' 'qt5') _pkgfqn="qt-everywhere-opensource-src-${pkgver}" source=("http://download.qt-project.org/official_releases/qt/${pkgver%.*}/${pkgver}/single/${_pkgfqn}.tar.xz" + '0001-Revert-Rotate-images-according-to-Exif-orientation.patch' + '0001-Require-fPIC-instead-of-just-fPIE-for-reduce-relocat.patch' 'assistant.desktop' 'designer.desktop' 'linguist.desktop' 'qdbusviewer.desktop' 'glib-2.43.patch' 'qlockfile-deadlock.patch' 'qnam-corruption.patch') md5sums=('7afb5f9235d8d42b5b6e832442a32a5d' + 'fb1459f325a15b15b18afeac51173a1d' + 'ac8fa252868161c676d876b614e24436' 'b2897dd6a2967bccf8f10e397aafee55' '76e150b20178d2d43801f7367232e5f7' '188da8f4c87316e730ebf1c6217bf5a0' @@ -55,6 +59,12 @@ md5sums=('7afb5f9235d8d42b5b6e832442a32a5d' prepare() { cd ${_pkgfqn} + # https://bugreports.qt.io/browse/QTBUG-37946 + (cd qtbase; patch -p1 -i "$srcdir/0001-Revert-Rotate-images-according-to-Exif-orientation.patch") + + # https://bugreports.qt.io/browse/QTBUG-45755 + (cd qtbase; patch -p1 -i "$srcdir/0001-Require-fPIC-instead-of-just-fPIE-for-reduce-relocat.patch") + # for glib 2.43+ https://bugreports.qt.io/browse/QTBUG-44714 (cd qtwebkit; patch -p1 -i "$srcdir/glib-2.43.patch") |