Cross compiling QT5.1 with opengles & kms
-
wrote on 26 Sept 2013, 19:10 last edited by
Hi,
I'm not having much luck compiling QT5.1 using arm-linux-gnueabihf-4.7. Configure ran successfully and detected and enabled most required modules. I did have an issue with config.tests/qpa/kms, but it's likely related to a pkg-config issue. Here's the KMS functional test output:
@
KMS auto-detection... ()
Project ERROR: Package libdrm not found
make: *** No targets specified and no makefile found. Stop.
KMS disabled.
KMS support cannot be enabled due to functionality tests!
Turn on verbose messaging (-v) to /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/configure to see the final report.
@Does qmake search for the required libraries (libdrm libudev egl gbm glesv2) before generating the makefile (which doesn't exist)? Adding the following line to qmake.config didn't seem to help:
@
QMAKE_LIBDIR += $$[QT_SYSROOT]/../libdrm/.libs
QMAKE_LIBDIR += $$[QT_SYSROOT]/../libdrm/libkms/.libs
@libdrm has been cross-compiled on my machine, but it has not been installed. I also tried to compile kms.cpp and I got a compiler error due to the "virtual" variable name in the drm_buf_map structure (drm/drm.h) when including "xf86drm.h" or "xf86drmMode.h." I understand this is not related to the issue stated above, but I'm curious how this was resolved.
For now I just bypassed the KMS functional test and forced it to pass. During the make project, I got the following error:
arm-linux-gnueabihf-ld: unrecognized option '-Wl,-O1'
Any help would be appreciated!
@
qtbase/bin/qmake /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0
cd qtbase/ && ( test -e Makefile || /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/bin/qmake /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/qtbase.pro -o Makefile ) && make -f Makefile
make[1]: Entering directory/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase' cd src/ && ( test -e Makefile || /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/bin/qmake /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src/src.pro -o Makefile ) && make -f Makefile make[2]: Entering directory
/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src'
cd tools/bootstrap/ && ( test -e Makefile || /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/bin/qmake /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src/tools/bootstrap/bootstrap.pro -o Makefile ) && make -f Makefile
make[3]: Entering directory/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src/tools/bootstrap' make[3]: Nothing to be done for
first'.
make[3]: Leaving directory/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src/tools/bootstrap' cd tools/moc/ && ( test -e Makefile || /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/bin/qmake /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src/tools/moc/moc.pro -o Makefile ) && make -f Makefile make[3]: Entering directory
/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src/tools/moc'
/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/bin/arm-linux-gnueabihf-ld -L/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/build-arm-linux-gnueabihf/usr/lib -L/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/build-arm-linux-gnueabihf/usr/local/lib -Wl,-O1 -o ../../../bin/moc .obj/release-shared/moc.o .obj/release-shared/preprocessor.o .obj/release-shared/generator.o .obj/release-shared/parser.o .obj/release-shared/token.o .obj/release-shared/main.o -L/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/lib -lQt5Bootstrap -lpthread
/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/bin/arm-linux-gnueabihf-ld: unrecognized option '-Wl,-O1'
/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/bin/arm-linux-gnueabihf-ld: use the --help option for usage information
make[3]: *** [../../../bin/moc] Error 1
make[3]: Leaving directory/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src/tools/moc' make[2]: *** [sub-moc-make_first] Error 2 make[2]: Leaving directory
/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src'
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory `/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase'
make: *** [module-qtbase-make_first] Error 2
@ -
wrote on 26 Sept 2013, 20:58 last edited by
Should I be using g++ instead of the linker (ld)? This would make sense if the "-Wl" option is being used...
I modified my environment variables (LD==${CPP}), but now I'm getting a different error:
@
make[3]: Entering directory/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src/corelib' /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/bin/moc -DQT_NO_XCB -DQT_NO_XKBCOMMON -DQT_NO_USING_NAMESPACE -DQT_BUILD_CORE_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DPCRE_HAVE_CONFIG_H -DQT_CORE_LIB -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -I../../mkspecs/linux-omap5-g++ -I. -I../../include -I../../include/QtCore -I../../include/QtCore/5.1.0 -I../../include/QtCore/5.1.0/QtCore -Iglobal -I../3rdparty/pcre -I../3rdparty/harfbuzz/src -I../3rdparty/md5 -I../3rdparty/md4 -I../3rdparty/sha3 -I.moc/release-shared -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/build-arm-linux-gnueabihf/usr/include -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/build-arm-linux-gnueabihf/usr/local/include -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/build-arm-linux-gnueabihf/usr/local/include/libxml2 -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/build-arm-linux-gnueabihf/usr/local/include/freetype2 -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/build-arm-linux-gnueabihf/usr/local/include/libpng12 -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/build-arm-linux-gnueabihf/usr/local/include/fontconfig -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/libdrm -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/libdrm/omap -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/libdrm/libkms -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/libgbm -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/udev-164/libudev -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/glib-2.32.4 -I/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/glib-2.32.4/glib -I/usr/include -I/usr/local/include animation/qabstractanimation.h -o .moc/release-shared/moc_qabstractanimation.cpp /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/bin/moc: 1: /home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/bin/moc: Syntax error: word unexpected (expecting ")") make[3]: *** [.moc/release-shared/moc_qabstractanimation.cpp] Error 2 make[3]: Leaving directory
/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src/corelib'
make[2]: *** [sub-corelib-make_first] Error 2
make[2]: Leaving directory/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase/src' make[1]: *** [sub-src-make_first] Error 2 make[1]: Leaving directory
/home/ladar/omap5-evm/ti-glsdk_omap5-uevm_6_01_00_01/toolchain/qt-everywhere-opensource-src-5.1.0/qtbase'
make: *** [module-qtbase-make_first] Error 2@
-
wrote on 27 Sept 2013, 16:51 last edited by
I managed to fix my issue. In my cross compiling environment I set CC, CPP, LD, etc. global variables to my cross compiler settings (e.g. export CC=${CROSS_COMPILE}gcc). After unsetting these variables QT built as expected.
Now, I'm still having problems building the KMS functionality test (config.tests/qpa/kms) and qkms (qtbase/src/plugins/platforms/kms). For both cases I'm getting the following C++ compiler error:
@/usr/include/drm/drm.h:376: error: expected unqualified-id before 'virtual'@
the source of the error is found here:
@
struct drm_buf_map {
int count; /< Length of the buffer list */
void *virtual; /< Mmap'd area in user-virtual */
struct drm_buf_pub *list; /**< Buffer information */
};
@Notice the variable named "virtual," which is a known C++ keyword. Using " extern "C" " does not resolve this issue, so it's probably related to my compiler (arm-linux-gnueabihf-4.7). I fixed this issue by modifying qtbase/src/plugins/platforms/kms/qkmsscreen.h as so
@
extern "C" {
#define virtual virtual
#include <gbm.h>
#include <xf86drmMode.h>
#include <xf86drm.h>
#undef virtual
}
@I'm curious if this is a known issue and if someone has a better solution.
Thanks!
1/3