diff --git a/src/corelib/global/qcompilerdetection.h b/src/corelib/global/qcompilerdetection.h index 6d8d426688..0099fdd201 100644 --- a/src/corelib/global/qcompilerdetection.h +++ b/src/corelib/global/qcompilerdetection.h @@ -1277,9 +1277,14 @@ static_assert(!std::is_convertible_v, #if defined(QT_BOOTSTRAPPED) || defined(QT_USE_PROTECTED_VISIBILITY) || !defined(__ELF__) || defined(__PIC__) // this is fine +#elif defined(__PIE__) +# error "-fPIE is not sufficient if Qt was configured with the -DFEATURE_reduce_relocations=ON "\ + "CMake option. Compile your code with -fPIC and without -fPIE or compile Qt with "\ + "-DFEATURE_no_direct_extern_access=ON." #elif defined(QT_REDUCE_RELOCATIONS) -# error "You must build your code with position independent code if Qt was configured with -reduce-relocations. "\ - "Compile your code with -fPIC (and not with -fPIE)." +# error "You must build your code with position independent code if Qt was configured with the "\ + "-DFEATURE_reduce_relocations=ON CMake option. Compile your code with -fPIC and "\ + "without -fPIE or compile Qt with -DFEATURE_no_direct_extern_access=ON." #endif #ifdef Q_PROCESSOR_X86_32