Raspberry PI4 cross-compile can't find openssl headers
-
wrote on 24 May 2021, 19:48 last edited by
Hi.
I've been successfully cross-compiling Qt for Raspberry PI for several years. I now have an SSL requirement and thought this would be a no-brainer.
Thing is, ./configure can't seem to find the openssl headers in the sysroot.I've been banging my head on this for a full day and any help would be much appreciated.
The given error is:
ERROR: Feature 'openssl-runtime' was enabled, but the pre-condition '!features.securetransport && !features.schannel && libs.openssl_headers' failed.
The relevant lines in the configure output are:
looking for library openssl_headers Trying source 0 (type inline) of library openssl_headers ... openssl/ssl.h not found in [] and global paths. openssl/opensslv.h not found in [] and global paths. => source produced no result. test config.qtbase_network.libraries.openssl_headers FAILED
My configure line is as follows:
../5.15.1/configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/lmc/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/lmc/sysroot/linux-rasp-pi4-v3d-g++ -opensource -confirm-license -make libs -extprefix /opt/lmc/qt/linux-rasp-pi4-v3d-g++/5.15.1/target -hostprefix /opt/lmc/qt/linux-rasp-pi4-v3d-g++/5.15.1/host -v -skip qtwebengine -openssl
The header files are definitely in [sysroot]/usr/include/openssl. In fact, configure completes successfully when run natively on the PI.
I think I could figure this out if I could print the actual search paths during the configure step, but it is not immediately apparent to me how to do this. For instance, when the output is:
openssl/ssl.h not found in [] and global paths
what are the global paths, and what is '[]'? It looks like it may not be searching the sysroot correctly.
My cross-compile environment is Fedora 33.
Any help is super-appreciated!
Full configure summary follows:
Configure summary: Building on: linux-g++ (x86_64, CPU features: mmx sse sse2) Building for: devices/linux-rasp-pi4-v3d-g++ (arm, CPU features: neon) Target compiler: gcc 7.4.1 Configuration: cross_compile compile_examples enable_new_dtags largefile neon precompile_header shared shared rpath release c++11 c++14 c++17 c++1z concurrent dbus reduce_exports stl Build options: Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C standard ....................... C11 Using C++ standard ..................... C++17 Using ccache ........................... no Using new DTAGS ........................ yes Relocatable ............................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: NEON ................................. 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 ................................... no Using system zlib ...................... no Zstandard support ...................... no Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... no iconv .................................. yes ICU .................................... no Built-in copy of the MIME database ..... yes Tracing backend ........................ <none> Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no PCRE2 .................................. yes Using system PCRE2 ................... no Qt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no Linux AF_NETLINK ....................... yes OpenSSL ................................ no Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ no DTLS ................................... no OCSP-stapling .......................... no SCTP ................................... no Use system proxies ..................... yes GSSAPI ................................. no Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ yes HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. no Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... no PNG .................................. yes Using system libpng ................ no Text formats: HtmlParser ........................... yes CssParser ............................ yes OdfWriter ............................ yes MarkdownReader ....................... yes Using system libmd4c ............... no MarkdownWriter ....................... yes EGL .................................... no OpenVG ................................. no OpenGL: Desktop OpenGL ....................... no 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 ............................... no INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon .............................. no X11 specific: XLib ................................. no XCB Xlib ............................. no EGL on X11 ........................... no xkbcommon-x11 ........................ no QPA backends: DirectFB ............................... no EGLFS .................................. no LinuxFB ................................ yes VNC .................................... yes 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 Serial Port: ntddmodm ............................... no Qt SerialBus: Socket CAN ............................. yes Socket CAN FD .......................... yes SerialPort Support ..................... yes Further Image Formats: JasPer ................................. no MNG .................................... no TIFF ................................... yes Using system libtiff ................. no WEBP ................................... yes Using system libwebp ................. no Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML just-in-time compiler .............. yes QML sequence object .................... yes QML XML http request ................... yes QML Locale ............................. yes Qt QML Models: QML list model ......................... 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 QtQuick3D: Assimp ................................. yes System Assimp .......................... no Qt Scxml: ECMAScript data model for QtScxml ...... yes Qt Gamepad: SDL2 ................................... no Qt 3D GeometryLoaders: Autodesk FBX ........................... no Qt Wayland Client ........................ no Qt Wayland Compositor .................... no Qt Bluetooth: BlueZ .................................. no BlueZ Low Energy ....................... no Linux Crypto API ....................... no Native Win32 Bluetooth ................. no WinRT Bluetooth API (desktop & UWP) .... no WinRT advanced bluetooth low energy 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 ............................. no Itemsoverlay ......................... yes QtXmlPatterns: XML schema support ..................... yes Qt Multimedia: ALSA ................................... no 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 TextToSpeech: Flite .................................. no Flite with ALSA ........................ no Speech Dispatcher ...................... no Qt Tools: Qt Assistant ........................... yes Qt Designer ............................ yes Qt Distance Field Generator ............ yes kmap2qmap .............................. yes Qt Linguist ............................ yes Mac Deployment Tool .................... no makeqpf ................................ yes pixeltool .............................. yes qdbus .................................. yes qev .................................... yes Qt Attributions Scanner ................ yes qtdiag ................................. yes qtpaths ................................ yes qtplugininfo ........................... yes Windows deployment tool ................ no WinRT Runner Tool ...................... no Qt Tools: QDoc ................................... yes Note: Also available for Linux: linux-clang linux-icc Note: PKG_CONFIG_LIBDIR automatically set to /opt/lmc/sysroot/linux-rasp-pi4-v3d-g++/usr/lib/pkgconfig:/opt/lmc/sysroot/linux-rasp-pi4-v3d-g++/usr/share/pkgconfig:/opt/lmc/sysroot/linux-rasp-pi4-v3d-g++/usr/lib/arm-linux-gnueabihf/pkgconfig Note: PKG_CONFIG_SYSROOT_DIR automatically set to /opt/lmc/sysroot/linux-rasp-pi4-v3d-g++ Note: No wayland-egl support detected. Cross-toolkit compatibility disabled. Note: The following modules are not being compiled in this configuration: 3dcore 3drender ERROR: Feature 'openssl-runtime' was enabled, but the pre-condition '!features.securetransport && !features.schannel && libs.openssl_headers' failed. ERROR: Feature 'opengles2' was enabled, but the pre-condition '(config.win32 && !features.opengl-dynamic) || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed. ERROR: The OpenGL functionality tests failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2], QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.
-
Hi.
I've been successfully cross-compiling Qt for Raspberry PI for several years. I now have an SSL requirement and thought this would be a no-brainer.
Thing is, ./configure can't seem to find the openssl headers in the sysroot.I've been banging my head on this for a full day and any help would be much appreciated.
The given error is:
ERROR: Feature 'openssl-runtime' was enabled, but the pre-condition '!features.securetransport && !features.schannel && libs.openssl_headers' failed.
The relevant lines in the configure output are:
looking for library openssl_headers Trying source 0 (type inline) of library openssl_headers ... openssl/ssl.h not found in [] and global paths. openssl/opensslv.h not found in [] and global paths. => source produced no result. test config.qtbase_network.libraries.openssl_headers FAILED
My configure line is as follows:
../5.15.1/configure -release -opengl es2 -device linux-rasp-pi4-v3d-g++ -device-option CROSS_COMPILE=/opt/lmc/toolchain/gcc-linaro-7.4.1-2019.02-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /opt/lmc/sysroot/linux-rasp-pi4-v3d-g++ -opensource -confirm-license -make libs -extprefix /opt/lmc/qt/linux-rasp-pi4-v3d-g++/5.15.1/target -hostprefix /opt/lmc/qt/linux-rasp-pi4-v3d-g++/5.15.1/host -v -skip qtwebengine -openssl
The header files are definitely in [sysroot]/usr/include/openssl. In fact, configure completes successfully when run natively on the PI.
I think I could figure this out if I could print the actual search paths during the configure step, but it is not immediately apparent to me how to do this. For instance, when the output is:
openssl/ssl.h not found in [] and global paths
what are the global paths, and what is '[]'? It looks like it may not be searching the sysroot correctly.
My cross-compile environment is Fedora 33.
Any help is super-appreciated!
Full configure summary follows:
Configure summary: Building on: linux-g++ (x86_64, CPU features: mmx sse sse2) Building for: devices/linux-rasp-pi4-v3d-g++ (arm, CPU features: neon) Target compiler: gcc 7.4.1 Configuration: cross_compile compile_examples enable_new_dtags largefile neon precompile_header shared shared rpath release c++11 c++14 c++17 c++1z concurrent dbus reduce_exports stl Build options: Mode ................................... release Optimize release build for size ........ no Building shared libraries .............. yes Using C standard ....................... C11 Using C++ standard ..................... C++17 Using ccache ........................... no Using new DTAGS ........................ yes Relocatable ............................ yes Using precompiled headers .............. yes Using LTCG ............................. no Target compiler supports: NEON ................................. 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 ................................... no Using system zlib ...................... no Zstandard support ...................... no Qt Core: DoubleConversion ....................... yes Using system DoubleConversion ........ no GLib ................................... no iconv .................................. yes ICU .................................... no Built-in copy of the MIME database ..... yes Tracing backend ........................ <none> Logging backends: journald ............................. no syslog ............................... no slog2 ................................ no PCRE2 .................................. yes Using system PCRE2 ................... no Qt Network: getifaddrs() ........................... yes IPv6 ifname ............................ yes libproxy ............................... no Linux AF_NETLINK ....................... yes OpenSSL ................................ no Qt directly linked to OpenSSL ........ no OpenSSL 1.1 ............................ no DTLS ................................... no OCSP-stapling .......................... no SCTP ................................... no Use system proxies ..................... yes GSSAPI ................................. no Qt Gui: Accessibility .......................... yes FreeType ............................... yes Using system FreeType ................ yes HarfBuzz ............................... yes Using system HarfBuzz ................ no Fontconfig ............................. no Image formats: GIF .................................. yes ICO .................................. yes JPEG ................................. yes Using system libjpeg ............... no PNG .................................. yes Using system libpng ................ no Text formats: HtmlParser ........................... yes CssParser ............................ yes OdfWriter ............................ yes MarkdownReader ....................... yes Using system libmd4c ............... no MarkdownWriter ....................... yes EGL .................................... no OpenVG ................................. no OpenGL: Desktop OpenGL ....................... no 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 ............................... no INTEGRITY HID .......................... no mtdev .................................. no tslib .................................. no xkbcommon .............................. no X11 specific: XLib ................................. no XCB Xlib ............................. no EGL on X11 ........................... no xkbcommon-x11 ........................ no QPA backends: DirectFB ............................... no EGLFS .................................. no LinuxFB ................................ yes VNC .................................... yes 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 Serial Port: ntddmodm ............................... no Qt SerialBus: Socket CAN ............................. yes Socket CAN FD .......................... yes SerialPort Support ..................... yes Further Image Formats: JasPer ................................. no MNG .................................... no TIFF ................................... yes Using system libtiff ................. no WEBP ................................... yes Using system libwebp ................. no Qt QML: QML network support .................... yes QML debugging and profiling support .... yes QML just-in-time compiler .............. yes QML sequence object .................... yes QML XML http request ................... yes QML Locale ............................. yes Qt QML Models: QML list model ......................... 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 QtQuick3D: Assimp ................................. yes System Assimp .......................... no Qt Scxml: ECMAScript data model for QtScxml ...... yes Qt Gamepad: SDL2 ................................... no Qt 3D GeometryLoaders: Autodesk FBX ........................... no Qt Wayland Client ........................ no Qt Wayland Compositor .................... no Qt Bluetooth: BlueZ .................................. no BlueZ Low Energy ....................... no Linux Crypto API ....................... no Native Win32 Bluetooth ................. no WinRT Bluetooth API (desktop & UWP) .... no WinRT advanced bluetooth low energy 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 ............................. no Itemsoverlay ......................... yes QtXmlPatterns: XML schema support ..................... yes Qt Multimedia: ALSA ................................... no 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 TextToSpeech: Flite .................................. no Flite with ALSA ........................ no Speech Dispatcher ...................... no Qt Tools: Qt Assistant ........................... yes Qt Designer ............................ yes Qt Distance Field Generator ............ yes kmap2qmap .............................. yes Qt Linguist ............................ yes Mac Deployment Tool .................... no makeqpf ................................ yes pixeltool .............................. yes qdbus .................................. yes qev .................................... yes Qt Attributions Scanner ................ yes qtdiag ................................. yes qtpaths ................................ yes qtplugininfo ........................... yes Windows deployment tool ................ no WinRT Runner Tool ...................... no Qt Tools: QDoc ................................... yes Note: Also available for Linux: linux-clang linux-icc Note: PKG_CONFIG_LIBDIR automatically set to /opt/lmc/sysroot/linux-rasp-pi4-v3d-g++/usr/lib/pkgconfig:/opt/lmc/sysroot/linux-rasp-pi4-v3d-g++/usr/share/pkgconfig:/opt/lmc/sysroot/linux-rasp-pi4-v3d-g++/usr/lib/arm-linux-gnueabihf/pkgconfig Note: PKG_CONFIG_SYSROOT_DIR automatically set to /opt/lmc/sysroot/linux-rasp-pi4-v3d-g++ Note: No wayland-egl support detected. Cross-toolkit compatibility disabled. Note: The following modules are not being compiled in this configuration: 3dcore 3drender ERROR: Feature 'openssl-runtime' was enabled, but the pre-condition '!features.securetransport && !features.schannel && libs.openssl_headers' failed. ERROR: Feature 'opengles2' was enabled, but the pre-condition '(config.win32 && !features.opengl-dynamic) || (!config.watchos && !features.opengl-desktop && libs.opengl_es2)' failed. ERROR: The OpenGL functionality tests failed! You might need to modify the include and library search paths by editing QMAKE_INCDIR_OPENGL[_ES2], QMAKE_LIBDIR_OPENGL[_ES2] and QMAKE_LIBS_OPENGL[_ES2] in the mkspec for your platform.
@Plastic-Jesus If I'm not mistaken you should see compiler/linker calls in config.log file. Check that file to see which include folders are passed to compiler.
Global paths are paths like /usr/include, where compiler is always looking for header files. -
wrote on 28 May 2021, 16:15 last edited by Plastic.Jesus
Thanks for the reply.
The problems is that the config.log doesn't display the actual paths in which it is looking for the headers. It should be looking in the sysroot as specified by my -sysroot option in the configure invocation. Notice the following lines in the output.
openssl/ssl.h not found in [] and global paths. openssl/opensslv.h not found in [] and global paths
I'm hoping someone can point me to the correct place in the make system to add some extra debug logging.
1/3