Details
-
Bug
-
Resolution: Won't Do
-
P2: Important
-
None
-
5.10.0, 5.10.1
-
None
-
Cross-build setup with an {{i386}} or {{amd64}} host and {{armhf}} target (Raspberry Pi without X11)
* Host: Debian 9.4.0, both i386 in a 32-Bit virtual machine (VirtualBox) as well as amd64 in a 64-bit VM
* Host's toolchain: standard debian stretch package {{build-essential}}
* Host's armhf cross-toolchain: standard debian stretch package {{crossbuild-essential-armhf}}
* Target: Raspbian Stretch Lite 2017-11-29/2018-04-18 on a Raspberry Pi 3 (treated as a Pi 2)
I can build Qt 5.9.3 without problems using this cross-build setup.Cross-build setup with an {{i386}} or {{amd64}} host and {{armhf}} target (Raspberry Pi without X11) * Host: Debian 9.4.0, both i386 in a 32-Bit virtual machine (VirtualBox) as well as amd64 in a 64-bit VM * Host's toolchain: standard debian stretch package {{build-essential}} * Host's armhf cross-toolchain: standard debian stretch package {{crossbuild-essential-armhf}} * Target: Raspbian Stretch Lite 2017-11-29/2018-04-18 on a Raspberry Pi 3 (treated as a Pi 2) I can build Qt 5.9.3 without problems using this cross-build setup.
Description
Hello, cross-building fails with this linker error (at libQt5WebEngineCore.so, I shortened this instruction and replaced a bunch of objects in the middle with [...] to reducde the clutter):
arm-linux-gnueabihf-g++ -mfloat-abi=hard --sysroot=/home/cs/qt5.10.0/sysroot -Wl,--no-undefined -Wl,--version-script,QtWebEngineCore.version -Wl,--gc-sections -Wl,-O1 -Wl,-z,now -Wl,-z,defs -Wl,-O1 -fuse-ld=gold -Wl,--enable-new-dtags -Wl,-z,origin -Wl,-rpath,\$ORIGIN -Wl,-rpath-link,/home/cs/qt5.10.0/sysroot/opt/vc/lib -Wl,-rpath-link,/home/cs/qt5.10.0/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/cs/qt5.10.0/sysroot/lib/arm-linux-gnueabihf -shared -Wl,-soname,libQt5WebEngineCore.so.5 -o libQt5WebEngineCore.so.5.10.0 -L/home/cs/qt5.10.0/sysroot/opt/vc/lib -L/home/cs/qt5.10.0/build/qtdeclarative/lib -lQt5Quick -L/home/cs/qt5.10.0/sysroot/opt/vc/lib -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Gui -L/home/cs/qt5.10.0/build/qtdeclarative/lib -lQt5Qml -lQt5Network -lQt5Core -lpthread -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Gui -L/home/cs/qt5.10.0/sysroot/opt/vc/lib -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Core -lpthread -L/home/cs/qt5.10.0/build/qtwebchannel/lib -lQt5WebChannel -L/home/cs/qt5.10.0/build/qtdeclarative/lib -lQt5Qml -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Network -lQt5Core -lpthread -lQt5Qml -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Network -lQt5Core -lpthread -lQt5Network -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Core -lpthread -L/home/cs/qt5.10.0/build/qtlocation/lib -lQt5Positioning -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Core -lpthread -lQt5Core -lpthread -lpthread @/home/cs/qt5.10.0/build/qtwebengine/src/core/release/Qt5WebEngineCore.rsp -Wl,--start-group /home/cs/qt5.10.0/build/qtwebengine/src/core/release/obj/base/libbase.a [...] /home/cs/qt5.10.0/build/qtwebengine/src/core/release/obj/third_party/hunspell/libhunspell.a -Wl,--end-group -L/home/cs/qt5.10.0/sysroot/usr/lib/arm-linux-gnueabihf -lQt5Quick -L/home/cs/qt5.10.0/sysroot/opt/vc/lib -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Gui -L/home/cs/qt5.10.0/build/qtdeclarative/lib -lQt5Qml -lQt5Network -lQt5Core -lpthread -lQt5Gui -L/home/cs/qt5.10.0/sysroot/opt/vc/lib -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Core -lpthread -lQt5WebChannel -L/home/cs/qt5.10.0/build/qtdeclarative/lib -lQt5Qml -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Network -lQt5Core -lpthread -lQt5Qml -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Network -lQt5Core -lpthread -lQt5Network -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Core -lpthread -lQt5Positioning -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Core -lpthread -lQt5Core -lpthread -lGLESv2 -lbcm_host -lvcos -lvchiq_arm -lpthread -ldl -lrt -lnss3 -lnssutil3 -lsmime3 -lplds4 -lplc4 -lnspr4 -levent -lresolv -lfreetype -lfontconfig -ljpeg -lpng16 -lwebpmux -lwebpdemux -lwebp -lexpat -lre2 -lpci -lopus -lasound -lm -lz -ldbus-1 -lxml2 -lxslt -L/home/cs/qt5.10.0/build/qtwebengine/src/core/api/release -Wl,-whole-archive -lqtwebenginecoreapi -Wl,-no-whole-archive -lEGL -lGLESv2 -lQt5Quick -L/home/cs/qt5.10.0/sysroot/opt/vc/lib -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Gui -L/home/cs/qt5.10.0/build/qtdeclarative/lib -lQt5Qml -lQt5Network -lQt5Core -lpthread -lQt5Gui -L/home/cs/qt5.10.0/sysroot/opt/vc/lib -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Core -lpthread -lQt5Qml -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Network -lQt5Core -lpthread -lQt5Network -L/home/cs/qt5.10.0/build/qtbase/lib -lQt5Core -lpthread -lQt5Core -lpthread -lGLESv2 -lbcm_host -lvcos -lvchiq_arm /home/cs/qt5.10.0/build/qtwebengine/src/core/release/obj/ui/ozone/common/common/gl_ozone_egl.o:gl_ozone_egl.cc:function ui::GLOzoneEGL::InitializeGLOneOffPlatform(): error: undefined reference to 'gl::GLSurfaceEGL::InitializeOneOff(int)'
Upon inspection it turned out that
- qt-everywhere-src-5.10.0/qtwebengine/src/3rdparty/chromium/ui/ozone/common/gl_ozone_egl.cc includes header file ui/gl/gl_surface_egl.h
- header gl_surface_egl.h declares class gl::GLSurfaceEGL and also its static method InitializeOneOff(int), the one the linker is missing
- class gl::GLSurfaceEGL is implemented in ui/gl/gl_surface_egl.cc, but
- ui/gl/gl_surface_egl.cc gets never compiled and linked to libQt5WebEngineCore.so, thus leading to the linker failure in my build
The last point can be demonstrated by running find . -name 'gl_surface*' in your build directory which in my case only yíelds:
$ find . -name 'gl_surface*'
./qtwebengine/src/core/Release/obj/QtWebEngineCore/gl_surface_qt.o
./qtwebengine/src/core/Release/obj/ui/gl/gl/gl_surface.o
./qtwebengine/src/core/Release/obj/ui/gl/gl/gl_surface_overlay.o
./qtwebengine/src/core/Release/obj/ui/gl/gl/gl_surface_osmesa.o
./qtwebengine/src/core/Release/obj/ui/gl/gl/gl_surface_stub.o
To see if it helps I removed the two references to the missing class gl::GLSurfaceEGL in gl_ozone_egl.cc. In method InitializeGLOneOffPlatform() I simply replaced the whole method body with return false;.
I then called make again to continue the build from where it had failed, and indeed, the build finished through until the end without further problems (runs very nice on the Pi).
First attempts to add gl_surface_egl.{cc|o} myself failed with lots of linker conflicts, it seems it's not meant to be mixed in. How can this be fixed?
What will my crude workaround break (couldn't find any problems so far), what is Ozone?