Skip to contentSkip to conversation

package/qt5/qt5base: disable broken qmake sysrootify

PATCH New James Hilliard 1 participant 1 message Jan 17, 2022

lore
Share & tools
lore
#0 lore raw

PATCH v5 1/1 package/qt5/qt5base: disable broken qmake sysrootify

Currently the qmake gcc sysrootify path logic causes issues with per-package directories, disable automatic gcc sysroot for qt5base install and override all qt.conf paths manually to point to their correct locations.

Redirect HostData to STAGING_DIR as mkspecs need to be available there instead of the HOST_DIR for cross compilation to work.

Also set qmake target pkg-config path for qt5webengine.

Set PKG_CONFIG_SYSROOT_DIR="/" in qt5webengine to prevent target pkg-config path mangling.

This fixes some build errors with per-package directories such as:
/home/buildroot/buildroot/output/per-package/qt5base/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-buildroot-linux-gnu/10.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld:
cannot find /lib64/libc.so.6 /home/buildroot/buildroot/output/per-package/qt5base/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-buildroot-linux-gnu/10.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld:
cannot find /usr/lib64/libc_nonshared.a /home/buildroot/buildroot/output/per-package/qt5base/host/opt/ext-toolchain/bin/../lib/gcc/aarch64-buildroot-linux-gnu/10.3.0/../../../../aarch64-buildroot-linux-gnu/bin/ld:
cannot find /lib/ld-linux-aarch64.so.1
collect2: error: ld returned 1 exit status
make[4]: *** [Makefile:122: ../../lib/libQt5Svg.so.5.15.2] Error 1
make[3]: *** [Makefile:48: sub-svg-make_first-ordered] Error 2
make[2]: *** [Makefile:49: sub-src-make_first] Error 2
make[1]: *** [package/pkg-generic.mk:295:
/home/buildroot/buildroot/output/build/qt5svg-5.15.2/.stamp_built]
Error 2

Also attempt to fix massive amounts of breakage due to use of unsupported config flags in qt5webengine as of 5.10.0:
* WebEngine Features are now configured as Qt features and WEBENGINE_CONFIG has been removed.

Move target dependencies to qt5base which fixes/works around more per-package issues.

More fixes for pkg-config target/host separation.

---
Changes v4 -> v5:
- rework qt5webengine config to use feature flags
- try to fix more random breakage
Changes v3 -> v4:
- fix target pkg-config path mangling
Changes v2 -> v3:
- set target pkg-config path
Changes v1 -> v2:
- add some missing overrides to qt.conf.in

---
 package/libxml2/libxml2.mk                    |  13 +-
 package/pkg-qmake.mk                          |   2 +-
 package/qt5/qt5base/qmake.conf.in             |   4 +
 package/qt5/qt5base/qt.conf.in                |  21 +-
 package/qt5/qt5base/qt5base.mk                |  19 ++
 ...m-breakpad-fix-build-with-glibc-2.34.patch |  76 +++++
 .../0003-Fix-build-with-system-ICU-68.patch   | 291 ++++++++++++++++++
 package/qt5/qt5webengine/Config.in            |   6 +
 package/qt5/qt5webengine/qt5webengine.mk      |  57 +++-
 package/webp/webp.mk                          |   5 +
 10 files changed, 477 insertions(+), 17 deletions(-)
 create mode 100644 package/qt5/qt5webengine/0002-chromium-breakpad-fix-build-with-glibc-2.34.patch
 create mode 100644 package/qt5/qt5webengine/0003-Fix-build-with-system-ICU-68.patch
package/libxml2/libxml2.mk +12 -1
index 5d688acae5..ce396703db 100644
@@ -12,11 +12,15 @@ LIBXML2_LICENSE_FILES = COPYING
 LIBXML2_CPE_ID_VENDOR = xmlsoft
 LIBXML2_CONFIG_SCRIPTS = xml2-config
 
+LIBXML2_CFLAGS = $(TARGET_CFLAGS)
+
 # relocation truncated to fit: R_68K_GOT16O
 ifeq ($(BR2_m68k_cf),y)
-LIBXML2_CONF_ENV += CFLAGS="$(TARGET_CFLAGS) -mxgot"
+LIBXML2_CFLAGS += -mxgot
 endif
 
+LIBXML2_CONF_ENV += CFLAGS="$(LIBXML2_CFLAGS)"
+
 LIBXML2_CONF_OPTS = --with-gnu-ld --without-python --without-debug
 
 HOST_LIBXML2_DEPENDENCIES = host-pkgconf
@@ -24,6 +28,13 @@ LIBXML2_DEPENDENCIES = host-pkgconf
 
 HOST_LIBXML2_CONF_OPTS = --without-zlib --without-lzma --without-python
 
+ifeq ($(BR2_PACKAGE_ICU),y)
+LIBXML2_DEPENDENCIES += icu
+LIBXML2_CONF_OPTS += --with-icu
+else
+LIBXML2_CONF_OPTS += --without-icu
+endif
+
 ifeq ($(BR2_PACKAGE_ZLIB),y)
 LIBXML2_DEPENDENCIES += zlib
 LIBXML2_CONF_OPTS += --with-zlib=$(STAGING_DIR)/usr
package/pkg-qmake.mk +1 -1
index 4dcaf6dd62..98664fe00b 100644
@@ -61,7 +61,7 @@ $(2)_POST_PREPARE_HOOKS += QT5_QT_CONF_FIXUP
 ifndef $(2)_CONFIGURE_CMDS
 define $(2)_CONFIGURE_CMDS
 	cd $$($(2)_BUILDDIR) && \
-	$$(TARGET_MAKE_ENV) $$($(2)_CONF_ENV) $$(QT5_QMAKE) $$($(2)_CONF_OPTS)
+	$$(TARGET_MAKE_ENV) $$($(2)_CONF_ENV) $$(QT5_QMAKE) -- $$($(2)_CONF_OPTS)
 endef
 endif
 
package/qt5/qt5base/qmake.conf.in +4 -0
index 024c074928..d12f884a55 100644
@@ -8,6 +8,10 @@
 
 include(../common/linux_device_pre.conf)
 
+# set up pkg-config
+QMAKE_PKG_CONFIG        = $$[QT_HOST_PREFIX]/bin/pkg-config
+QMAKE_PKGCONFIG_PREFIX  = /usr
+
 # modifications to g++-unix.conf
 QMAKE_CC                = $${CROSS_COMPILE}gcc
 QMAKE_CXX               = $${CROSS_COMPILE}g++
package/qt5/qt5base/qt.conf.in +18 -3
index 2215cbd4e1..c92f52ced0 100644
@@ -2,6 +2,21 @@
 Prefix=/usr
 HostPrefix=@@HOST_DIR@@
 Sysroot=@@STAGING_DIR@@
-Headers=/usr/include/qt5
-Plugins=/usr/lib/qt/plugins
-Examples=/usr/lib/qt/examples
+SysrootifyPrefix=false
+Binaries=@@STAGING_DIR@@/usr/bin
+Libraries=@@STAGING_DIR@@/usr/lib
+Headers=@@STAGING_DIR@@/usr/include/qt5
+Plugins=@@STAGING_DIR@@/usr/lib/qt/plugins
+Examples=@@STAGING_DIR@@/usr/lib/qt/examples
+Tests=@@STAGING_DIR@@/usr/lib/qt/tests
+Data=@@STAGING_DIR@@
+Translations=@@STAGING_DIR@@/translations
+Documentation=@@STAGING_DIR@@/doc
+ArchData=@@STAGING_DIR@@/usr
+LibraryExecutables=@@STAGING_DIR@@/usr/libexec
+Imports=@@STAGING_DIR@@/usr/imports
+Qml2Imports=@@STAGING_DIR@@/usr/qml
+Settings=@@STAGING_DIR@@/etc
+HostBinaries=@@HOST_DIR@@/bin
+HostLibraries=@@HOST_DIR@@/lib
+HostData=@@STAGING_DIR@@
package/qt5/qt5base/qt5base.mk +19 -0
index bcdf036f00..c781276135 100644
@@ -230,6 +230,22 @@ QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_QT5BASE_ICU),icu)
 
 QT5BASE_CONFIGURE_OPTS += $(if $(BR2_PACKAGE_QT5BASE_EXAMPLES),-make,-nomake) examples
 
+# Used by qt5webengine
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_FFMPEG),ffmpeg)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_LIBEVENT),libevent)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_LIBNSS),libnss)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_LIBXML2),libxml2)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_LIBXSLT),libxslt)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_MINIZIP),minizip)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_LIBVPX),libvpx)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_WEBP),webp)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_XLIB_LIBXCOMPOSITE),xlib_libXcomposite)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_XLIB_LIBXCURSOR),xlib_libXcursor)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_XLIB_LIBXI),xlib_libXi)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_XLIB_LIBXRANDR),xlib_libXrandr)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_XLIB_LIBXSCRNSAVER),xlib_libXScrnSaver)
+QT5BASE_DEPENDENCIES   += $(if $(BR2_PACKAGE_XLIB_LIBXTST),xlib_libXtst)
+
 ifeq ($(BR2_PACKAGE_LIBINPUT),y)
 QT5BASE_CONFIGURE_OPTS += -libinput
 QT5BASE_DEPENDENCIES += libinput
@@ -311,12 +327,15 @@ define QT5BASE_CONFIGURE_CMDS
 		-v \
 		-prefix /usr \
 		-hostprefix $(HOST_DIR) \
+		-hostdatadir $(STAGING_DIR) \
 		-headerdir /usr/include/qt5 \
 		-sysroot $(STAGING_DIR) \
+		-no-gcc-sysroot \
 		-plugindir /usr/lib/qt/plugins \
 		-examplesdir /usr/lib/qt/examples \
 		-no-rpath \
 		-nomake tests \
+		-pkg-config \
 		-device buildroot \
 		-device-option CROSS_COMPILE="$(TARGET_CROSS)" \
 		-device-option BR_COMPILER_CFLAGS="$(QT5BASE_CFLAGS)" \
package/qt5/qt5webengine/0002-chromium-breakpad-fix-build-with-glibc-2.34.patch new file +76 -0

76 lines not on this page · raw message

package/qt5/qt5webengine/0003-Fix-build-with-system-ICU-68.patch new file +291 -0

291 lines not on this page · raw message

package/qt5/qt5webengine/Config.in +6 -0
index 5d537cdf84..f59d80a312 100644
@@ -38,18 +38,24 @@ config BR2_PACKAGE_QT5WEBENGINE
 	# https://github.com/v8/v8/blob/5.6.326.55/gypfiles/toolchain.gypi#L1036-L1037
 	select BR2_HOSTARCH_NEEDS_IA32_COMPILER if !BR2_ARCH_IS_64 # v8/chromium
 	select BR2_PACKAGE_FFMPEG
+	select BR2_PACKAGE_LIBEVENT
 	select BR2_PACKAGE_LIBGLIB2
 	select BR2_PACKAGE_LIBNSS
 	select BR2_PACKAGE_LIBVPX
 	select BR2_PACKAGE_LIBXKBCOMMON
+	select BR2_PACKAGE_LIBXML2
+	select BR2_PACKAGE_LIBXSLT
 	select BR2_PACKAGE_OPUS
 	select BR2_PACKAGE_WEBP
 	select BR2_PACKAGE_WEBP_DEMUX
+	select BR2_PACKAGE_WEBP_MUX
 	select BR2_PACKAGE_QT5BASE_DBUS
 	select BR2_PACKAGE_QT5BASE_EGLFS
 	select BR2_PACKAGE_QT5BASE_FONTCONFIG
+	select BR2_PACKAGE_QT5BASE_JPEG
 	select BR2_PACKAGE_QT5BASE_ICU
 	select BR2_PACKAGE_QT5BASE_GUI
+	select BR2_PACKAGE_QT5BASE_PNG
 	select BR2_PACKAGE_QT5BASE_WIDGETS
 	select BR2_PACKAGE_QT5DECLARATIVE
 	select BR2_PACKAGE_QT5DECLARATIVE_QUICK
package/qt5/qt5webengine/qt5webengine.mk +45 -12

90 lines not on this page · raw message

package/webp/webp.mk +5 -0
index d1462426c6..7c2625df23 100644
@@ -19,6 +19,10 @@ WEBP_CONF_OPTS += \
 	--with-tiffincludedir=$(STAGING_DIR)/usr/include \
 	--with-tifflibdir=$(STAGING_DIR)/usr/lib
 
+HOST_WEBP_CONF_OPTS += \
+	--enable-libwebpdemux \
+	--enable-libwebpmux
+
 ifeq ($(BR2_PACKAGE_WEBP_DEMUX),y)
 WEBP_CONF_OPTS += --enable-libwebpdemux
 else
@@ -56,3 +60,4 @@ WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_JPEG),jpeg)
 WEBP_DEPENDENCIES += $(if $(BR2_PACKAGE_TIFF),tiff)
 
 $(eval $(autotools-package))
+$(eval $(host-autotools-package))
Signature · 7 lines
2.25.1


_______________________________________________
buildroot mailing list
[email protected]
https://lists.buildroot.org/mailman/listinfo/buildroot