[Interest] Build error trying to cross compile for embedded Linux
Rogers Nate
nate.rogers at raymondcorp.com
Thu Apr 17 15:27:38 CEST 2014
On 04/16/2014 04:41 PM, Thiago Macieira wrote:
Em qua 16 abr 2014, às 19:33:20, Rogers Nate escreveu:
qimage.cpp:(.text+0x3744): undefined reference to `qt_memfill32(unsigned
int*, unsigned int, int)'
.obj/qimage_conversions.o: In function `qInitImageConversions()':
qimage_conversions.cpp:(.text+0x1ee0): undefined reference to
`convert_RGB888_to_RGB32_neon(QImageData*, QImageData const*,
QFlags<Qt::ImageConversionFlag>)'
Looks like the Neon files did not get compiled.
I thought I had that fixed, but either the fix got misplaced or has regressed.
Clearly, I don't often compile for ARM (see my employer).
Can you check what mkspecs/qmodule.pri says about your architecture and CPU
flags? I see this here on my ARM build:
QT_CPU_FEATURES.arm = neon
Do you have -mfpu=neon in your make output? If so, where is it coming from?
Your mkspec's qmake.conf? If not, is that compiler configured to enable Neon by
default?
As it turns out this build error seems like it may be occuring becuase I added -dbus and -force-pkg-config to my Qt configure command (since if I remove them I can compile). I successfully cross compiled expat and dbus to /usr/local/expat and /usr/local/dbus respectively. I am trying to follow the instructions from this thread: http://www.qtcentre.org/threads/33379-dbus.cpp-(.text-0x8)-undefined-reference-to-dbus_shutdown? Anyway, here is the contents of my mkspecs/qmodule.pri
CONFIG += cross_compile compile_examples qpa largefile neon pcre
QT_BUILD_PARTS += libs examples
QT_NO_DEFINES = CUPS FONTCONFIG HARFBUZZ IMAGEFORMAT_JPEG OPENVG PULSEAUDIO STYLE_GTK ZLIB
QT_QCONFIG_PATH =
host_build {
QT_CPU_FEATURES.x86_64 = mmx sse sse2
} else {
QT_CPU_FEATURES.arm =
}
QT_COORD_TYPE = double
QT_LFLAGS_ODBC = -lodbc
styles += mac fusion windows
QT_CFLAGS_DBUS = -I/usr/include/dbus-1.0 -I/usr/lib/x86_64-linux-gnu/dbus-1.0/include
QT_LIBS_DBUS = -ldbus-1 -lpthread -lrt
QT_CFLAGS_GLIB = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
QT_LIBS_GLIB = -pthread -lgthread-2.0 -lrt -lglib-2.0
DEFINES += QT_NO_XCB
DEFINES += QT_NO_XKBCOMMON
QMAKE_CFLAGS_XCB =
QMAKE_LIBS_XCB = -lxcb
sql-drivers =
sql-plugins = sqlite
After looking at this file I realized the path to dbus was wrong, and I noticed I forgot to do this: export PKG_CONFIG_PATH=/usr/local/dbus/lib/pkgconfig
After doing that the contents of my mkspecs/qmodule.pri have changed to this...
CONFIG += cross_compile compile_examples qpa largefile neon pcre
QT_BUILD_PARTS += libs examples
QT_NO_DEFINES = CUPS FONTCONFIG HARFBUZZ IMAGEFORMAT_JPEG OPENVG PULSEAUDIO STYLE_GTK ZLIB
QT_QCONFIG_PATH =
host_build {
QT_CPU_FEATURES.x86_64 = mmx sse sse2
} else {
QT_CPU_FEATURES.arm =
}
QT_COORD_TYPE = double
QT_LFLAGS_ODBC = -lodbc
styles += mac fusion windows
QT_CFLAGS_DBUS = -I/usr/local/dbus/include/dbus-1.0 -I/usr/local/dbus/lib/dbus-1.0/include
QT_LIBS_DBUS = -L/usr/local/dbus/lib -ldbus-1 -lpthread -lrt
QT_CFLAGS_GLIB = -pthread -I/usr/include/glib-2.0 -I/usr/lib/x86_64-linux-gnu/glib-2.0/include
QT_LIBS_GLIB = -pthread -lgthread-2.0 -lrt -lglib-2.0
DEFINES += QT_NO_XCB
DEFINES += QT_NO_XKBCOMMON
QMAKE_CFLAGS_XCB =
QMAKE_LIBS_XCB = -lxcb
sql-drivers =
sql-plugins = sqlite
That looks a little better and upon reviewing this I was noticed a few things:
1) Do I have to cross compile glib too? I don't directly use it that I am aware of (unless dbus uses it, I don't know)
2) QT_CPU_FEATURES.arm is blank
Not sure if this helps but after exporting PKG_CONFIG_PATH the build fails like this:
arm-linux-gnueabihf-g++ -c -pipe -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon -fvisibility=hidden -fvisibility-inlines-hidden -std=c++0x -fno-exceptions -Wall -W -D_REENTRANT -fPIC -DQT_NO_XCB -DQT_NO_XKBCOMMON -DQT_NO_USING_NAMESPACE -DQT_BUILD_OPENGL_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 -DQT_NO_EXCEPTIONS -D_LARGEFILE64_SOURCE -D_LARGEFILE_SOURCE -DQT_NO_DEBUG -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I../../mkspecs/linux-TIarmv7-sgx-g++ -I. -I../../include -I../../include/QtOpenGL -I../../include/QtOpenGL/5.2.0 -I../../include/QtOpenGL/5.2.0/QtOpenGL -I/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include -I/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/ -I/home/nrogers/dev/Graphics_SDK_4_10/include -I/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include -I/home/nrogers/dev/qt-everywhere-opensource-src-5.2.0/qtbase/mkspecs/linux-TIarmv7-sgx-g++/../../../src/3rdparty/powervr/wsegl2 -I/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include -I/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/ -I/home/nrogers/dev/Graphics_SDK_4_10/include -I/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include -I../../include/QtWidgets/5.2.0 -I../../include/QtWidgets/5.2.0/QtWidgets -I../../include/QtWidgets -I../../include/QtGui/5.2.0 -I../../include/QtGui/5.2.0/QtGui -I../../include/QtGui -I../../include/QtCore/5.2.0 -I../../include/QtCore/5.2.0/QtCore -I../../include/QtCore -I.moc -I/home/nrogers/dev/tslib-1.0/src -I/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include -I/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/ -I/home/nrogers/dev/Graphics_SDK_4_10/include -I/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include -o .obj/moc_qglengineshadermanager_p.o .moc/moc_qglengineshadermanager_p.cpp
rm -f libQt5PrintSupport.so.5.2.0 libQt5PrintSupport.so libQt5PrintSupport.so.5 libQt5PrintSupport.so.5.2
arm-linux-gnueabihf-g++ -Wl,--no-undefined -Wl,-O1 -Wl,-rpath,/usr/local/qt5.2.0/lib -shared -Wl,-Bsymbolic-functions -Wl,-soname,libQt5PrintSupport.so.5 -o libQt5PrintSupport.so.5.2.0 .obj/qpaintengine_alpha.o .obj/qpaintengine_preview.o .obj/qprintengine_pdf.o .obj/qprinter.o .obj/qprinterinfo.o .obj/qplatformprintplugin.o .obj/qplatformprintersupport.o .obj/qprintpreviewwidget.o .obj/qprintdialog_unix.o .obj/qpagesetupdialog_unix.o .obj/qabstractprintdialog.o .obj/qpagesetupdialog.o .obj/qprintpreviewdialog.o .obj/qrc_qprintdialog.o .obj/moc_qplatformprintplugin.o .obj/moc_qabstractprintdialog.o .obj/moc_qpagesetupdialog_unix_p.o -L/home/nrogers/dev/Graphics_SDK_4_10/gfx_rel_es8.x/ -L/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxARMV7/Lib -L/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxARMV7/Lib -L/home/nrogers/dev/ti-sdk-6.0/filesystem/rootfs/usr/lib -L/home/nrogers/dev/qt-everywhere-opensource-src-5.2.0/qtbase/lib -lQt5Widgets -lQt5Gui -lQt5Core -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lusc -lts -lpthread -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lusc
ln -s libQt5PrintSupport.so.5.2.0 libQt5PrintSupport.so
ln -s libQt5PrintSupport.so.5.2.0 libQt5PrintSupport.so.5
ln -s libQt5PrintSupport.so.5.2.0 libQt5PrintSupport.so.5.2
rm -f ../../lib/libQt5PrintSupport.so.5.2.0
rm -f ../../lib/libQt5PrintSupport.so
rm -f ../../lib/libQt5PrintSupport.so.5
rm -f ../../lib/libQt5PrintSupport.so.5.2
mv -f libQt5PrintSupport.so.5.2.0 ../../lib/
mv -f libQt5PrintSupport.so ../../lib/
mv -f libQt5PrintSupport.so.5 ../../lib/
mv -f libQt5PrintSupport.so.5.2 ../../lib/
make[3]: Leaving directory `/home/nrogers/dev/qt-everywhere-opensource-src-5.2.0/qtbase/src/printsupport'
rm -f libQt5OpenGL.so.5.2.0 libQt5OpenGL.so libQt5OpenGL.so.5 libQt5OpenGL.so.5.2
arm-linux-gnueabihf-g++ -Wl,--no-undefined -Wl,-O1 -Wl,-rpath,/usr/local/qt5.2.0/lib -shared -Wl,-Bsymbolic-functions -Wl,-soname,libQt5OpenGL.so.5 -o libQt5OpenGL.so.5.2.0 .obj/qgl.o .obj/qglcolormap.o .obj/qglfunctions.o .obj/qglpixelbuffer.o .obj/qglframebufferobject.o .obj/qglpaintdevice.o .obj/qglbuffer.o .obj/qglshaderprogram.o .obj/qgraphicsshadereffect.o .obj/qglgradientcache.o .obj/qglengineshadermanager.o .obj/qgl2pexvertexarray.o .obj/qpaintengineex_opengl2.o .obj/qglcustomshaderstage.o .obj/qtextureglyphcache_gl.o .obj/qgl_qpa.o .obj/moc_qgl.o .obj/moc_qgl_p.o .obj/moc_qglshaderprogram.o .obj/moc_qgraphicsshadereffect_p.o .obj/moc_qglengineshadermanager_p.o -L/home/nrogers/dev/Graphics_SDK_4_10/gfx_rel_es8.x/ -L/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxARMV7/Lib -L/home/nrogers/dev/Graphics_SDK_4_10/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxARMV7/Lib -L/home/nrogers/dev/ti-sdk-6.0/filesystem/rootfs/usr/lib -L/home/nrogers/dev/qt-everywhere-opensource-src-5.2.0/qtbase/lib -lQt5Widgets -lQt5Gui -lQt5Core -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lusc -lts -lpthread -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lusc
ln -s libQt5OpenGL.so.5.2.0 libQt5OpenGL.so
ln -s libQt5OpenGL.so.5.2.0 libQt5OpenGL.so.5
ln -s libQt5OpenGL.so.5.2.0 libQt5OpenGL.so.5.2
rm -f ../../lib/libQt5OpenGL.so.5.2.0
rm -f ../../lib/libQt5OpenGL.so
rm -f ../../lib/libQt5OpenGL.so.5
rm -f ../../lib/libQt5OpenGL.so.5.2
mv -f libQt5OpenGL.so.5.2.0 ../../lib/
mv -f libQt5OpenGL.so ../../lib/
mv -f libQt5OpenGL.so.5 ../../lib/
mv -f libQt5OpenGL.so.5.2 ../../lib/
make[3]: Leaving directory `/home/nrogers/dev/qt-everywhere-opensource-src-5.2.0/qtbase/src/opengl'
make[2]: Leaving directory `/home/nrogers/dev/qt-everywhere-opensource-src-5.2.0/qtbase/src'
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory `/home/nrogers/dev/qt-everywhere-opensource-src-5.2.0/qtbase'
make: *** [module-qtbase-make_first] Error 2
It does look like -mfpu=neon is in my make output, but I am not 100% sure where it is coming from. I am guessing from my qmake.conf as you suggested. Here are the contents of my mkspec's qmake.conf:
#
# qmake configuration for building with arm-linux-g++
#
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental gdb_dwarf_index
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
#User specific Path - To Be edited by User
QT_INSTALL_DIR = $$PWD/../../..
SGX_SDK_ROOT = /home/nrogers/dev/Graphics_SDK_4_10
TSLIB_INCDIR = /home/nrogers/dev/tslib-1.0/src
TSLIB_LIBDIR = /home/nrogers/dev/ti-sdk-6.0/filesystem/rootfs/usr/lib
# modifications to g++.conf
QMAKE_CFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon
QMAKE_CXXFLAGS_RELEASE = -O3 -march=armv7-a -mtune=cortex-a8 -mfpu=neon
QMAKE_CC = arm-linux-gnueabihf-gcc
QMAKE_CXX = arm-linux-gnueabihf-g++
QMAKE_LINK = arm-linux-gnueabihf-g++
QMAKE_LINK_SHLIB = arm-linux-gnueabihf-g++
# modifications to linux.conf
QMAKE_AR = arm-linux-gnueabihf-ar cqs
QMAKE_OBJCOPY = arm-linux-gnueabihf-objcopy
QMAKE_STRIP = arm-linux-gnueabihf-strip
#Do not edit beyond this
QMAKE_INCDIR_OPENGL_ES2 = $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/Include/
QMAKE_INCDIR_OPENGL_ES2 += $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxOMAP3/Include/
QMAKE_INCDIR_OPENGL_ES2 += $$SGX_SDK_ROOT/include
QMAKE_INCDIR_OPENGL_ES2 += $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/
QMAKE_LIBDIR_OPENGL_ES2 = $$SGX_SDK_ROOT/gfx_rel_es8.x/
QMAKE_LIBDIR_OPENGL_ES2 += $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES2/SDKPackage/Builds/OGLES2/LinuxARMV7/Lib
QMAKE_LIBDIR_OPENGL_ES2 += $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/LinuxARMV7/Lib
QMAKE_LIBS_OPENGL_ES2 = -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lusc
QMAKE_INCDIR_OPENGL += $$SGX_SDK_ROOT/GFX_Linux_SDK/OGLES/SDKPackage/Builds/OGLES/Include/
QMAKE_LIBDIR_OPENGL = $$SGX_SDK_ROOT/gfx_rel_es8.x
QMAKE_LIBDIR_OPENGL_QT = $$SGX_SDK_ROOT/gfx_relg_es8.x
QMAKE_LIBS_OPENGL_ES1 = -lEGL -lGLES_CM -lIMGegl -lsrv_um -lusc
QMAKE_INCDIR_OPENVG = $$SGX_SDK_ROOT/GFX_Linux_SDK/OVG/SDKPackage/Builds/OVG/Include/
QMAKE_LIBDIR_OPENVG = $$SGX_SDK_ROOT/gfx_rel_es8.x/
QMAKE_LIBS_OPENVG = -lEGL -lGLESv2 -lGLES_CM -lIMGegl -lsrv_um -lOpenVG -lOpenVGU
QMAKE_INCDIR_EGL = $$QMAKE_INCDIR_OPENGL_ES2
QMAKE_INCDIR_EGL += $$QT_INSTALL_DIR/src/3rdparty/powervr/wsegl2
QMAKE_INCDIR_POWERVR = $$QT_INSTALL_DIR/src/3rdparty/powervr/wsegl2
QMAKE_LIBDIR_EGL = $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBS_EGL = -lEGL -lIMGegl -lsrv_um -lGLESv2 -lGLES_CM -lusc
QMAKE_INCDIR += $$TSLIB_INCDIR
QMAKE_INCDIR += $$QMAKE_INCDIR_OPENGL_ES2
QMAKE_LIBDIR += $$QMAKE_LIBDIR_OPENGL_ES2
QMAKE_LIBDIR += $$TSLIB_LIBDIR
QMAKE_LIBS = $$QMAKE_LIBS_OPENGL_ES2 -lts
load(qt_config)
Thanks again for the help, I really appreciate it!
Nate
Confidentiality Notice:
The preceding e-mail message (including any attachments) contains information that may be confidential, protected by applicable legal privileges, or constitute non-public information. It is intended to be conveyed only to the designated recipient(s). If you are not an intended recipient of this message, please notify the sender by replying to this message and then delete it from your system. Use, dissemination, distribution or reproduction of this message by unintended recipients is
not authorized and may be unlawful.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20140417/688f110e/attachment.html>
More information about the Interest
mailing list