Reduce relocations issues on ARM

David Faure faure at kde.org
Thu Sep 13 09:50:05 UTC 2012


On Thursday 13 September 2012 11:20:11 Volker Krause wrote:
> On Tuesday 11 September 2012 08:12:52 Laszlo Papp wrote:
> > Hi,
> > 
> > Trying to build the kde-frameworks branch on ARM, but I am facing the
> > issue
> > below. I had the impression the reduce_relocations changes in Qt5 is
> > managed by cmake from the version 2.8.9 which I have been using in this
> > environment. I have been using the Qt Beta 1 packages.
> > 
> > Any help welcome. Thank you in advance. :)
> > 
> > Laszlo
> > 
> > make
> > [  0%] Automoc for target kdeqt5staging
> > [  0%] Built target kdeqt5staging_automoc
> > [  0%] Built target kdeqt5staging
> > [  0%] Automoc for target tst_qsavefile
> > [  0%] Built target tst_qsavefile_automoc
> > [  0%] Building CXX object
> > libkdeqt5staging/autotests/CMakeFiles/tst_qsavefile.dir/tst_qsavefile.cpp.
> > o
> > In file included from
> > /scratchbox/users/lpapp/home/lpapp/git/kdelibs/libkdeqt5staging/autotests/
> > .. /../kde_qt5_compat.h:23, from
> > /scratchbox/users/lpapp/home/lpapp/git/kdelibs/libkdeqt5staging/autotests/
> > ts t_qsavefile.cpp:43: /opt/qt5/include/QtCore/qglobal.h:1084: error:
> > #error "You must build your code with position independent code if Qt was
> > built with
> > -reduce-relocations. " "Compile your code with -fPIC or -fPIE."
> 
> ^^^ This is not limited to ARM btw, I got the same on x86. I worked around
> this for now by adding -fPIC to my compiler flags. Latest CMake indeed has
> the solution for this, but it apparently needs to be enabled explicitly in
> kdelibs, which I think isn't done yet.

Doesn't this commit from yesterday fix it?

Git commit 859ff67a5eeb79ef2c867e114a0c620d614a4cc3 by Stephen Kelly.
Committed on 12/09/2012 at 13:47.
Pushed by skelly into branch 'frameworks'.

Build with Qt 5 default configuration.

Qt 5 requires users to create position independent code by default.

M  +4    -0    CMakeLists.txt

http://commits.kde.org/kdelibs/859ff67a5eeb79ef2c867e114a0c620d614a4cc3

diff --git a/CMakeLists.txt b/CMakeLists.txt
index d47fdb3..1ea2a12 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -54,6 +54,10 @@ set(CMAKE_MODULE_PATH "${CMAKE_SOURCE_DIR}/cmake/modules" 
${ECM_MODULE_PATH})
 
 find_package(Qt5Transitional)
 
+if (Qt5_POSITION_INDEPENDENT_CODE)
+  set(CMAKE_POSITION_INDEPENDENT_CODE ON)
+endif()
+
 if (NOT QT5_BUILD)
   add_subdirectory( libinqt5 )
   set(inqt5_LIBRARY inqt5)

-- 
David Faure, faure at kde.org, http://www.davidfaure.fr
Sponsored by Nokia to work on KDE, incl. KDE Frameworks 5



More information about the Kde-frameworks-devel mailing list