From b64e87f2ed6457b11594e9f4fc522860caa737ab Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Thu, 7 May 2015 13:10:13 +0200 Subject: [PATCH 1/3] Blacklist task256322_highlight on OS X The test keeps failing. The approach of sending mouse move events is inherently fragile due to the use of QCursor::setPos and the expectation that that produces the correct sequence of mouse move events. Change-Id: I07ec75460b70c27152e8775deffcb77fa9328d0c Reviewed-by: Simon Hausmann --- tests/auto/widgets/widgets/qmenubar/BLACKLIST | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 tests/auto/widgets/widgets/qmenubar/BLACKLIST diff --git a/tests/auto/widgets/widgets/qmenubar/BLACKLIST b/tests/auto/widgets/widgets/qmenubar/BLACKLIST new file mode 100644 index 0000000000..e8b4945495 --- /dev/null +++ b/tests/auto/widgets/widgets/qmenubar/BLACKLIST @@ -0,0 +1,2 @@ +[task256322_highlight] +osx From ace86dca159d50886be5bcff7abe72383cad9fde Mon Sep 17 00:00:00 2001 From: Friedemann Kleint Date: Thu, 7 May 2015 08:34:19 +0200 Subject: [PATCH 2/3] Revert "configure: Change default of CFG_REDUCE_RELOCATIONS to "no"." This reverts commit d0eba497c1c34d35ddda2b5d44902ebd636d4f9e. A better fix is to use -fPIC instead of just -fPIE fo -reduce-relocations. Task-number: QTBUG-45755 Change-Id: I1759291b684fd76d4009e4be9ba1354eb056e659 Reviewed-by: Simon Hausmann Reviewed-by: Thiago Macieira --- configure | 2 +- tools/configure/configureapp.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/configure b/configure index 15a75bbccd..6ce6753e3f 100755 --- a/configure +++ b/configure @@ -674,7 +674,7 @@ CFG_SSE4_1=auto CFG_SSE4_2=auto CFG_AVX=auto CFG_AVX2=auto -CFG_REDUCE_RELOCATIONS=no +CFG_REDUCE_RELOCATIONS=auto CFG_ACCESSIBILITY=auto CFG_ACCESSIBILITY_ATSPI_BRIDGE=no # will be enabled depending on dbus and accessibility being enabled CFG_NEON=auto diff --git a/tools/configure/configureapp.cpp b/tools/configure/configureapp.cpp index db0791b75c..6e9d4aa80b 100644 --- a/tools/configure/configureapp.cpp +++ b/tools/configure/configureapp.cpp @@ -1696,7 +1696,7 @@ void Configure::applySpecSpecifics() dictionary[ "LARGE_FILE" ] = "no"; dictionary[ "ANGLE" ] = "no"; dictionary[ "DYNAMICGL" ] = "no"; - dictionary[ "REDUCE_RELOCATIONS" ] = "no"; + dictionary[ "REDUCE_RELOCATIONS" ] = "yes"; dictionary[ "QT_GETIFADDRS" ] = "no"; dictionary[ "QT_XKBCOMMON" ] = "no"; dictionary["ANDROID_STYLE_ASSETS"] = "yes"; From 36d6eb721e7d5997ade75e289d4088dc48678d0d Mon Sep 17 00:00:00 2001 From: Thiago Macieira Date: Tue, 5 May 2015 08:43:42 -0700 Subject: [PATCH 3/3] 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 Reviewed-by: Oswald Buddenhagen --- 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 a149f4d907..e4ccbd7156 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 f529d7fc7b..8276316c3f 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 8119c8aa09..9190aa9f28 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 7213a844f5..48d5f21447 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\") !!IF !isEmpty(QT_NAMESPACE) list(APPEND Qt5Core_DEFINITIONS -DQT_NAMESPACE=$$QT_NAMESPACE) diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h index 455582e310..ef84662036 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 edb6488eaa..748cb82989 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);