QtWebengine build error with opus and silk codecs
-
This is like my fourth or fifth post regarding QtWebengine. I am almost spaming the Qt forum i guess.
I am trying to build Qt5.91 with QtWebengine for an arm platform.
These are some architecture based arguments i am passing to the build.QMAKE_CFLAGS_RELEASE += -march=armv7-a -mcpu=cortex-a9 QMAKE_CXXFLAGS_RELEASE += -march=armv7-a -mcpu=cortex-a9
By default the build is going these values as well.
-mfloat-abi=hard -mtune=generic-armv7-a -mfpu=vfpv3-d16 -mthumb
Below is my configuration summary
Building on: linux-g++ (i386, CPU features: <none>) Building for: linux-arm-g++ (arm, CPU features: <none>) Configuration: cross_compile compile_examples enable_new_dtags largefile precompile_header shared rpath release c++11 concurrent dbus mremap reduce_exports stl Build options: Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C++ standard ..................... C++11 Using gold linker ...................... no Using new DTAGS ........................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: NEON ................................. no Build parts ............................ libs Qt modules and options: Qt Concurrent .......................... yes Qt D-Bus ............................... yes Qt D-Bus directly linked to libdbus .... no Qt Gui ................................. yes Qt Network ............................. yes Qt Sql ................................. yes Qt Testlib ............................. yes Qt Widgets ............................. yes Qt Xml ................................. yes Support enabled for: Using pkg-config ....................... yes QML debugging .......................... yes udev ................................... yes Using system zlib ...................... yes Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... no iconv .................................. yes ICU .................................... no Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no Using system PCRE2 ..................... no Qt Network: getaddrinfo() .......................... yes getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no OpenSSL ................................ no Qt directly linked to OpenSSL ........ no SCTP ................................... no Use system proxies ..................... yes Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ yes HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. yes Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... no PNG .................................. yes Using system libpng ................ no EGL .................................... yes OpenVG ................................. no OpenGL: Desktop OpenGL ....................... no OpenGL ES 2.0 ........................ yes OpenGL ES 3.0 ........................ yes OpenGL ES 3.1 ........................ yes Session Management ..................... yes Features used by QPA backends: evdev .................................. yes libinput ............................... no INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon-evdev ........................ no QPA backends: DirectFB ............................... no EGLFS .................................. yes EGLFS details: EGLFS i.Mx6 .......................... no EGLFS i.Mx6 Wayland .................. no EGLFS EGLDevice ...................... no EGLFS GBM ............................ no EGLFS Mali ........................... no EGLFS Raspberry Pi ................... no EGL on X11 ........................... no LinuxFB ................................ yes VNC .................................... yes Mir client ............................. no Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows Qt PrintSupport: CUPS ................................... no Qt Sql: DB2 (IBM) .............................. no InterBase .............................. no MySql .................................. no OCI (Oracle) ........................... no ODBC ................................... no PostgreSQL ............................. no SQLite2 ................................ no SQLite ................................. yes Using system provided SQLite ......... no TDS (Sybase) ........................... no QtXmlPatterns: XML schema support ..................... yes Qt QML: QML interpreter ........................ yes QML network support .................... yes Qt Quick: Direct3D 12 ............................ no AnimatedImage item ..................... yes Canvas item ............................ yes Support for Qt Quick Designer .......... yes Flipable item .......................... yes GridView item .......................... yes ListView item .......................... yes Path support ........................... yes PathView item .......................... yes Positioner items ....................... yes ShaderEffect item ...................... yes Sprite item ............................ yes Qt Gamepad: SDL2 ................................... no Qt Bluetooth: BlueZ .................................. no BlueZ Low Energy ....................... no Linux Crypto API ....................... no Qt Sensors: sensorfw ............................... no Qt Multimedia: ALSA ................................... yes GStreamer 1.0 .......................... no GStreamer 0.10 ......................... no Video for Linux ........................ yes OpenAL ................................. no PulseAudio ............................. no Resource Policy (libresourceqt5) ....... no Windows Audio Services ................. no DirectShow ............................. no Windows Media Foundation ............... no Qt Quick Controls 2: Styles ................................. Default Material Universal Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... yes Qt Location: Gypsy GPS Daemon ....................... no WinRT Geolocation API .................. no Qt WebEngine: Embedded build ......................... yes Pepper Plugins ......................... no Printing and PDF ....................... no Proprietary Codecs ..................... yes Spellchecker ........................... yes WebRTC ................................. no Using system ninja ..................... no ALSA ................................... yes PulseAudio ............................. no System libraries: ICU .................................. no libwebp and libwebpdemux ............. no Opus ................................. no ffmpeg ............................... no Note: Also available for Linux: linux-clang linux-icc
This is the error i am getting.
Now my question is, is it absolutely necessary to use opus and silk for QtWebengine ? If not, how can i avoid it ?
Also why the build is trying to force-mfloat-abi=softfp
and-mfpu=neon
?
I did try a build with-mfpu=neon
and it is giving me undefined reference to many variiables.Thank you for your time.
Edit
I tried passing-no-opus
to the configuration and still got the same error. -
@name_qt The error message suggests a solution: -mfloat-abi=softfp -mfpu=neon
/opt/arm400-linux/lib/gcc/arm400-linux-gnueabi/4.8.3/include/arm_neon.h:32:2: error: #error You must enable NEON instructions (e.g. -mfloat-abi=softfp -mfpu=neon) to use arm_neon.h
Try to add -mfpu=neon
-
Does anyone have any suggestions ? I am stuck with this for the last couple of days.
I cross compiled opus separately and linked it with the Qt build. Now the error is something like this.
/opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: error: /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/third_party/WebKit/Source/core/libcore_generated.a(CSSOMKeywords.o) uses VFP register arguments, libQt5WebEngineCore.so.5.9.1 does not /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: failed to merge target specific data of file /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/third_party/WebKit/Source/core/libcore_generated.a(CSSOMKeywords.o) /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: error: /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/third_party/WebKit/Source/bindings/core/v8/libbindings_core_impl.a(V8StyleMedia.o) uses VFP register arguments, libQt5WebEngineCore.so.5.9.1 does not /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: failed to merge target specific data of file /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/third_party/WebKit/Source/bindings/core/v8/libbindings_core_impl.a(V8StyleMedia.o) /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: error: /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/third_party/WebKit/Source/core/css/libcss_1.a(CSSRuleList.o) uses VFP register arguments, libQt5WebEngineCore.so.5.9.1 does not /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: failed to merge target specific data of file /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/third_party/WebKit/Source/core/css/libcss_1.a(CSSRuleList.o) /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: error: /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/third_party/WebKit/Source/core/css/libcss_2.a(MediaValuesInitialViewport.o) uses VFP register arguments, libQt5WebEngineCore.so.5.9.1 does not /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: failed to merge target specific data of file /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/third_party/WebKit/Source/core/css/libcss_2.a(MediaValuesInitialViewport.o) /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: error: /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/third_party/WebKit/Source/core/layout/svg/libsvg.a(LayoutSVGTSpan.o) uses VFP register arguments, libQt5WebEngineCore.so.5.9.1 does not /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: failed to merge target specific data of file /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/third_party/WebKit/Source/core/layout/svg/libsvg.a(LayoutSVGTSpan.o) /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: error: /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/ui/gl/libgl_wrapper.a(gl_image_egl.o) uses VFP register arguments, libQt5WebEngineCore.so.5.9.1 does not /opt/arm400-linux/bin/../lib/gcc/arm400-linux-gnueabi/4.8.3/../../../../arm400-linux-gnueabi/bin/ld: failed to merge target specific data of file /opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core/Release/obj/ui/gl/libgl_wrapper.a(gl_image_egl.o) collect2: error: ld returned 1 exit status Makefile.core_module:81: recipe for target '../../lib/libQt5WebEngineCore.so.5.9.1' failed make[4]: *** [../../lib/libQt5WebEngineCore.so.5.9.1] Error 1 make[4]: Leaving directory '/opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core' Makefile:122: recipe for target 'sub-core_module-pro-make_first' failed make[3]: *** [sub-core_module-pro-make_first] Error 2 make[3]: Leaving directory '/opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src/core' Makefile:77: recipe for target 'sub-core-make_first' failed make[2]: *** [sub-core-make_first] Error 2 make[2]: Leaving directory '/opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine/src' Makefile:46: recipe for target 'sub-src-make_first' failed make[1]: *** [sub-src-make_first] Error 2 make[1]: Leaving directory '/opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.1/qtwebengine' Makefile:834: recipe for target 'module-qtwebengine-make_first' failed make: *** [module-qtwebengine-make_first] Error 2
-
Hi,
From the error message, one is built for soft-float and the other for hard-float. You should check the compilation flags that were used.
-
I don't know, but I don't think so but thumb instructions have several advantages that are pretty interesting in the embedded world. You should rather consider enabling it.
-
@SGaist
AFAIK, emulating neon in software will bring performance loss. My particular CPU hardware does not support neon and thereby, isn't it safe to disable it then ?
My CPU (cortex a9) does not support neon nor does the compiler.
-print-multi-lib
givesarmv5te_arm9;@mcpu=arm926ej-s a9;@mcpu=cortex-a9 a7;@mcpu=cortex-a7 armv5te_arm9_soft;@mcpu=arm926ej-s@mfloat-abi=soft armv5te_arm9_vfp;@mcpu=arm926ej-s@mfloat-abi=softfp@mfpu=vfp a9_soft;@mcpu=cortex-a9@mfloat-abi=soft a9_softfp_vfp;@mcpu=cortex-a9@mfloat-abi=softfp@mfpu=vfp a9_softfp_vfpv3-d16;@mcpu=cortex-a9@mfloat-abi=softfp@mfpu=vfpv3-d16 a7_soft;@mcpu=cortex-a7@mfloat-abi=soft a7_softfp_vfpv4;@mcpu=cortex-a7@mfloat-abi=softfp@mfpu=vfpv4 a7_softfp_neon-vfpv4;@mcpu=cortex-a7@mfloat-abi=softfp@mfpu=neon-vfpv4 a7_hard_neon-vfpv4;@mcpu=cortex-a7@mfloat-abi=hard@mfpu=neon-vfpv4
I am stuck with this error now
libxxxx.a(yyyyy.o) uses VFP register arguments, libQt5WebEngineCore.so.5.9.1 does not
-
Then you should create your own mkspecs that sets the correct flags for your processor.
-
@SGaist I am using my own qmake.conf.
# # qmake configuration for building with arm400-linux-g++ # MAKEFILE_GENERATOR = UNIX CONFIG += incremental QMAKE_INCREMENTAL_STYLE = sublib include(../common/linux.conf) include(../common/gcc-base-unix.conf) include(../common/g++-unix.conf) # modifications to g++.conf QMAKE_INCDIR +=/opt/arm400-linux/target/usr/include QMAKE_LIBDIR +=/opt/arm400-linux/target/usr/lib QMAKE_CC = arm400-linux-gcc QMAKE_CXX = arm400-linux-g++ QMAKE_LINK = arm400-linux-g++ -L/opt/arm400-linux/target/usr/lib -Wl,-rpath -Wl,/opt/arm400-linux/target/usr/lib QMAKE_LINK_SHLIB = arm400-linux-g++ -L/opt/arm400-linux/target/usr/lib -Wl,-rpath -Wl,/opt/arm400-linux/target/usr/lib QMAKE_CFLAGS_RELEASE += -march=armv7-a -mcpu=cortex-a9 QMAKE_CXXFLAGS_RELEASE += -march=armv7-a -mcpu=cortex-a9 # modifications to linux.conf QMAKE_AR = arm400-linux-ar cqs QMAKE_OBJCOPY = arm400-linux-objcopy QMAKE_STRIP = arm400-linux-strip load(qt_config)
I tried
QMAKE_CFLAGS_RELEASE += -march=armv7-a -mcpu=cortex-a9 -mfloat-abi=soft QMAKE_CXXFLAGS_RELEASE += -march=armv7-a -mcpu=cortex-a9 -mfloat-abi=soft
But it came out something like "
arm400-linux-g++: error: -mfloat-abi=soft and -mfloat-abi=hard may not be used together
". -
From the looks of it, your system looks like the
linux-tegra2-g++
mkspec, maybe this one will be more suited to copy from. -
@SGaist
I have tried all these combinations-mcpu=cortex-a9 -mfloat-abi=softfp -mfpu=vfp
-mcpu=cortex-a9 -mfloat-abi=softfp -mfpu=vfpv3-d16
-mtune=cortex-a9 -march=armv7-a -mhard-float -mfloat-abi=softfp -mfpu=vfpv3-d16
and i got the same error
libxxxx.a(yyyyy.o) uses VFP register arguments, libQt5WebEngineCore.so.5.9.1 does not
I tried the tegra2 mkspecs, but again another error.
ERROR at //build/config/android/internal_rules.gni:11:1: Assertion failed. assert(is_android) ^----- See //build/config/android/rules.gni:8:1: whence it was imported. import("//build/config/android/internal_rules.gni") ^------------------------------------------------- See //third_party/android_tools/BUILD.gn:5:1: whence it was imported. import("//build/config/android/rules.gni") ^---------------------------------------- See //third_party/openmax_dl/dl/BUILD.gn:199:16: which caused the file to be included. deps = [ "//third_party/android_tools:cpu_features" ] ^----------------------------------------- Project ERROR: GN run error! Makefile:80: recipe for target 'sub-gn_run-pro-make_first' failed make[3]: *** [sub-gn_run-pro-make_first] Error 3 make[3]: Leaving directory '/opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.2/qtwebengine/src/core' Makefile:77: recipe for target 'sub-core-make_first' failed make[2]: *** [sub-core-make_first] Error 2 make[2]: Leaving directory '/opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.2/qtwebengine/src' Makefile:46: recipe for target 'sub-src-make_first' failed make[1]: *** [sub-src-make_first] Error 2 make[1]: Leaving directory '/opt/qt/qt5.9.1arm_source/qt-everywhere-opensource-src-5.9.2/qtwebengine' Makefile:834: recipe for target 'module-qtwebengine-make_first' failed make: *** [module-qtwebengine-make_first] Error 2
-
Might be a silly question but did you nuke properly the build folder between tries ?
-
Ok, so when you said you tried the Tegra2 mkspec, did you just use it or did you copy from it into yours like I suggested ?
-
@SGaist This is how i used it.
include(../common/linux_device_pre.conf) QMAKE_INCDIR_POST += $$[QT_SYSROOT]/usr/include QMAKE_LIBDIR_POST += $$[QT_SYSROOT]/usr/lib QMAKE_RPATHLINKDIR_POST += $$[QT_SYSROOT]/usr/lib QMAKE_CFLAGS += -mtune=cortex-a9 -march=armv7-a -mhard-float -mfloat-abi=softfp -mfpu=vfpv3-d16 QMAKE_CXXFLAGS += -mtune=cortex-a9 -march=armv7-a -mhard-float -mfloat-abi=softfp -mfpu=vfpv3-d16 include(../common/linux_arm_device_post.conf) load(qt_config)
This is my qmake.conf.
-
From a quick look, somewhere around:
src/3rdparty/chromium/breakpad/src/build/common.gypi src/3rdparty/chromium/build/config/compiler/BUILD.gn src/3rdparty/chromium/build/common.gypi src/3rdparty/chromium/native_client/build/standalone_flags.gypi src/3rdparty/chromium/native_client/build/untrusted.gypi ./src/core/config/linux.pri: MFLOAT = $$extractCFlag("-mfloat-abi=.*")
-
Thanks @SGaist. This file had some information. I am not sure with the syntax to make changes in this file.
./src/core/config/linux.pri: MFLOAT = $$extractCFlag("-mfloat-abi=.*")
Whatever values I am giving to
QMAKE_CFLAGS_RELEASE
andQMAKE_CXXXFLAGS_RELEASE
is not what GN build is taking.Maybe if I figure out how to make changes in the file you have mentioned, I might be able to solve this issue.
-
In the file
qtwebengine/src/3rdparty/chromium/third_party/opus/BUILD.gn: use_opus_rtcd = current_cpu == "arm" && (is_win || is_android || is_linux)
qtwebengine/src/3rdparty/chromium/third_party/opus/BUILD.gn: if (use_opus_rtcd) { sources += [ "$target_gen_dir/celt_pitch_xcorr_arm_gnu.S", "src/celt/arm/arm_celt_map.c", "src/celt/arm/armcpu.c", "src/celt/arm/armcpu.h", "src/celt/arm/celt_neon_intr.c", "src/celt/arm/fft_arm.h", "src/celt/arm/mdct_arm.h", "src/celt/arm/pitch_arm.h", "src/silk/arm/NSQ_neon.c", "src/silk/arm/NSQ_neon.h", "src/silk/arm/arm_silk_map.c", ]
As far as I understood if the CPU is based on ARM and the OS is linux
use_opus_rtcd
becomes TRUE. If it becomes true,qtwebengine/src/3rdparty/chromium/third_party/opus/src/celt/arm/armcpu.c
decides whether it have the NEON capabilities. I am trying to see that changing armcpu.c to not to use NEON might work or not.