Cross compilation and Qt configuration issue with Xlib
-
I'm trying to configure Qt to cross compile it for a different OS (Debian Stretch) than my host.
I built a toolchain using Crosstool-NG and have a copy of my target sysroot on my host.
I can't manage to get the EGLFS on X11 feature since Xlib test fails at config time.
Here the configure output:
Building on: linux-g++ (x86_64, CPU features: mmx sse sse2) Building for: devices/linux-generic-g++ (x86_64, CPU features: mmx sse sse2) Target compiler: gcc 8.2.0 Configuration: cross_compile use_gold_linker sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples enable_new_dtags f16c largefile precompile_header rdrnd shani x86SimdAlways shared rpath release c++11 c++14 c++1z concurrent dbus reduce_exports reduce_relocations stl Build options: Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C standard ....................... C11 Using C++ standard ..................... C++1z Using ccache ........................... no Using gold linker ...................... yes Using new DTAGS ........................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2 AVX .................................. AVX AVX2 AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI Other x86 ............................ AES F16C RDRAND SHA Intrinsics without -mXXX option ...... yes 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 udev ................................... yes Using system zlib ...................... yes Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... yes iconv .................................. no ICU .................................... yes Tracing backend ........................ <none> Logging backends: journald ............................. yes syslog ............................... no slog2 ................................ no Using system PCRE2 ..................... no Qt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no Linux AF_NETLINK ....................... yes OpenSSL ................................ yes Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ yes DTLS ................................... yes 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 ................ yes EGL .................................... yes OpenVG ................................. no OpenGL: Desktop OpenGL ....................... yes OpenGL ES 2.0 ........................ no OpenGL ES 3.0 ........................ no OpenGL ES 3.1 ........................ no OpenGL ES 3.2 ........................ no Vulkan ................................. no Session Management ..................... yes Features used by QPA backends: evdev .................................. yes libinput ............................... yes INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon .............................. yes X11 specific: XLib ................................. no XCB Xlib ............................. no EGL on X11 ........................... no QPA backends: DirectFB ............................... no EGLFS .................................. yes EGLFS details: EGLFS OpenWFD ........................ no EGLFS i.Mx6 .......................... no EGLFS i.Mx6 Wayland .................. no EGLFS RCAR ........................... no EGLFS EGLDevice ...................... yes EGLFS GBM ............................ no EGLFS VSP2 ........................... no EGLFS Mali ........................... no EGLFS Raspberry Pi ................... no EGLFS X11 ............................ no LinuxFB ................................ yes VNC .................................... yes Mir client ............................. no XCB: Using system-provided XCB libraries .. no XCB XKB .............................. no XCB XInput ........................... yes Native painting (experimental) ....... no GL integrations: GLX Plugin ......................... no EGL-X11 Plugin ..................... no Qt Sql: SQL item models ........................ yes Qt Widgets: GTK+ ................................... no Styles ................................. Fusion Windows Qt PrintSupport: CUPS ................................... no Qt Sql Drivers: 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 Qt Testlib: Tester for item models ................. yes Qt SerialBus: Socket CAN ............................. yes Socket CAN FD .......................... yes Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML sequence object .................... yes QML list model ......................... yes QML XML http request ................... yes QML Locale ............................. yes QML delegate model ..................... 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 TableView item ......................... yes Path support ........................... yes PathView item .......................... yes Positioner items ....................... yes Repeater item .......................... yes ShaderEffect item ...................... yes Sprite item ............................ yes Qt Scxml: ECMAScript data model for QtScxml ...... yes Qt Gamepad: SDL2 ................................... no Qt 3D: Assimp ................................. yes System Assimp .......................... no Output Qt3D Job traces ................. no Output Qt3D GL traces .................. no Use SSE2 instructions .................. yes Use AVX2 instructions .................. no Aspects: Render aspect ........................ yes Input aspect ......................... yes Logic aspect ......................... yes Animation aspect ..................... yes Extras aspect ........................ yes Qt 3D Renderers: OpenGL Renderer ........................ yes Qt 3D GeometryLoaders: Autodesk FBX ........................... no Qt Wayland Drivers: EGL .................................... yes Raspberry Pi ........................... no XComposite EGL ......................... no XComposite GLX ......................... no DRM EGL ................................ yes libhybris EGL .......................... no Shm emulation server buffer integration . yes Qt Wayland Client ........................ yes Qt Wayland Compositor .................... yes Qt Wayland Compositor Layer Plugins: VSP2 hardware layer integration ........ no Qt Bluetooth: BlueZ .................................. no BlueZ Low Energy ....................... no Linux Crypto API ....................... no WinRT Bluetooth API (desktop & UWP) .... no Qt Sensors: sensorfw ............................... no Qt Quick Controls 2: Styles ................................. Default Fusion Imagine Material Universal Qt Quick Templates 2: Hover support .......................... yes Multi-touch support .................... yes Qt Positioning: Gypsy GPS Daemon ....................... no WinRT Geolocation API .................. no Qt Location: Qt.labs.location experimental QML plugin . yes Geoservice plugins: OpenStreetMap ........................ yes HERE ................................. yes Esri ................................. yes Mapbox ............................... yes MapboxGL ............................. yes Itemsoverlay ......................... yes QtXmlPatterns: XML schema support ..................... yes Qt Multimedia: ALSA ................................... no GStreamer 1.0 .......................... yes GStreamer 0.10 ......................... no Video for Linux ........................ yes OpenAL ................................. no PulseAudio ............................. yes Resource Policy (libresourceqt5) ....... no Windows Audio Services ................. no DirectShow ............................. no Windows Media Foundation ............... no Qt Tools: QDoc ................................... no Qt WebEngine: Embedded build ......................... yes Pepper Plugins ......................... no Printing and PDF ....................... no Proprietary Codecs ..................... no Spellchecker ........................... yes Native Spellchecker .................... no WebRTC ................................. no Use System Ninja ....................... no Geolocation ............................ yes WebChannel support ..................... yes Use v8 snapshot ........................ yes Kerberos Authentication ................ no Building v8 snapshot supported ......... yes Use ALSA ............................... no Use PulseAudio ......................... 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 .................. no lcms2 ................................ no png .................................. yes JPEG ................................. no harfbuzz ............................. no freetype ............................. yes x11 .................................. yes Required system libraries: fontconfig ........................... yes dbus ................................. no nss .................................. no khr .................................. yes glibc ................................ yes Required system libraries for qpa-xcb: libdrm ............................... yes xcomposite ........................... no xcursor .............................. no xi ................................... yes xrandr ............................... no xtst ................................. no Note: Also available for Linux: linux-clang linux-icc Note: PKG_CONFIG_LIBDIR automatically set to /home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/pkgconfig:/home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/share/pkgconfig:/home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/x86_64-linux-gnu/pkgconfig Note: PKG_CONFIG_SYSROOT_DIR automatically set to /home/e381734/workspace/qt/cross-compile/debian/sysroot Note: journald, syslog or slog2 integration is enabled. If your users intend to develop applications against this build, ensure that the IDEs they use either set QT_FORCE_STDERR_LOGGING to 1 or are able to read the logged output from journald, syslog or slog2. Note: Disabling X11 Accessibility Bridge: D-Bus or AT-SPI is missing. WARNING: QDoc will not be compiled, probably because libclang could not be located. This means that you cannot build the Qt documentation. Either ensure that llvm-config is in your PATH environment variable, or set LLVM_INSTALL_DIR to the location of your llvm installation. On Linux systems you may be able to install libclang from a package. On macOS you could use Homebrew's llvm package. On Windows you need to set LLVM_INSTALL_DIR to the installation path.
Here is the xlib config test verbose output:
Using built-in specs. COLLECT_GCC=/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/bin/x86_64-linux-gnu-g++ COLLECT_LTO_WRAPPER=/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/libexec/gcc/x86_64-linux-gnu/8.2.0/lto-wrapper Target: x86_64-linux-gnu Configured with: /home/e381734/workspace/toolchain/x86_64-linux-gnu-8.2.0/.build/x86_64-linux-gnu/src/gcc/configure --build=x86_64-build_pc-linux-gnu --host=x86_64-build_pc-linux-gnu --target=x86_64-linux-gnu --prefix=/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0 --with-sysroot=/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/x86_64-linux-gnu/sysroot --enable-languages=c,c++ --with-pkgversion='crosstool-NG 1.23.0.588-0364e3c' --enable-__cxa_atexit --disable-libmudflap --disable-libgomp --disable-libssp --disable-libquadmath --disable-libquadmath-support --disable-libsanitizer --enable-libmpx --with-gmp=/home/e381734/workspace/toolchain/x86_64-linux-gnu-8.2.0/.build/x86_64-linux-gnu/buildtools --with-mpfr=/home/e381734/workspace/toolchain/x86_64-linux-gnu-8.2.0/.build/x86_64-linux-gnu/buildtools --with-mpc=/home/e381734/workspace/toolchain/x86_64-linux-gnu-8.2.0/.build/x86_64-linux-gnu/buildtools --with-isl=/home/e381734/workspace/toolchain/x86_64-linux-gnu-8.2.0/.build/x86_64-linux-gnu/buildtools --disable-lto --with-host-libstdcxx='-static-libgcc -Wl,-Bstatic,-lstdc++ -lm' --enable-threads=posix --enable-target-optspace --with-linker-hash-style=both --disable-plugin --disable-nls --disable-multilib --with-local-prefix=/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/x86_64-linux-gnu/sysroot --enable-long-long --enable-multiarch Thread model: posix gcc version 8.2.0 (crosstool-NG 1.23.0.588-0364e3c) COMPILER_PATH=/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/libexec/gcc/x86_64-linux-gnu/8.2.0/:/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/libexec/gcc/x86_64-linux-gnu/8.2.0/:/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/libexec/gcc/x86_64-linux-gnu/:/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/8.2.0/:/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/:/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/8.2.0/../../../../x86_64-linux-gnu/bin/ LIBRARY_PATH=/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/8.2.0/:/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/8.2.0/../../../../x86_64-linux-gnu/lib/../lib64/:/home/e381734/workspace/qt/cross-compile/debian/sysroot/lib/x86_64-linux-gnu/:/home/e381734/workspace/qt/cross-compile/debian/sysroot/lib/../lib64/:/home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/x86_64-linux-gnu/:/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/8.2.0/../../../../x86_64-linux-gnu/lib/:/home/e381734/workspace/qt/cross-compile/debian/sysroot/lib/:/home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/ COLLECT_GCC_OPTIONS='-v' '-fuse-ld=gold' '-o' 'xlib' '-shared-libgcc' '-mtune=generic' '-march=x86-64' /home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/libexec/gcc/x86_64-linux-gnu/8.2.0/collect2 --sysroot=/home/e381734/workspace/qt/cross-compile/debian/sysroot --eh-frame-hdr --hash-style=both -m elf_x86_64 -dynamic-linker /lib64/ld-linux-x86-64.so.2 -fuse-ld=gold -o xlib /home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/x86_64-linux-gnu/crt1.o /home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/x86_64-linux-gnu/crti.o /home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/8.2.0/crtbegin.o -L/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/8.2.0 -L/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/8.2.0/../../../../x86_64-linux-gnu/lib/../lib64 -L/home/e381734/workspace/qt/cross-compile/debian/sysroot/lib/x86_64-linux-gnu -L/home/e381734/workspace/qt/cross-compile/debian/sysroot/lib/../lib64 -L/home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/x86_64-linux-gnu -L/home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/8.2.0/../../../../x86_64-linux-gnu/lib -L/home/e381734/workspace/qt/cross-compile/debian/sysroot/lib -L/home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib -O1 main.o /home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/x86_64-linux-gnu/libXext.so /home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/x86_64-linux-gnu/libX11.so /home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/x86_64-linux-gnu/libm.so -lstdc++ -lm -lgcc_s -lgcc -lc -lgcc_s -lgcc /home/e381734/x-tools/x86_64-linux-gnu-gcc-8.2.0/lib/gcc/x86_64-linux-gnu/8.2.0/crtend.o /home/e381734/workspace/qt/cross-compile/debian/sysroot/usr/lib/x86_64-linux-gnu/crtn.o /lib/x86_64-linux-gnu/libm.so.6: error: undefined reference to '__strtof128_nan', version 'GLIBC_PRIVATE' collect2: error: ld returned 1 exit status
I checked the symbols in libm with :
strings ~/workspace/qt/cross-compile/debian/sysroot/lib/x86_64-linux-gnu/libm.so.6 | grep __strtof128_nan
and as the error says it's missing __strtof128_nan.
Any idea about this error ?
Thanks in advance,
X-Krys
-
Hi,
Out of curiosity what is your host machine that you need to cross-compile to a x86_64 target ?
-
Actually it is also a x86_64 machine, it just about a cross OS compilation not a regular cross architecture compilation.
I know I could do a chroot build for instance but I guess it should be doable the cross compilation way.
Afterall it is just about a toolchain and a sysroot.
I'm trying to figure out what is the issue with my build environment that lead me to this error.
By the way just the xlib compilation seems to fail, I can still do the qt build but the xcb qpa backend will be skipped.
-
The thing is, it seems to be looking at the libm.so.6 of your machine and not the one from the sysroot.