Details
-
Bug
-
Resolution: Out of scope
-
P3: Somewhat important
-
None
-
4.6.1
-
None
Description
During the bootstrap phase of a cross-compile build of Qt Embedded 4.6.1, the build system incorrectly adds an rpath flag mv /pointing to the target system's libraries when linking the files: bin/moc, bin/uic and bin/rrc. This links libraries built for the target system, and not the build system, which subsequently cause a segfault when these tools are used later in the build process.
Here is the relevant part of the configure command:
./configure -v -embedded x86 -xplatform qws/linux-lightspeed-x86-g++ -prefix /usr/i686-unknown-linux-gnu -release ...
Here is the mkspecs/qws/linux-lightspeed-x86-g++/qmake.conf:
include(../../common/g++.conf)
include(../../common/linux.conf)
include(../../common/qws.conf)
- Modifications to g++.conf
QMAKE_CC = i686-unknown-linux-gnu-gcc
QMAKE_CXX = i686-unknown-linux-gnu-g++
QMAKE_LINK = i686-unknown-linux-gnu-g++
QMAKE_LINK_SHLIB = i686-unknown-linux-gnu-g++
QMAKE_LINK_C = i686-unknown-linux-gnu-gcc
QMAKE_LINK_C_SHLIB = i686-unknown-linux-gnu-gcc - Modifications to linux.conf
QMAKE_INCDIR = /usr/i686-unknown-linux-gnu/include
QMAKE_LIBDIR = /usr/i686-unknown-linux-gnu/lib
QMAKE_INCDIR_X11 = /usr/i686-unknown-linux-gnu/usr/X11R6/include
QMAKE_LIBDIR_X11 = /usr/i686-unknown-linux-gnu/usr/X11R6/lib
QMAKE_INCDIR_OPENGL = /usr/i686-unknown-linux-gnu/usr/X11R6/include
QMAKE_LIBDIR_OPENGL = /usr/i686-unknown-linux-gnu/usr/X11R6/lib
load(qt_config)
Here is the link command for bin/moc (note the rpath to /usr/i686-unknown-linux-gnu/lib, this is the target system's libraries):
g++ -Wl,-rpath-link,/root/lightspeed/qt-everywhere-opensource-src-4.6.1/lib -Wl,-O1 -Wl,-rpath,/usr/i686-unknown-linux-gnu/lib -Wl,-rpath,/usr/i686-unknown-linux-gnu/lib -o ../../../bin/moc release-shared/moc.o release-shared/preprocessor.o release-shared/generator.o release-shared/parser.o release-shared/token.o release-shared/main.o -L/root/lightspeed/qt-everywhere-opensource-src-4.6.1/src/tools/bootstrap -lbootstrap