Cross-compile QtWebEngine for Raspberry 3
-
I am trying to cross compile QT 5.15.2 for a Raspberry Pi 3. I am following this guide: https://ebsolution31.wordpress.com/2020/10/08/cross-compile-qt/
I can cross compile qtbase, but I failed many times to cross compile qt-webengine. After the make command of the qtwebengine every times I get this error:
... [4/13058] /home/administrator/raspi/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -MMD -MF obj/third_party/zlib/bundled_zlib/deflate.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -DCR_SYSROOT_HASH=3fcc1d4e44127006318371002a0f421a4fde2ab4 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DZLIB_IMPLEMENTATION -DADLER32_SIMD_NEON -DINFLATE_CHUNK_SIMD_NEON -DCRC32_ARMV8_CRC32 -DARMV8_OS_LINUX -Igen -I../../3rdparty/chromium -I../../3rdparty/chromium/third_party/zlib -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -march=armv8-a -mfloat-abi=hard -mtune=cortex-a53 -mfpu=neon -mthumb -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -std=gnu11 --sysroot=../../../../../../sysroot -c ../../3rdparty/chromium/third_party/zlib/deflate.c -o obj/third_party/zlib/bundled_zlib/deflate.o FAILED: obj/third_party/zlib/bundled_zlib/deflate.o /home/administrator/raspi/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf-gcc -MMD -MF obj/third_party/zlib/bundled_zlib/deflate.o.d -DUSE_UDEV -DUSE_AURA=1 -DUSE_NSS_CERTS=1 -DUSE_OZONE=1 -DOFFICIAL_BUILD -DTOOLKIT_QT -D_FILE_OFFSET_BITS=64 -D_LARGEFILE_SOURCE -D_LARGEFILE64_SOURCE -DNO_UNWIND_TABLES -DCR_SYSROOT_HASH=3fcc1d4e44127006318371002a0f421a4fde2ab4 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DZLIB_IMPLEMENTATION -DADLER32_SIMD_NEON -DINFLATE_CHUNK_SIMD_NEON -DCRC32_ARMV8_CRC32 -DARMV8_OS_LINUX -Igen -I../../3rdparty/chromium -I../../3rdparty/chromium/third_party/zlib -fno-strict-aliasing --param=ssp-buffer-size=4 -fstack-protector -fno-unwind-tables -fno-asynchronous-unwind-tables -fPIC -pipe -pthread -march=armv8-a -mfloat-abi=hard -mtune=cortex-a53 -mfpu=neon -mthumb -O2 -fno-ident -fdata-sections -ffunction-sections -fno-omit-frame-pointer -g0 -fvisibility=hidden -Wno-psabi -Wno-unused-local-typedefs -Wno-maybe-uninitialized -Wno-deprecated-declarations -fno-delete-null-pointer-checks -Wno-comments -Wno-packed-not-aligned -Wno-dangling-else -Wno-missing-field-initializers -Wno-unused-parameter -std=gnu11 --sysroot=../../../../../../sysroot -c ../../3rdparty/chromium/third_party/zlib/deflate.c -o obj/third_party/zlib/bundled_zlib/deflate.o In file included from ../../3rdparty/chromium/third_party/zlib/deflate.c:54:0: ../../3rdparty/chromium/third_party/zlib/contrib/optimizations/insert_string.h:58:42: error: attribute(target("arch=armv8-a+crc")) is unknown const Pos str) { ^~~~~ cc1: warning: unrecognized command line option ‘-Wno-packed-not-aligned’ ... ninja: build stopped: subcommand failed. make[3]: *** [Makefile.gn_run:344: run_ninja] Error 1 make[3]: Leaving directory '/home/administrator/raspi/qt_source/qt_5.15.2/qtwebengine/src/core' make[2]: *** [Makefile:82: sub-gn_run-pro-make_first] Error 2 make[2]: Leaving directory '/home/administrator/raspi/qt_source/qt_5.15.2/qtwebengine/src/core' make[1]: *** [Makefile:79: sub-core-make_first] Error 2 make[1]: Leaving directory '/home/administrator/raspi/qt_source/qt_5.15.2/qtwebengine/src' make: *** [Makefile:49: sub-src-make_first] Error 2
I saw in many forum that could be related to a RAM problems or a lack of resources. I have tried to give the command on a 16 GB RAM machine and also tried to create a big swapfile without any result.
I saw that there are these 2 rows:FAILED: obj/third_party/zlib/bundled_zlib/deflate.o error: attribute(target("arch=armv8-a+crc")) is unknown
Could you please help me to find a solution? Thanks
I will post my .config summary configuration of the qtwebengine:
Configure summary QTWEBENGINE: Qt WebEngine Build Tools: Use System Ninja ....................... yes Use System Gn .......................... no Jumbo Build Merge Limit ................ 8 Developer build ........................ no Sanitizer .............................. no QtWebEngine required system libraries: fontconfig ........................... yes dbus ................................. yes nss .................................. yes khr .................................. yes glibc ................................ yes Optional system libraries used: re2 .................................. no icu .................................. no libwebp, libwebpmux and libwebpdemux . no opus ................................. no ffmpeg ............................... no libvpx ............................... no snappy ............................... no glib ................................. yes zlib ................................. yes minizip .............................. no libevent ............................. no jsoncpp .............................. no protobuf ............................. no libxml2 and libxslt .................. yes lcms2 ................................ yes png .................................. yes JPEG ................................. yes harfbuzz ............................. no freetype ............................. yes Qt WebEngineCore: Embedded build ......................... yes Full debug information ................. no Pepper Plugins ......................... no Printing and PDF ....................... no Proprietary Codecs ..................... yes Spellchecker ........................... yes Native Spellchecker .................... no WebRTC ................................. no PipeWire over GIO ...................... no Geolocation ............................ no WebChannel support ..................... no Kerberos Authentication ................ no Extensions ............................. no Node.js ................................ yes Support qpa-xcb ........................ no Building v8 snapshot supported ......... yes Use ALSA ............................... yes Use PulseAudio ......................... yes Qt WebEngineQml: Support Qt WebEngine Qml ............... yes UI Delegates ........................... yes Test Support ........................... no Qt WebEngineWidgets: Support Qt WebEngine Widgets ........... yes Qt PDF: Support V8 ............................. no Support XFA ............................ no Support XFA-BMP ........................ no Support XFA-GIF ........................ no Support XFA-PNG ........................ no Support XFA-TIFF ....................... no Qt PDF Widgets: Support Qt PDF Widgets ................. yes Qt is now configured for building. Just run 'make'. Once everything is built, you must run 'make install'. Qt will be installed into '/home/administrator/raspi/qt5pi'. Prior to reconfiguration, make sure you remove any leftovers from the previous build.
-
@DiegOne
On Linux, Clang or GCC version 5 or later is required. Supported configurations are linux-g++, linux-clang and linux-clang-libc++
https://doc.qt.io/qt-5/qtwebengine-platform-notes.html
Skip the not supported modules. Also the ones you'd not need.
-
Thanks for your answer. By the way I have used a gcc 7.4.1.
This is my command to configure qtbase:
./configure -release -opengl es2 -device linux-rasp-pi3-vc4-g++ -device-option CROSS_COMPILE=~/raspi/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -opensource -confirm-license -nomake tests -nomake examples -make libs -verbose -no-pch -eglfs -no-xcb -no-use-gold-linker -sysroot ~/raspi/sysroot -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -no-gbm -libinput -libudev
What you are suggesting to change with your comment?
Thanks -
@artwaw said in Cross-compile QtWebEngine for Raspberry 3:
Skip the not supported modules. Also the ones you'd not need.
https://doc.qt.io/qt-5/configure-options.html
-skip qtwebengine
and every module you don't need or is not supported. -
@jsulm thanks but my goal is to cross compile qtwebengine.
In the guide I follow I can correctly build qtbase with the configure command I posted in the previous comment but when I try to build qtwebengine I get the error I described above. This is my procedure to build qtwebengine:cd ~/raspi/qt_source/qt_5.15.2 git clone https://code.qt.io/qt/qtwebengine.git cd qtwebengine/ git submodule init git checkout 5.15.2 git submodule update ~/raspi/qt5/bin/qmake -- -webengine-proprietary-codecs make ERROR DESCRIBED ABOVE
-
@DiegOne said in Cross-compile QtWebEngine for Raspberry 3:
Sorry, I can't understand if you are so general.
I was not general, you simply did not read the documentation that I linked. Then you would know what configure options are and how you can use them.
@DiegOne said in Cross-compile QtWebEngine for Raspberry 3:
my goal is to cross compile qtwebengine
Again, should you read the link I posted a few posts above - The QtWebEngine Platform Notes - you'd see that for this module the platform you want to compile for is not supported.
-
@artwaw
Thanks for your answer. I read and I re-read everything but for me is not clear since I am a beginner in qt and in cross compilation.
With this phrase:
"Supported configurations are linux-g++, linux-clang and linux-clang-libc++"
Are you telling me that it is not possible to cross-compile QtWebEngine for Raspberry 3? Why there are many guides talking about that?
In the link I also notice this phrase:
"It means that Qt WebEngine 5.15 can be built with Qt 5.12.x, Qt 5.14.x, and Qt 5.15."
Maybe should I try to cross compile version qt5.15 instead of qt 5.15.2?
Thanks in advance and I am sorry if I could not get the point. -
@DiegOne said in Cross-compile QtWebEngine for Raspberry 3:
Why there are many guides talking about that?
Ask the ones who wrote them? They obviously seem to know better.
According to the documentation it is not supported and likely not possible. If you find a way that works and can be replicated please do share as I think many people will be grateful.
-
-
@DiegOne said in Cross-compile QtWebEngine for Raspberry 3:
error: attribute(target("arch=armv8-a+crc")) is unknown
i think your issue is that the function has the attribute
target("arch=armv8-a+crc")
defined.
but according to your compile call your are only compiling with-march=armv8-a
. So the+crc
is missing. But better would be to find the cause why it wrongly detects that it wants the crc extension.Read this for more details about the compiler option.
Also this guides says to configure Qt with
-device linux-rasp-pi3-vc4-g++
options. This enables hw acceleration via KMS, which must be supported by the Linux kernel on the Pi (i dont know thats the case, might be). Whereas-device linux-rasp-pi3-g++
would use the default Broadcom graphics stack.
Is that really desired by you?check the file
qtbase/mkspecs/devices/<DEVICE-OPTION>/qmake.conf
in that file you could also add the+crc
extension flag