Skip to content

Conversation

@newbluemoon
Copy link
Contributor

@newbluemoon newbluemoon commented Sep 29, 2024

Testing the changes

  • I tested the changes in this PR: briefly

Local build testing

  • I built this PR locally for my native architecture, (x86_64)
  • I built this PR locally for these architectures (if supported. mark crossbuilds):
    • aarch64 (cross)
    • armv7l (cross) --> fails on x86_64, succeedes on i686, see below
    • x86_64-musl
    • i686

There is a problem with 32-bit cross builds on a 64-bit host.
Meson detects Qt6 using pkg-config. However, the corresponding .pc files have

prefix=/usr
exec_prefix=${prefix}
bindir=${prefix}/lib32/qt6/bin
libexecdir=${prefix}/lib32/qt6/libexec
libdir=${prefix}/lib
includedir=${prefix}/include/qt6

i.e. they have .../lib32/... hard coded and so detection of the host tools fails when they are under .../lib64/....

There are not much options to tweak this; using qmake instead of pkg-config yields the same error.

I think a clean solution would be adjusting Qt6’s .pc files to contain .../lib/... solely. There shouldn’t be a problem, because lib32 and lib64 are symlinks to lib, anyway. Everything else I can think of would be quite hacky. I don’t know if this is the only package having this problem; I searched for other templates, but didn’t find anything alike.

Any ideas/suggestions are very welcome :)

@newbluemoon newbluemoon changed the title sonic-visualiser: update to 5.0 sonic-visualiser: update to 5.0.1 Oct 5, 2024
@newbluemoon newbluemoon force-pushed the sonic-visualiser branch 2 times, most recently from 2f9e642 to 0f6ff18 Compare December 25, 2024 09:28
@newbluemoon
Copy link
Contributor Author

Made a slight modification to the pkg-config-wrapper to find the qt6 tools when cross building on 64 bit host for 32 bit target:

diff --git a/common/hooks/pre-configure/02-script-wrapper.sh b/common/hooks/pre-configure/02-script-wrapper.sh
index 3d5d6c2ab3b..e2db9e400e9 100644
--- a/common/hooks/pre-configure/02-script-wrapper.sh
+++ b/common/hooks/pre-configure/02-script-wrapper.sh
@@ -103,7 +103,7 @@ pkgconfig_wrapper() {
 export PKG_CONFIG_SYSROOT_DIR="$XBPS_CROSS_BASE"
 export PKG_CONFIG_PATH="$XBPS_CROSS_BASE/usr/lib/pkgconfig:$XBPS_CROSS_BASE/usr/share/pkgconfig\${PKG_CONFIG_PATH:+:\${PKG_CONFIG_PATH}}"
 export PKG_CONFIG_LIBDIR="$XBPS_CROSS_BASE/usr/lib/pkgconfig\${PKG_CONFIG_LIBDIR:+:\${PKG_CONFIG_LIBDIR}}"
-exec /usr/bin/pkg-config "\$@"
+exec /usr/bin/pkg-config "\$@" | sed s/lib32/lib/g
 _EOF
 	chmod 755 ${XBPS_WRAPPERDIR}/${XBPS_CROSS_TRIPLET}-pkg-config
 	if [ -z "$no_generic_pkgconfig_link" ]; then

This is the smallest change I could come up with that makes it work, but maybe there's a better solution?

@newbluemoon newbluemoon changed the title sonic-visualiser: update to 5.0.1 sonic-visualiser: update to 5.2 Mar 9, 2025
@newbluemoon newbluemoon changed the title sonic-visualiser: update to 5.2 sonic-visualiser: update to 5.2.1 Mar 23, 2025
@Duncaen
Copy link
Member

Duncaen commented Jun 6, 2025

Just blindly replacing every occurance of lib32 in any pkg-config output seems wrong.

@newbluemoon
Copy link
Contributor Author

I do agree, just couldn’t come up with something better. Also couldn’t find any other package having this constellation. Maybe don’t allow 32-bit cross builds from 64-bit hosts for now then?

@newbluemoon
Copy link
Contributor Author

newbluemoon commented Jun 15, 2025

@Duncaen I disabled cross builds when host and target wordsize differs.
There already seems to be an active meson issue addressing this: mesonbuild/meson#13018

@newbluemoon newbluemoon force-pushed the sonic-visualiser branch 2 times, most recently from b259d3f to 1b1673d Compare September 28, 2025 06:02
@newbluemoon newbluemoon force-pushed the sonic-visualiser branch 2 times, most recently from 7f4ec4c to 58bcd87 Compare November 14, 2025 11:55
@newbluemoon newbluemoon force-pushed the sonic-visualiser branch 2 times, most recently from 90f015e to 9918158 Compare December 21, 2025 13:31
@newbluemoon
Copy link
Contributor Author

newbluemoon commented Dec 21, 2025

To resolve the cross build problem (32 bit target on 64 bit host) I added the two by the package required qt6 host tool binaries (moc and rcc) explicitly to the meson cross profile.

Hope this approach will be accepted as it is the cleanest way I can come up with :)

When cross building 32 bit qt6 packages on 64 bit hosts the qt6 host
tools are not found, because the path is determined via pkgconfig which
points to /usr/lib32.

Adding the required binaries to the cross profile as a workaround to
resolve this.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants