Build failure on big endian: qendian.h:209:(.text+0x22316): undefined reference to `QByteArray qbswap<QByteArray>(QByteArray)'
wfview 1.64 fails to compile on Debian's big endian architectures:
/usr/bin/ld: usbcontroller.o: in function `QByteArray qToLittleEndian<QByteArray>(QByteArray)':
/usr/include/s390x-linux-gnu/qt5/QtCore/qendian.h:209:(.text+0x22316): undefined reference to `QByteArray qbswap<QByteArray>(QByteArray)'
/usr/bin/ld: /usr/include/s390x-linux-gnu/qt5/QtCore/qendian.h:209:(.text+0x228f0): undefined reference to `QByteArray qbswap<QByteArray>(QByteArray)'
collect2: error: ld returned 1 exit status
Full build log at
- https://buildd.debian.org/status/fetch.php?pkg=wfview&arch=s390x&ver=1.64-1&stamp=1690855929&raw=0
- https://buildd.debian.org/status/logs.php?pkg=wfview&ver=1.64-1
The problem is that in usbcontroller.cpp, qToLittleEndian
is used without specifying the swap width:
data2 = qToLittleEndian(QByteArray::fromRawData(reinterpret_cast<const char*>(text.constData()), text.size() * 2));
This should be something like qToLittleEndian<quint32>(...)
(except that doesn't work on a character array).