Search |
QtWebKit cross compilation with GCC for ARM-Linux
When I tried to cross compile QtWebKit for ARM-Linux, I didn't find any clear description, so I have decided to write a blogpost about it. It's not too hard, but if you have never done something like this, it can be a little bit confusing. In this post, I will describe this method in some simple steps. Dependent libs and headersThe dependent libs can be found at http://trac.webkit.org/wiki/BuildingQtOnLinux Usually, you can get them from your device which you want to run QtWebKit on.
Put them to your SDK directory. (e.g. ~/SDKROOT) GNU toolchainFor the cross compilation, you can use this GNU toolchain: http://www.codesourcery.com/downloads/public/gnu_toolchain/arm-none-linu... Unpack this to your toolchain directory. (e.g. ~/TOOLCHAIN) Qt cross compilationFirst download Qt-4.6.0 and unpack it. wget ftp://ftp.qt.nokia.com/qt/source/qt-everywhere-opensource-src-4.6.0.tar.gz tar -xf qt-everywhere-opensource-src-4.6.0.tar.gz In your qt-everywhere-opensource-src-4.6.0/ directory, there are a lot of make specifications in mkspecs dir. You have to change the qws/linux-arm-g++ one. In this directory , look for qmake.conf and modify it as follows: QMAKE_CC = arm-none-linux-gnueabi-gcc QMAKE_CXX = arm-none-linux-gnueabi-g++ QMAKE_LINK = arm-none-linux-gnueabi-g++ QMAKE_LINK_SHLIB = arm-none-linux-gnueabi-g++ # modifications to linux.conf QMAKE_AR = arm-none-linux-gnueabi-ar cqs QMAKE_OBJCOPY = arm-none-linux-gnueabi-objcopy QMAKE_STRIP = arm-none-linux-gnueabi-strip
Now, our Qt is ready for the compilation. export PATH=~/TOOLCHAIN/arm-2008q3/bin:$PATH cd qt-everywhere-opensource-src-4.6.0 ./configure -arch arm -xplatform qws/linux-arm-g++ -release -openssl \ -I~/SDKROOT/usr/include -L~/SDKROOT/usr/lib -L~/SDKROOT/lib \ -lX11 -lxcb -lXau -lXdmcp -lXext \ --prefix=/usr/local/Trolltech/Qt-4.6.0-arm-cross make && make install Now, you have a brand new cross compiled Qt. QtWebKit cross compilationQtWebKit cross compilation is very simple now. You just have to set up some environment variables, and then you are ready for the compilation with the build-webkit script. QTDIR="/usr/local/Trolltech/Qt-4.6.0-arm-cross" export PATH=$QTDIR/bin:$PATH export PATH=~/TOOLCHAIN/arm-2008q3/bin:$PATH export BUILD_WEBKIT_ARGS="QMAKESPEC=qws/linux-arm-g++ DEFINES=QT_NO_UITOOLS LIBS+=-lm \ LIBS*=-lsqlite3 LIBS*=-lexpat LIBS*=-lfreetype LIBS*=-lz LIBS*=-lXrender \ QMAKE_CXXFLAGS+=-I~/SDKROOT/usr/include LIBS*=-L~/SDKROOT/usr/lib LIBS*=-L~/SDKROOT/lib" cd WebKit WebKitTools/Scripts/build-webkit --qt --release Now, your QtWebKit is ready for running on your ARM device. |
Monthly archive
|
liubo_from china (not verified) - 05/22/2010 - 04:10
hi,I do the same job recently. Thanks for your help!
As I follow your process,I meet some problems.
First,I want to know the purpose of the dir SDKROOT,and what's the contents in them?
Second,when I did these:
./configure -arch arm -xplatform qws/linux-arm-g++ -release -openssl \
-I~/SDKROOT/usr/include -L~/SDKROOT/usr/lib -L~/SDKROOT/lib \
-lX11 -lxcb -lXau -lXdmcp -lXext \
--prefix=/usr/local/Trolltech/Qt-4.6.0-arm-cross
the system had a problems as,
ld:skipping incompatible ~/SDKROOT/usr/lib/libx11.so when searching for -lX11
ld:skipping incompatible ~/SDKROOT/usr/lib/libx11.a when searching for -lX11
cannot find -lX11
And I checked my host machine,Ubuntu9.10,the libX11-dev were the newest.
I don't know why?
Could you tell me your host system's version and your target?
Thanks again!
gabor.rapcsanyi - 05/25/2010 - 09:00
Hi!
The SDKROOT contains the ARM (target) libraries and headers. My host architecture is x86, and the target is ARM.
As I see you try to compile with x86 (host) libs and that cause this linker problem.
I get these ARM libraries from my target machine, but you can cross compile them one by one to your SDKROOT dir if you feel enough power in you :)
liubo_from china (not verified) - 05/26/2010 - 09:33
Thanks,I understand now. I believe that following you tips,I can do the work well by myself.Unfortunately,the time is not allowed.My tutor will check the port(WebKit to ARM) very soon.
So,if it's possible,please send your SDKROOT to me.Thanks a lot!
My email:xb_24@126.com
gabor.rapcsanyi - 05/27/2010 - 11:39
Sorry, but it's too big (~100MB) to send it in e-mail, so try to create an ARM chroot on your host machine and use this chroot libs and headers for the cross compilation.
A good starting point:
https://wiki.ubuntu.com/ARM/BuildEABIChroot
Olcay Ertaş (not verified) - 12/07/2011 - 01:06
Hi, I have tried to compile Qt as you described but encountered some problems. I have explained my problems here:
http://stackoverflow.com/questions/8401378/cross-compiling-a-qt-gui-appl...
Can you look at the problem and help me to find out a solution?
Thanks in advance.
Olcay Ertaş (not verified) - 12/07/2011 - 01:07
Here is the short link to question:
http://stackoverflow.com/q/8401378/614065
gabor.rapcsanyi - 12/08/2011 - 14:21
Hi, I'm not very familiar with Qt Creator but for the first look you should check libQtGui.so and the other libs whether they are compiled for ARM. The other thing is that I can't see what was the command which caused that error.
Anonymous (not verified) - 12/20/2011 - 10:38
Hi. can anyone please give me binaries for xrender (development files) and phonon (development files).
I couldn't cross compile them, and the apt-get install on arm brings many dependencies:(
gabor.rapcsanyi - 12/20/2011 - 13:22
Which distro do you use? The latest Ubuntu and Debian release are contain the correct version of these packages. You can download the Ubuntu ones from: https://launchpad.net/ubuntu/
But what is your problem with the dependencies?
Anonymous (not verified) - 12/20/2011 - 19:21
Thanks for answer.
I use Debian GNU/Linux 5.0 on my beagleboard, bbut when I tried
sudo apt-get install bison flex libqt4-dev libqt4-opengl-dev libphonon-dev libicu-dev libsqlite3-dev libxext-dev libxrender-dev gperf libfontconfig1-dev libphonon-dev g++
I got this
The following packages have unmet dependencies:
libicu-dev: Depends: libicu40 (= 4.0-1maemo2) but it is not going to be installed
libqt4-dev: Depends: libgconf2-6 (>= 2.13.5) but it is not going to be installed
Depends: libqt4-svg (= 4.5.3-1maemo1) but it is not going to be installed
Depends: libqt4-webkit (= 4.5.3-1maemo1) but it is not going to be installed
Depends: libqt4-scripttools (= 4.5.3-1maemo1) but it is not going to be installed
Depends: libqt4-xmlpatterns (= 4.5.3-1maemo1) but it is not going to be installed
Depends: libqt4-help (= 4.5.3-1maemo1) but it is not going to be installed
Depends: libqt4-assistant (= 4.5.3-1maemo1) but it is not going to be installed
Depends: libqt4-test (= 4.5.3-1maemo1) but it is not going to be installed
Depends: qt4-qmake (= 4.5.3-1maemo1) but it is not going to be installed
libqt4-network: Depends: libgconf2-6 (>= 2.13.5) but it is not going to be installed
libqt4-opengl-dev: Depends: libqt4-opengl (= 4.4.3-1+lenny1) but it is not going to be installed
Depends: libqt4-dev (= 4.4.3-1+lenny1) but 4.5.3-1maemo1 is to be installed
Depends: libgl1-mesa-dev but it is not going to be installed or
libgl-dev
Depends: libglu1-mesa-dev but it is not going to be installed or
libglu-dev
libqt4-qt3support: Depends: libgconf2-6 (>= 2.13.5) but it is not going to be installed
qt4-qtconfig: Depends: libgconf2-6 (>= 2.13.5) but it is not going to be installed
Depends: libqt4-phonon (= 4.5.3-1maemo1) but it is not going to be installed
E: Unmet dependencies. Try 'apt-get -f install' with no packages (or specify a solution).
So I try to cross compile those libraries
but couldn't do this for xrender and phonon.
p.s I have tried to build qt-4.8
Anonymous (not verified) - 12/20/2011 - 23:52
Also when cross compiling QT I got this
Basic XLib functionality test failed!
You might need to modify the include and library search paths by editing
QMAKE_INCDIR_X11 and QMAKE_LIBDIR_X11 in /home/vahag/QT/qt-everywhere-opensource-src-4.8.0/mkspecs/qws/linux-arm-g++.
Does it mean i have to cross compile Xlib too???
gabor.rapcsanyi - 01/05/2012 - 09:29
Hi!
Try to configure it with -v and you can get the exact problem, but anyway you need the Xlib for Qt compilation. But you should make an ARM rootfs instead of cross compile every lib you need. This is a good starting point: https://wiki.ubuntu.com/ARM/RootfsFromScratch
Anonymous (not verified) - 12/01/2012 - 02:06
Well, i am still new to linux even though linux hs been in the internet world or in this technology for a long time already. landscaping salt lake city
Anonymous (not verified) - 03/26/2015 - 20:41
When running webkit (as included in qt-everywhere-opensource-src-4.6.0.tar.gz)on the imx6 patform, I always get no background color rendering, and only text which has an image included in the paragraph gets rendered. any idea how I can solve this?
Adam Kallai (not verified) - 04/13/2015 - 12:45
Hi,
The Qt 4.6 is unsupported and QtWebkit is marked deprecated in the next release Qt 5.5:
https://blog.qt.io/blog/2015/03/17/qt-5-5-alpha-available/
There are two other alternative that you may want to try:
1) Use QtWebEngine that replaces QtWebKit since Qt 5.3. It supports i.mx6 board but the support is not available in the free community version so you need to have Qt Enterprise license for it.
http://www.qt.io/download/
http://blog.qt.io/blog/2014/05/13/news-from-the-qt-webengine-team/
2) You may use Qt 4.8 as well. Its support is extended unitl 19th December 2015: http://blog.qt.io/blog/2014/11/27/qt-4-8-x-support-to-be-extended-for-an...
The Qt 4.8 architecture is rather similar to 4.6 so it might be more convenient for deploying QtWebkit on an i.mx6 device.
I hope these things will help you. If you have any other questions, feel free to ping me via email or comment.
Post new comment