@lbartoletti This breaks the build for me on Ubuntu 16.04 with
Run Build Command:"/usr/bin/make" "cmTC_3b936/fast"
make[1] : on entre dans le répertoire « /home/even/qgis/QGIS/build/CMakeFiles/CMakeTmp »
/usr/bin/make -f CMakeFiles/cmTC_3b936.dir/build.make CMakeFiles/cmTC_3b936.dir/build
make[2] : on entre dans le répertoire « /home/even/qgis/QGIS/build/CMakeFiles/CMakeTmp »
Building CXX object CMakeFiles/cmTC_3b936.dir/qcaossl.cpp.o
/usr/bin/c++ -I/usr/include/x86_64-linux-gnu/qt5 -I/usr/include/x86_64-linux-gnu/qt5/QtCore -I/usr/lib/x86_64-linux-gnu/qt5/mkspecs/linux-g++-64 -I/usr/include/Qca-qt5/QtCrypto -fPIE -std=gnu++11 -o CMakeFiles/cmTC_3b936.dir/qcaossl.cpp.o -c /home/even/qgis/QGIS/build/CMakeFiles/CMakeTmp/qcaossl.cpp
In file included from /usr/include/x86_64-linux-gnu/qt5/QtCore/qchar.h:37:0,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/qstring.h:41,
from /usr/include/x86_64-linux-gnu/qt5/QtCore/QString:1,
from /usr/include/Qca-qt5/QtCrypto/qca_core.h:36,
from /usr/include/Qca-qt5/QtCrypto/qca.h:36,
from /usr/include/Qca-qt5/QtCrypto/QtCrypto:1,
from /home/even/qgis/QGIS/build/CMakeFiles/CMakeTmp/qcaossl.cpp:2:
/usr/include/x86_64-linux-gnu/qt5/QtCore/qglobal.h:1067:4: error: #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)."
# error "You must build your code with position independent code if Qt was built with -reduce-relocations. "\
^
CMakeFiles/cmTC_3b936.dir/build.make:65 : la recette pour la cible « CMakeFiles/cmTC_3b936.dir/qcaossl.cpp.o » a échouée
make[2]: *** [CMakeFiles/cmTC_3b936.dir/qcaossl.cpp.o] Erreur 1
make[2] : on quitte le répertoire « /home/even/qgis/QGIS/build/CMakeFiles/CMakeTmp »
Makefile:126 : la recette pour la cible « cmTC_3b936/fast » a échouée
make[1]: *** [cmTC_3b936/fast] Erreur 2
make[1] : on quitte le répertoire « /home/even/qgis/QGIS/build/CMakeFiles/CMakeTmp »
CMake Error at cmake/QCAMacros.cmake:62 (message):
QCA OpenSSL plugin not found (run-time/unit-test dependency)
Call Stack (most recent call first):
CMakeLists.txt:361 (FIND_QCAOSSL_PLUGIN_CPP)
Reverting it makes the build work again.
Apparently the issue is due to -DCMAKE_POSITION_INDEPENDENT_CODE=ON being translated as -fPIE instead of -fPIC
Nope. If I remove -DCMAKE_POSITION_INDEPENDENT_CODE=ON, then c++ is invoked without -fPIE nor -fPIC, and the result of the compilation is the same error
This comment has been minimized.
@lbartoletti This breaks the build for me on Ubuntu 16.04 with
Reverting it makes the build work again.
Apparently the issue is due to -DCMAKE_POSITION_INDEPENDENT_CODE=ON being translated as -fPIE instead of -fPIC
This comment has been minimized.
@rouault does it work if you remove cmake/QCAMacros.cmake, line 48 (the PIC line)?
This comment has been minimized.
Nope. If I remove -DCMAKE_POSITION_INDEPENDENT_CODE=ON, then c++ is invoked without -fPIE nor -fPIC, and the result of the compilation is the same error
This comment has been minimized.
Same problem here on Ubuntu 18.04: "Compile your code with -fPIC (-fPIE is not enough)."
This comment has been minimized.
I've just added:
set(CMAKE_CXX_FLAGS "-fPIC")
to
QCAMacros.cmake
and it works now. I'm not sure if this fixes the problem for all Qt installations.I have now:
@rouault Can you check if this works for you Even?
This comment has been minimized.
@jgrocha see also #6093 (comment)
This comment has been minimized.