Discussion:
Bug#1057050: qt6-multimedia: Please build with EIGEN_DONT_VECTORIZE on powerpc to fix FTBFS
(too old to reply)
John Paul Adrian Glaubitz
2023-11-28 19:30:01 UTC
Permalink
Source: qt6-multimedia
Version: 6.4.2-11
Severity: normal
User: debian-***@lists.debian.org
Usertags: powerpc
X-Debbugs-Cc: debian-***@lists.debian.org

Hello!

The package src:qt6-multimedia fails to build from source on powerpc since version
6.4.0-1 due to the use of some AltiVec instrisics that are not supported on 32-bit
PowerPC:

/usr/bin/c++ -DEIGEN_MPL2_ONLY -DQT_NO_DEBUG -DQT_NO_EXCEPTIONS -DQT_NO_JAVA_STYLE_ITERATORS \
(...)
In file included from /usr/include/eigen3/Eigen/Core:210,
from /usr/include/eigen3/Eigen/Dense:1,
from /<<PKGBUILDDIR>>/src/resonance-audio/../3rdparty/resonance-audio/platforms/common/utils.h:20,
from /<<PKGBUILDDIR>>/src/3rdparty/resonance-audio/platforms/common/utils.cc:17:
/usr/include/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h: In function \
‘Packet Eigen::internal::pblend(const Selector<unpacket_traits<T>::size>&, const Packet&, const Packet&) [with Packet = __vector(2) double]’:
/usr/include/eigen3/Eigen/src/Core/arch/AltiVec/PacketMath.h:2702:17: error: invalid parameter combination for AltiVec intrinsic ‘__builtin_vec_sel’
2702 | return vec_sel(elsePacket, thenPacket, mask);
| ^

This can be fixed by switching off vectorization in the »eigen« using the preprocessor
macro EIGEN_DONT_VECTORIZE which can be defined on the cmake command line using the
cmake variable COMPILE_DEFINITIONS:

--- qt6-multimedia-6.4.2/debian/rules.orig 2023-07-26 17:52:13.000000000 +0200
+++ qt6-multimedia-6.4.2/debian/rules 2023-11-28 18:26:47.950137854 +0100
@@ -9,6 +9,10 @@
cmake_extra_args += -DQT_HOST_PATH=/usr
endif

+ifneq (,$(filter $(DEB_HOST_ARCH),powerpc))
+ cmake_extra_args += -DCOMPILE_DEFINITIONS="EIGEN_DONT_VECTORIZE"
+endif
+
%:
dh $@ --with pkgkde_symbolshelper --buildsystem=cmake+ninja

With the above change, cmake defines the preprocessor macro EIGEN_DONT_VECTORIZE and
the build succeeds on powerpc.

Could you apply this change for the next upload in order to fix the build on powerpc?

Attaching a patch for a convenience.

Thanks,
Adrian

--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Christian Marillat
2023-12-02 09:10:01 UTC
Permalink
Hej,
Am Dienstag, 28. November 2023, 20:22:36 CET schrieb John Paul Adrian
[...]
Post by John Paul Adrian Glaubitz
With the above change, cmake defines the preprocessor macro
EIGEN_DONT_VECTORIZE and the build succeeds on powerpc.
Could you apply this change for the next upload in order to fix the build on powerpc?
We're in the middle of packaging Qt 6.6 and I had not planned to do any
more 6.4.2 updates unless absolutely necessary.
Do you know whether this patch will also work on Qt 6.6.1 ?
Of course yes :

,----
| $ rgrep EIGEN_DONT_VECTORIZE qtmultimedia-everywhere-src-6.6.1/
| qtmultimedia-everywhere-src-6.6.1/src/3rdparty/eigen/Eigen/src/Core/util/ConfigureVectorization.h:#if defined(EIGEN_DONT_VECTORIZE)
| qtmultimedia-everywhere-src-6.6.1/src/3rdparty/eigen/Eigen/src/Core/util/ConfigureVectorization.h: #ifndef EIGEN_DONT_VECTORIZE
| qtmultimedia-everywhere-src-6.6.1/src/3rdparty/eigen/Eigen/src/Core/util/ConfigureVectorization.h: #define EIGEN_DONT_VECTORIZE
| qtmultimedia-everywhere-src-6.6.1/src/3rdparty/eigen/Eigen/src/Core/util/ConfigureVectorization.h:#if !(defined(EIGEN_DONT_VECTORIZE) || defined(EIGEN_GPUCC))
| qtmultimedia-everywhere-src-6.6.1/src/3rdparty/eigen/Eigen/src/Core/util/Macros.h: #ifndef EIGEN_DONT_VECTORIZE
| qtmultimedia-everywhere-src-6.6.1/src/3rdparty/eigen/Eigen/src/Core/util/Macros.h: #define EIGEN_DONT_VECTORIZE
| qtmultimedia-everywhere-src-6.6.1/src/3rdparty/eigen/Eigen/src/Core/arch/SYCL/InteropHeaders.h:#if !defined(EIGEN_DONT_VECTORIZE_SYCL)
| qtmultimedia-everywhere-src-6.6.1/src/3rdparty/eigen/Eigen/Core:#if !defined(EIGEN_DONT_VECTORIZE_SYCL)
`----

Christian
Christian Marillat
2023-12-07 07:20:01 UTC
Permalink
Hi!
We're in the middle of packaging Qt 6.6 and I had not planned to do any
more 6.4.2 updates unless absolutely necessary.
Do you know whether this patch will also work on Qt 6.6.1 ?
Yes, absolutely. And since it only adds some powerpc-specific lines to
debian/rules, there is nothing really that would need to be rebased
when updating to a newer Qt version.
It's always safe to apply this patch.
It is possible to see this bug fixed ?

Christian
Patrick Franz
2023-12-07 19:50:01 UTC
Permalink
Hej,

Am Donnerstag, 7. Dezember 2023, 08:09:50 CET schrieb Christian
Post by Christian Marillat
Hi!
We're in the middle of packaging Qt 6.6 and I had not planned to do
any more 6.4.2 updates unless absolutely necessary.
Do you know whether this patch will also work on Qt 6.6.1 ?
Yes, absolutely. And since it only adds some powerpc-specific lines
to debian/rules, there is nothing really that would need to be
rebased when updating to a newer Qt version.
It's always safe to apply this patch.
It is possible to see this bug fixed ?
I'll include the fix in 6.6.1 which is being worked on.
--
Med vänliga hälsningar

Patrick Franz
Christian Marillat
2023-12-07 08:00:01 UTC
Permalink
Hi Christian!
Hi Adrian,
Post by Christian Marillat
It's always safe to apply this patch.
It is possible to see this bug fixed ?
I have uploaded a patched version to unreleased for the time being.
Thanks I didn't noticed.
However, fixing this should be a no-brainer and wouldn't affect anything else.
...

Christian
John Paul Adrian Glaubitz
2024-06-09 16:10:01 UTC
Permalink
Hello,
Post by John Paul Adrian Glaubitz
This can be fixed by switching off vectorization in the »eigen« using the preprocessor
macro EIGEN_DONT_VECTORIZE which can be defined on the cmake command line using the
--- qt6-multimedia-6.4.2/debian/rules.orig 2023-07-26 17:52:13.000000000 +0200
+++ qt6-multimedia-6.4.2/debian/rules 2023-11-28 18:26:47.950137854 +0100
@@ -9,6 +9,10 @@
cmake_extra_args += -DQT_HOST_PATH=/usr
endif
+ifneq (,$(filter $(DEB_HOST_ARCH),powerpc))
+ cmake_extra_args += -DCOMPILE_DEFINITIONS="EIGEN_DONT_VECTORIZE"
+endif
+
With the above change, cmake defines the preprocessor macro EIGEN_DONT_VECTORIZE and
the build succeeds on powerpc.
With qt6-multimedia 6.6.2 qt6-multimedia still fail to build even with
this patch.
I'm unable to find a solution. Adrian do you have an idea ?
The syntax of my proposed solution was wrong. My local tests were not performed
on a clean source which is why I did not notice the suggested syntax didn't work.

The proper syntax is:

ifneq (,$(filter $(DEB_HOST_ARCH),powerpc))
export DEB_CXXFLAGS_MAINT_APPEND = -DEIGEN_DONT_VECTORIZE
endif

@Patrick: Could you update the debian/rules file please to use the above syntax?

Thanks,
Adrian
--
.''`. John Paul Adrian Glaubitz
: :' : Debian Developer
`. `' Physicist
`- GPG: 62FF 8A75 84E0 2956 9546 0006 7426 3B37 F5B5 F913
Patrick Franz
2024-06-13 20:30:01 UTC
Permalink
Hej,

Am Sonntag, 9. Juni 2024, 18:06:09 CEST schrieb John Paul Adrian
Glaubitz:
[...]
Post by John Paul Adrian Glaubitz
The syntax of my proposed solution was wrong. My local tests were not
performed on a clean source which is why I did not notice the
suggested syntax didn't work.
ifneq (,$(filter $(DEB_HOST_ARCH),powerpc))
export DEB_CXXFLAGS_MAINT_APPEND = -DEIGEN_DONT_VECTORIZE
endif
@Patrick: Could you update the debian/rules file please to use the above syntax?
I'll update d/rules once the transition is finished.
--
Med vänliga hälsningar

Patrick Franz
Loading...