qt5,rpi_ws281x,hyperion,hyperhdr: fix Qt5 cross-compilation build - #11460
Merged
Conversation
Qt's build system uses INSTALL_ROOT as its staging variable, not DESTDIR.
With -sysroot in configure the default make install wrote to the live
sysroot; removing -sysroot and using INSTALL_ROOT="${INSTALL}" fixes that.
With -hostprefix "${TOOLCHAIN}" the generated cmake config files stored
mkspecs and host-tool paths referencing the toolchain directory, making
them unresolvable from the staging area.
Using -hostprefix /usr/host (a subdirectory of -prefix /usr) keeps all
paths self-contained within the staging area: host tools and mkspecs land
in usr/host/ while target libraries land in usr/lib/, cleanly separated.
The cmake configs use QT_HOST_DATA_RELATIVE to reference host items as
"host/..." relative to the install prefix, so they resolve correctly from
the staging area without symlinks or path fixups.
The source tree ships a plain-text version file in its root directory. When the directory is on a compiler include path, #include <version> (used by Qt5's qstdlibdetection.h) finds this file instead of the C++ standard library header and fails to compile with "error: stray '.' in program". Carry a patch to rename version to VERSION (safe on case-sensitive Linux) and update the file(READ) call in CMakeLists.txt. hyperhdr processes rpi_ws281x via add_subdirectory so cmake still reads the version data; hyperion compiles the sources directly and is unaffected either way. Patch submitted upstream: https://github.com/jgarff/rpi_ws281x pull 570 Drop this patch when the upstream PR is merged and PKG_VERSION is bumped.
Member
|
please also bump PKG_REVs of hyperhdr and hyperion |
Qt5 is built with -sysroot removed and installs entirely under its own staging prefix rather than into the sysroot. The default cmake toolchain file sets CMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY, so cmake cannot find Qt5's config files outside CMAKE_FIND_ROOT_PATH. Generate a thin wrapper toolchain file that includes the real LE toolchain and appends Qt5's staging prefix to CMAKE_FIND_ROOT_PATH. Pass this via PKG_CMAKE_OPTS_TARGET so it overrides the default toolchain file.
Same fix as hyperion: generate a thin cmake toolchain wrapper that includes the real LE toolchain and appends Qt5's staging prefix to CMAKE_FIND_ROOT_PATH so cmake can locate Qt5's config files.
Contributor
Author
|
bumped |
HiassofT
approved these changes
Jun 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
qt5
Two configure problems:
1.
-sysroot "${SYSROOT_PREFIX}"causedmake installto write to the live sysroot. Qt's build system usesINSTALL_ROOTas its staging variable (notDESTDIR); with-sysrootset, the default install bypassed staging entirely. Fix: remove-sysrootfrom configure and passINSTALL_ROOT="${INSTALL}"tomake install.2.
-hostprefix "${TOOLCHAIN}"baked the toolchain directory path into the generated cmake config files (Qt5CoreConfigExtras.cmake). Paths tomoc,mkspecsetc. were stored relative to the toolchain, making them unresolvable from the staging area. Using-hostprefix /usr/host(a subdirectory of-prefix /usr) keeps all cmake config paths self-contained within the staging area: Qt usesQT_HOST_DATA_RELATIVEto reference host items ashost/...relative to the install prefix. Host tools land inusr/host/bin/, target libraries inusr/lib/, cleanly separated.rpi_ws281x
The source tree ships a plain-text
versionfile in its root. When the directory is added to the compiler include path (as both hyperion and hyperhdr do),#include <version>- used by Qt5'sqstdlibdetection.h- finds this file instead of the C++20 standard library header, producingerror: stray '.' in program.hyperion / hyperhdr
Qt5 installs outside the sysroot (was suppose to given
PKG_BUILD_FLAGS="-sysroot"). LibreELEC's cmake toolchain setsCMAKE_FIND_ROOT_PATH_MODE_PACKAGE ONLY, so cmake cannot find Qt5's config files without an explicit path hint.Generate a thin wrapper toolchain file in
pre_configure_target()thatinclude()s the real LibreELEC toolchain then appends Qt5's staging prefix toCMAKE_FIND_ROOT_PATH. Passing-DCMAKE_TOOLCHAIN_FILE=viaPKG_CMAKE_OPTS_TARGEToverrides the default (last occurrence wins in cmake's command-line processing).Test plan