pkgsrc-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

pkg/60303: x11/qt6-qtbase: fix build failure on 32-bit powerpc



>Number:         60303
>Category:       pkg
>Synopsis:       x11/qt6-qtbase: fix build failure on 32-bit powerpc
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    pkg-manager
>State:          open
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Sun May 31 19:40:00 +0000 2026
>Originator:     Jun Ebihara
>Release:        pkgsrc current  May 28 2026
>Organization:
SOUM Corporation
>Environment:
NetBSD wiiu 11.99.5 NetBSD 11.99.5 (NINTENDO.MP) #0: Mon Mar  2 13:41:54 UTC 2026  mkrepro%mkrepro.NetBSD.org@localhost:/usr/src/sys/arch/evbppc/compile/NINTENDO.MP evbppc

>Description:
When building x11/qt6-qtbase on NetBSD/powerpc (32-bit), the build fails with a static assertion error in src/corelib/kernel/qtestsupport_core.cpp.

The error message is:

error: static assertion failed
static_assert(std::atomic<std::chrono::milliseconds>::is_always_lock_free);

This occurs because on 32-bit PowerPC, 64-bit atomic operations for std::chrono::milliseconds are not "always lock-free" in hardware. While libatomic provides the necessary support at runtime, the strict compile-time assertion in Qt6 prevents the build from completing.

To fix this, we need to:

1.  Link against devel/libatomic on PowerPC.
2.  Disable the problematic static_assert specifically for 32-bit PowerPC, relying on libatomic to handle the operations.

>How-To-Repeat:
Attempt to build x11/qt6-qtbase on a NetBSD/powerpc system (e.g., Wii U or older Mac hardware).

>Fix:
I have verified that the build failure on 32-bit PowerPC can be resolved by applying the following two modifications.

1. Modification to x11/qt6-qtbase/Makefile

Add a link to libatomic specifically for the powerpc architecture. This ensures that 64-bit atomic operations, which are not native to the hardware, can be handled by the library.

makefile
--- x11/qt6-qtbase/Makefile.orig
+++ x11/qt6-qtbase/Makefile
@@ -... @@
 .include "../../mk/bsd.prefs.mk"
 
+.if ${MACHINE_ARCH} == "powerpc"
+.include "../../devel/libatomic/buildlink3.mk"
+LDFLAGS+=	-latomic
+.endif


2. New patch for qtestsupport_core.cpp

Create a new patch file patches/patch-src_corelib_kernel_qtestsupport__core.cpp to bypass the static_assert that incorrectly assumes lock-free 64-bit atomics on all platforms. With libatomic linked, the code will function correctly despite not being "always lock-free" at compile-time.

$NetBSD$

On 32-bit PowerPC, std::atomic<std::chrono::milliseconds> is not always lock-free.
Disable the static_assert and rely on libatomic.

--- src/corelib/kernel/qtestsupport_core.cpp.orig	2026-05-31 00:00:00.000000000 +0000
+++ src/corelib/kernel/qtestsupport_core.cpp
@@ -10,7 +10,9 @@
 #include <QtCore/qtestsupport_core.h>
 #include <QtCore/qvariant.h>
 
+#if !defined(Q_PROCESSOR_POWER_32)
 static_assert(std::atomic<std::chrono::milliseconds>::is_always_lock_free);
+#endif
 
 QT_BEGIN_NAMESPACE

Verification Steps:

1.  Applied the changes above to x11/qt6-qtbase.
2.  Executed make makepatchsum to update the distinfo.
3.  Ran make on a NetBSD/powerpc system.
4.  Confirmed that the build now completes successfully without the previous static_assert error.





Home | Main Index | Thread Index | Old Index