Skip to content

Commit 349e74c

Browse files
author
Sona Kurazyan
committed
Move the check for -fPIC compile flag to qcompilerdetection.h
Task-number: QTBUG-99313 Change-Id: I9072b73a75599381f5f2be0799bca5bf149122de Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
1 parent ff8de32 commit 349e74c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/corelib/global/qcompilerdetection.h

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1203,4 +1203,11 @@ static_assert(!std::is_convertible_v<std::nullptr_t, bool>,
12031203
"On MSVC you must pass the /permissive- option to the compiler.");
12041204
#endif
12051205

1206+
#if defined(QT_BOOTSTRAPPED) || defined(QT_USE_PROTECTED_VISIBILITY) || !defined(__ELF__) || defined(__PIC__)
1207+
// this is fine
1208+
#elif defined(QT_REDUCE_RELOCATIONS)
1209+
# error "You must build your code with position independent code if Qt was configured with -reduce-relocations. "\
1210+
"Compile your code with -fPIC (and not with -fPIE)."
1211+
#endif
1212+
12061213
#endif // QCOMPILERDETECTION_H

src/corelib/global/qglobal.h

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1227,13 +1227,6 @@ Q_CORE_EXPORT int qEnvironmentVariableIntValue(const char *varName, bool *ok=nu
12271227

12281228
#define QT_MODULE(x)
12291229

1230-
#if defined(QT_BOOTSTRAPPED) || defined(QT_USE_PROTECTED_VISIBILITY) || !defined(__ELF__) || defined(__PIC__)
1231-
// this is fine
1232-
#elif defined(QT_REDUCE_RELOCATIONS)
1233-
# error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
1234-
"Compile your code with -fPIC (and not with -fPIE)."
1235-
#endif
1236-
12371230
// This macro can be used to calculate member offsets for types with a non standard layout.
12381231
// It uses the fact that offsetof() is allowed to support those types since C++17 as an optional
12391232
// feature. All our compilers do support this, but some issue a warning, so we wrap the offsetof()

0 commit comments

Comments
 (0)