Compiling QtWebkit with RVCT for ARM-Linux

There are a lot of make specifications in Qt, but none of them is suitable for RVCT compilation. So, if you want to compile QtWebKit with RVCT, you have two options: either you create a new specification or you can use an existing one with wrapper scripts. In this post I'll describe the second option.

Libs, header dependencies

The dependent libs can be found at
You can either cross compile them or you can get them from your device which you want to run QtWebKit on. If you get them from your device, you need the following directories:

  • /lib
  • /usr/lib
  • /usr/include

Put them to your SDK directory. (e.g. ~/SDKROOT)

For the compilation you still need a cross-compiled Qt. You can find some instructions of this at:

GCC system headers

You can use this GNU toolchain's system headers for the compilation:

Unpack this to your toolchain directory. (e.g. ~/TOOLCHAIN)

Generate a config file for RVCT

Whit armcc you can generate the config file for the QtWebKit compilation.

export TOOLCHAIN="~/TOOLCHAIN/arm-2008q3"
armcc --arm_linux_configure --arm_linux_config_file=rvct_config --configure_sysroot=$SDKROOT \

This creates a config file named rvct_config, which you can use for the compilation.

Wrapper scripts

I use the qws/linux-arm-g++ make specification, and the following wrappers:



@list = @ARGV;

# new switches
unshift(@list, "--gnu");
unshift(@list, "--exceptions");
unshift(@list, "--arm_linux_paths"); 
unshift(@list, "--arm_linux_config_file=".$ENV{'RVCT_CONFIG_FILE'});
unshift(@list, "-D__WCHAR_TYPE_");
unshift(@list, "-D__ARM_EABI__");
unshift(@list, "-DQT_NO_XRENDER");

# needed for gcc headers
unshift(@list, "-D'__is_empty\(X\)'=false");
unshift(@list, "-D'__is_pod\(X\)'=true");
unshift(@list, "-D'__has_trivial_destructor\(X\)'=true");

$new_string = join(" ",@list);

# delete some switches
$new_string =~ s/-Wall|-Wl,|-fno-stack-protector|-enum|-Wreturn-type//g;
$new_string =~ s/-fno-strict-aliasing|-Wcast-align|-Wchar-subscripts|-Wformat-security//g;
$new_string =~ s/-Wreturn-type|-Wno-unused-parameter|-Wno-sign-compare//g;
$new_string =~ s/-Wno-switch|-Wno-switch-enum|-Wundef|-Wmissing-noreturn|-Winit-self|-pipe//g;
$new_string =~ s/-ffunction-sections|-fdata-sections|-fvisibility=hidden//g;
$new_string =~ s/-fvisibility-inlines-hidden|--gc-sections|--no-undefined|-Wextra|-z,origin//g;

# set some switches for RVCT
$new_string =~ s/-rpath,/-L--userlibpath=/g;
$new_string =~ s/-shared/-L--shared -L--fpic/g;
$new_string =~ s/-soname,/-L--soname=/g;
$new_string =~ s/-L\//-L--userlibpath=\//g;
$new_string =~ s/ -l(\w)/ -L--library=\1/g;
$new_string =~ s/-fPIC/--shared --apcs=\/fpic/g;
$new_string =~ s/[^L]--userlibpath / -L--userlibpath=/g;

# not nice but it works
$new_string =~ s/ libjscore\.so / libjscore\.a /g;

# for defined paths
$new_string =~ s/\"/\\\"/g;

# execute the command
@out = `armcc $new_string 2>&1`;

# Check the output for errors
$str = join(" ",@out);
if($str =~ /Usage:|No such|error:|Error:| error /)
  print "\n--ERROR BEGIN--\n $str \n--ERROR END--\n";

# print the output
print "armcc $str";



@list = @ARGV;

$new_string = join(" ",@list);
$new_string =~ s/^cqs / -r /g;

@out = `armar $new_string`;

Put these wrappes to you cross bin directory. (e.g. ~/CROSSBIN)

Builder script

With this script you can compile QtWebKit with RVCT:

# cross compiled Qt

export PATH=$QTDIR/bin:$PATH
export RVCT_CONFIG_FILE="rvct_config"

export BUILD_WEBKIT_ARGS="QMAKESPEC=qws/linux-arm-g++ CONFIG+=rvct_linker LIBS+=-lm \
         LIBS*=-lsqlite3 LIBS*=-lexpat LIBS*=-lfreetype LIBS*=-lz LIBS*=-lXrender \
         LIBS+=libc_nonshared.a DEFINES+=__ARM_EABI__ DEFINES=QT_NO_UITOOLS \
         QMAKE_CXXFLAGS+=-I$SDKROOT/usr/include LIBS*=-L$SDKROOT/usr/lib LIBS*=-L$SDKROOT/lib"

cd WebKit
WebKitTools/Scripts/build-webkit --qt --release

Post new comment

The content of this field is kept private and will not be shown publicly.
  • Web page addresses and e-mail addresses turn into links automatically.
  • No HTML tags allowed
  • Lines and paragraphs break automatically.

More information about formatting options

This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Fill in the blank