Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Cannot cross-compile Qt5.15.0 on RaspberryPi4 because V8 Snapshot support keeps from configuring QtWebEngine properly
Forum Updated to NodeBB v4.3 + New Features

Cannot cross-compile Qt5.15.0 on RaspberryPi4 because V8 Snapshot support keeps from configuring QtWebEngine properly

Scheduled Pinned Locked Moved Solved Mobile and Embedded
8 Posts 2 Posters 1.2k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • J Offline
    J Offline
    JCRacine
    wrote on last edited by JCRacine
    #1

    Hi!

    My system specs are:
    Host: Ubuntu 20.04 LTS
    Target: Raspberry Pi 4 with Raspbian GNU/Linux 10 Buster
    Compiler: GCC Linaro 7.4.1 2019.02 x86-64 Arm-Linux-Gnueabihf

    I'm cross compiling Qt5.15.0 on a Raspberry Pi 4 and I'm stuck when trying to configure QTWebEngine.
    I've used this guide to setup my environment and everything is fine when I configure everything else but QtWebEngine. (I tried compiling it and tested it on my device.)

    Every time I get this error:
    WARNING: V8 snapshot cannot be built. Most likely, the 64-bit host compiler does not work. Please make sure you have 32-bit devel environment installed.

    I've dug more into the issue and this is the error found in the config.log file:

    Checking for host compiler... 
    + cd /home/user/raspberrypi/build/config.tests/hostcompiler && PKG_CONFIG_SYSROOT_DIR=/home/user/raspberrypi/sysroot PKG_CONFIG_LIBDIR=/home/user/raspberrypi/sysroot/usr/lib/pkgconfig:/home/user/raspberrypi/sysroot/usr/share/pkgconfig:/home/user/raspberrypi/sysroot/usr/lib/arm-linux-gnueabihf/pkgconfig /home/user/raspberrypi/build/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" -early "CONFIG += cross_compile" /home/user/raspberrypi/qt-everywhere-src-5.15.0/qtwebengine/config.tests/hostcompiler
    + cd /home/user/raspberrypi/build/config.tests/hostcompiler && MAKEFLAGS= /usr/bin/make
    > g++ -c -pipe -m32 -O2 -w -fPIC  -I/home/user/raspberrypi/qt-everywhere-src-5.15.0/qtwebengine/config.tests/hostcompiler -I. -I/home/user/raspberrypi/qt-everywhere-src-5.15.0/qtbase/mkspecs/linux-g++ -o main.o /home/user/raspberrypi/qt-everywhere-src-5.15.0/qtwebengine/config.tests/hostcompiler/main.cpp
    > In file included from /home/user/raspberrypi/qt-everywhere-src-5.15.0/qtwebengine/config.tests/hostcompiler/main.cpp:29:
    > /usr/include/stdio.h:27:10: fatal error: bits/libc-header-start.h: No such file or directory
    >    27 | #include <bits/libc-header-start.h>
    >       |          ^~~~~~~~~~~~~~~~~~~~~~~~~~
    > compilation terminated.
    > make: *** [Makefile:169: main.o] Error 1
    test config.qtwebengine_core.tests.webengine-host-compiler FAILED
    Done running configuration tests.
    

    I don't understand why g++ was called on my host if I provided a compiler with the appropriate sysroot that contains the files the test needs?

    Here is the options I passed to configure (I made a bash script):

    
    COMPILER_PATH=~/raspberrypi/tools/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf
    SYSROOT_PATH=~/raspberrypi/sysroot
    
    LDFLAGS="-L${SYSROOT_PATH}/lib/arm-linux-gnueabihf -L${COMPILER_PATH}/lib/ -L${COMPILER_PATH}/arm-linux-gnueabihf/lib/ -L${COMPILER_PATH}/arm-linux-gnueabihf/libc/usr/lib/ -L${COMPILER_PATH}/arm-linux-gnueabihf/libc/lib/ -L${SYSROOT_PATH}/lib -L${SYSROOT_PATH}/usr/lib -L${SYSROOT_PATH}/usr/lib/arm-linux-gnueabihf -L${SYSROOT_PATH}/lib/arm-linux-gnueabihf"
    
    ../qt-everywhere-src-5.15.0/configure \
    	-release \
    	-opensource -confirm-license \
    	-opengl es2 \
    	-eglfs \
    	-xcb \
    	-device linux-rasp-pi4-v3d-g++ \
    	-device-option CROSS_COMPILE=${COMPILER_PATH}/bin/arm-linux-gnueabihf- \
    	-sysroot ${SYSROOT_PATH} \
    	-prefix /usr/local/qt5pi \
    	-extprefix ~/raspberrypi/qt5pi \
    	-hostprefix ~/raspberrypi/qt5pi \
    	-skip qtscript \
    	-skip qtwayland \
    	-no-webengine-geolocation \
    	-nomake tests \
    	-nomake examples \
    	-make libs \
    	-pkg-config \
    	-no-use-gold-linker \
    	-v \
    	-recheck
    
    1 Reply Last reply
    0
    • J Offline
      J Offline
      JCRacine
      wrote on last edited by JCRacine
      #2

      Update:
      I tried a couple of things and read stuff on the web and i figured out how to enable or disable the feature.
      You just have to pass this to configure:
      (-no)-feature-webengine-v8-snapshot-support

      Enabling it just makes it so the configure fails so I'm gonna try to disable it and see what happens.

      Edit:
      This is the message shown as the configuration fails:
      ERROR: Feature 'webengine-v8-snapshot-support' was enabled, but the pre-condition '!config.unix || !features.cross_compile || arch.arm64 || tests.webengine-host-compiler' failed.

      Pablo J. RoginaP 1 Reply Last reply
      0
      • J JCRacine

        Update:
        I tried a couple of things and read stuff on the web and i figured out how to enable or disable the feature.
        You just have to pass this to configure:
        (-no)-feature-webengine-v8-snapshot-support

        Enabling it just makes it so the configure fails so I'm gonna try to disable it and see what happens.

        Edit:
        This is the message shown as the configuration fails:
        ERROR: Feature 'webengine-v8-snapshot-support' was enabled, but the pre-condition '!config.unix || !features.cross_compile || arch.arm64 || tests.webengine-host-compiler' failed.

        Pablo J. RoginaP Offline
        Pablo J. RoginaP Offline
        Pablo J. Rogina
        wrote on last edited by
        #3

        @JCRacine said in Cannot cross-compile Qt5.15.0 on RaspberryPi4 because V8 Snapshot support keeps from configuring QtWebEngine properly:

        ... pre-condition ...
        ... || arch.arm64 || ...

        Although I'm not well versed on Qt Webengine cross-compilation, from that error message I understand that you're missing a cross-compiler capable of ARM64 output

        Upvote the answer(s) that helped you solve the issue
        Use "Topic Tools" button to mark your post as Solved
        Add screenshots via postimage.org
        Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

        J 1 Reply Last reply
        0
        • Pablo J. RoginaP Pablo J. Rogina

          @JCRacine said in Cannot cross-compile Qt5.15.0 on RaspberryPi4 because V8 Snapshot support keeps from configuring QtWebEngine properly:

          ... pre-condition ...
          ... || arch.arm64 || ...

          Although I'm not well versed on Qt Webengine cross-compilation, from that error message I understand that you're missing a cross-compiler capable of ARM64 output

          J Offline
          J Offline
          JCRacine
          wrote on last edited by
          #4

          @Pablo-J-Rogina
          That seems like a problem since I'm using a 32bit Raspbian and I don't think the 64bit version is at a stable release yet?

          Pablo J. RoginaP 1 Reply Last reply
          0
          • J JCRacine

            @Pablo-J-Rogina
            That seems like a problem since I'm using a 32bit Raspbian and I don't think the 64bit version is at a stable release yet?

            Pablo J. RoginaP Offline
            Pablo J. RoginaP Offline
            Pablo J. Rogina
            wrote on last edited by
            #5

            @JCRacine said in Cannot cross-compile Qt5.15.0 on RaspberryPi4 because V8 Snapshot support keeps from configuring QtWebEngine properly:

            the 64bit version is at a stable release yet?

            Not yet that I know, but you may want to use Arch Linux ARM or Ubuntu OS which both provide 64 bit versions.

            Upvote the answer(s) that helped you solve the issue
            Use "Topic Tools" button to mark your post as Solved
            Add screenshots via postimage.org
            Don't ask support requests via chat/PM. Please use the forum so others can benefit from the solution in the future

            J 1 Reply Last reply
            0
            • Pablo J. RoginaP Pablo J. Rogina

              @JCRacine said in Cannot cross-compile Qt5.15.0 on RaspberryPi4 because V8 Snapshot support keeps from configuring QtWebEngine properly:

              the 64bit version is at a stable release yet?

              Not yet that I know, but you may want to use Arch Linux ARM or Ubuntu OS which both provide 64 bit versions.

              J Offline
              J Offline
              JCRacine
              wrote on last edited by
              #6

              @Pablo-J-Rogina
              After thinking about it, I'm not sure if the "arch.arm64" condition refers to the host's arch of the target's?
              I know that the QMake variable for the host is QT_ARCH and the target is QT_TARGET_ARCH.
              Am I wrong to think that the condition refers to the host and not the target?

              1 Reply Last reply
              0
              • J Offline
                J Offline
                JCRacine
                wrote on last edited by JCRacine
                #7

                Update:
                Installing these packages seemed to have solved the issue with the 32 bit requirement for the host compiler, but I'm not sure if that will solve my problem or if it will work on my Raspberry Pi. I'm keeping you updated!!

                Installed via apt on Ubuntu:
                gcc-multilib g++-multilib libc6-dev-i386

                1 Reply Last reply
                0
                • J Offline
                  J Offline
                  JCRacine
                  wrote on last edited by
                  #8

                  Update:
                  So that did the trick! Just one thing tho: chromium is built with Ninja by default, so if you don't specify the number of jobs for Ninja, be sure to have a LOT of RAM available. Alternatively. you can just use make -j# NINJAJOBS=-j# where # is the number of jobs max. I put 6 and still had to wait like ~3 hours to compile!

                  1 Reply Last reply
                  0

                  • Login

                  • Login or register to search.
                  • First post
                    Last post
                  0
                  • Categories
                  • Recent
                  • Tags
                  • Popular
                  • Users
                  • Groups
                  • Search
                  • Get Qt Extensions
                  • Unsolved