Description
QtWebEngineCore fails to build
I am attempting to build Qt 5.8.0 for Embedded Linux (TI ARM OMAP3). Building QtWebEngine fails with the following error:
make[4]: Entering directory '/home/precor/workdir/build_qt/qtwebengine/src/core'
...
/home/precor/precor_sdk/bin/../lib/gcc/arm-precor-linux-gnueabi/4.9.2/../../../../arm-precor-linux-gnueabi/bin/ld: cannot find -licui18n
/home/precor/precor_sdk/bin/../lib/gcc/arm-precor-linux-gnueabi/4.9.2/../../../../arm-precor-linux-gnueabi/bin/ld: cannot find -licuuc
/home/precor/precor_sdk/bin/../lib/gcc/arm-precor-linux-gnueabi/4.9.2/../../../../arm-precor-linux-gnueabi/bin/ld: cannot find -licudata
collect2: error: ld returned 1 exit status
Makefile.core_module:157: recipe for target '../../lib/libQt5WebEngineCore.so.5.8.0' failed
Further investigation reveals that only two of these three libs exist within the build tree:
$ find . -name "libicu*.a" -print
./qtwebengine/src/core/Release/obj/src/3rdparty/chromium/third_party/icu/libicui18n.a
./qtwebengine/src/core/Release/obj/src/3rdparty/chromium/third_party/icu/libicuuc.a
I discovered that these libs are mentioned in the following file:
$ grep licuuc /home/precor/workdir/build_qt/qtwebengine/src/core/Release/QtWebEngineCore_linking.pri
LIBS_PRIVATE += -lrt -ldl -lfontconfig -lfreetype -lexpat -lm -lz -licui18n -licuuc -licudata
Manually editing the above file to make it look like the following is my temporary workaround for the issue:
LIBS_PRIVATE += -lrt -ldl -lfontconfig -lfreetype -lexpat -lm -lz -L /home/precor/workdir/build_qt/qtwebengine/src/core/Release/obj/src/3rdparty/chromium/third_party/icu -licui18n -licuuc
The build then succeeds with the above changes. Notice that I had to remove -licudata from the command line. The default within Chromium seems to be the desire to build libicu using an external data file, in which case libicudata.a is not needed. If libicu were to be built using a shared object (.so/.dll), then this library would be needed.
There are two issues:
1) The stock Qt build system is doing the wrong thing by attempting to link against non-existent licudata library.
2) The libs are built within a directory that is not mentioned in the QtWebEngineCore_linking.pri above. I had to add the -L option to get the linker to find the static libs generated during the build.
Here is how I am building Qt:
0) Use Ubuntu 16.04 64-bit.
1) Build a custom toolchain for Embedded Linux using buildroot 2015.02. My buildroot configuration is attached. The toolchain I built can be downloaded from here. I chose to NOT include ICU within the rootfs as I want to build QtWebEngine using the built-in version of icu that bundled with Chromium sources.
2) Extract the toolchain to the home directory as follows:
$ cd
$ tar zxvf /path/to/precor_sdk.tar.gz
3) Patch the toolchain to build with an old Linux kernel (2.6.29.6):
$ cd precor_sdk/arm-precor-linux-gnueabi/sysroot/usr/include/
$ patch -p0 < /path/to/linux_headers.patch
3) Extract Qt and patch QtWebEngine to build with an old Linux kernel (2.6.29.6) and use soft floating point ABI:
$ mkdir ~/workdir && cd ~/workdir
$ tar xvf qt-everywhere-opensource-src-5.8.0.tar.xz
$ patch -p0 < /patch/to/qt-everywhere-opensource-src-5.8.0.patch
4) Configure Qt:
$ mkdir build_qt && cd build_qt
$ ../qt-everywhere-opensource-src-5.8.0/configure \
-v \
-opensource \
-confirm-license \
-release \
-sysroot /home/precor/precor_sdk/arm-precor-linux-gnueabi/sysroot \
-prefix /usr \
-device linux-beagleboard-g++ \
device-option CROSS_COMPILE=arm-precor-linux-gnueabi \
-eglfs -opengl es2 \
-tslib \
-make libs \
-no-pch \
-nomake tests \
-nomake examples \
-skip qt3d \
-skip qtcanvas3d \
-skip qtcharts \
-skip qtconnectivity \
-skip qtdatavis3d \
-skip qtdoc \
-skip qtgamepad \
-skip qtlocation \
-skip qtmultimedia \
-skip qtpurchasing \
-skip qtscxml \
-skip qtsensors \
-skip qtserialbus \
-skip qtspeech \
-skip qttranslations \
-skip qtsvg \
-skip qtwayland