summaryrefslogtreecommitdiffstats
path: root/src/corelib
diff options
context:
space:
mode:
authorThiago Macieira <thiago.macieira@intel.com>2015-05-28 11:21:35 -0700
committerThiago Macieira <thiago.macieira@intel.com>2015-05-29 00:08:36 +0000
commit95b6c4fed6521aa2212cab67cb8a6e5553e86117 (patch)
tree128bd9d8f6a239f7f85c5841990a550a0fb6327f /src/corelib
parent9d662d9d2f33d75d3fbf682ee9fadc291ecae5cb (diff)
Make qglobal.h only complain for GCC >= 5 about -fPIE
Commit 3eca75de67b3fd2c890715b30c7899cebc096fe9 introduced the #error nagging about use of -fPIE, but it makes the transition quite difficult for people using other buildsystems. So let's give people a grace period and enforce only for GCC >= 5. Clang is affected, but differently. The problem only happens with -flto -- that is, it happens when the linker detects that it's creating a final executable. Maybe -Wl,-pie would fix it. Change-Id: If4d5ac8db0ed4a84a3eaffff13e275edc29a72b7 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
Diffstat (limited to 'src/corelib')
-rw-r--r--src/corelib/global/qglobal.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/corelib/global/qglobal.h b/src/corelib/global/qglobal.h
index 4547877da6..d9742408a3 100644
--- a/src/corelib/global/qglobal.h
+++ b/src/corelib/global/qglobal.h
@@ -1047,7 +1047,8 @@ 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__) || (defined(__PIE__) && defined(Q_CC_GNU) && Q_CC_GNU >= 500))
# error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
"Compile your code with -fPIC (-fPIE is not enough)."
#endif