[Buildroot] Analysis of build failures

Richard Genoud richard.genoud at gmail.com
Tue May 5 11:00:41 UTC 2015

On 04/05/2015 23:30, Thomas Petazzoni wrote:
> Dear Richard Genoud,
> On Mon, 4 May 2015 16:57:59 +0200, Richard Genoud wrote:
>>>  > We currently only allow BR2_PACKAGE_QT_QT_COORD_TYPE_DOUBLE for soft
>>>  > float toolchains, but perhaps it needs to also be disallowed for mips64?
>>>  > Richard, care to take a look?
>>> QT_COORD_TYPE_DOUBLE also causes issues with python-pyqt because of
>>> qreal* -> float* conversion. Could you take a look?
>>> http://autobuild.buildroot.net/results/891/891dc6ad46039740867a0b436281fc489cfb2772/build-end.log
>> yes, no problem.
> And I also believe
> http://autobuild.buildroot.org/results/3a7/3a70305be4a78af9404b0bd027dbcdd011ca01b3/build-end.log
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QPen::setWidthF(float)'
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QTransform::translate(float, float)'
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QMatrix::setMatrix(float, float, float, float, float, float)'
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QTransform::rotate(float, Qt::Axis)'
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QColor::setRgbF(float, float, float, float)'
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QPen::setDashOffset(float)'
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QColor::setAlphaF(float)'
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QPen::setMiterLimit(float)'
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QTransform::QTransform(float, float, float, float, float, float)'
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QColor::setCmykF(float, float, float, float, float)'
> ../../qt4/src/.libs/libpoppler-qt4.so: undefined reference to `QPen::setDashPattern(QVector<float> const&)'
> The libpoppler code is expecting "float" arguments for all these
> functions, but they are now taking "double" instead.
> Seems like using a double type is breaking a lot of assumptions of
> existing applications and libraries. Do we really want to support this
> option?
> I would personally suggest to revert the patch for now in 2015.05, and
> take the time to make sure it is properly tested with all the Qt-based
> libraries and applications.
> Richard, what do you think?

Ok, I've found the right Config.in depends to set to BR2_PACKAGE_QT_QT_COORD_TYPE_DOUBLE.
It shouldn't break in any arch now.
I also corrected the breakage with python-pyqt.

BUT, there's still some packages (at least poppler and pinentry (I started to compile more packages, but my internet liaison at work stalls quite often))
that are breaking when BR2_PACKAGE_QT_QT_COORD_TYPE_DOUBLE is set.
The reason is that those packages are not using qmake, so the -DQT_COORD_TYPE=double doesn't appear in their CFLAGS/CXXFLAGS.
So, for all packages that use Qt but not qmake, the CFLAGS/CXXFLAGS have to be appended with -DQT_COORD_TYPE=double

That said, this option was originally created for QWT (http://qwt.sourceforge.net/ ):
The problem was that QWT uses qreals to draw its curves/plots/... and when you want to have dates(QwtDate) on an axe, the dates are converted to qreal,
and if qreal is float, the precision is not enough (not even by a day).
So, forcing qreal to float seems a good solution.

Given the fact that 2015.05 is close, and that there's quite some packages to test with this option (and that it's not a huge feature-killer), I agree with
Thomas for reverting it.

For reference, I'm pasting the patch I've come with to prevent breaking any architecture.

>From 66963b129eed082cdd5948c884ddfa4d5d8d4480 Mon Sep 17 00:00:00 2001
From: Richard Genoud <richard.genoud at gmail.com>
Date: Mon, 4 May 2015 16:29:51 +0200
Subject: [PATCH] qt: correct QT_COORD_TYPE_DOUBLE selection logic

We have to mimic exactly the #define logic of QT_COORD_TYPE
in Qt/src/corelib/global/qglobal.h

And if qreal is forced to double,

Reported-by: Peter Korsgaard <peter at korsgaard.com>
Signed-off-by: Richard Genoud <richard.genoud at gmail.com>
 package/python-pyqt/Config.in | 1 +
 package/qt/Config.in          | 5 ++++-
 2 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/package/python-pyqt/Config.in b/package/python-pyqt/Config.in
index a50cb74a43d0..3d7bfd859e32 100644
--- a/package/python-pyqt/Config.in
+++ b/package/python-pyqt/Config.in
@@ -18,6 +18,7 @@ if BR2_PACKAGE_PYTHON_PYQT
 	default y if BR2_arm || BR2_armeb
 	default y if BR2_sh4 || BR2_sh4eb || BR2_sh4a || BR2_sh4aeb
 	default y if (BR2_mipsel || BR2_mips) && BR2_PACKAGE_QT_EMBEDDED
diff --git a/package/qt/Config.in b/package/qt/Config.in
index 9568b7010cff..30028096c059 100644
--- a/package/qt/Config.in
+++ b/package/qt/Config.in
@@ -121,7 +121,10 @@ config BR2_PACKAGE_QT_CONFIG_FILE
 	  file, which Buildroot will give to Qt at compile time.
-	depends on BR2_SOFT_FLOAT
+	depends on (BR2_sh4 || BR2_sh4eb || BR2_sh4a || BR2_sh4aeb) || \
+		(BR2_SOFT_FLOAT && \
+			(BR2_arm || BR2_armeb || \
+				(BR2_PACKAGE_QT_EMBEDDED && (BR2_mipsel || BR2_mips))))
 	bool "QT_COORD_TYPE to double"
 	  Set QT_COORD_TYPE to double. On ARM-based platforms, qreal

More information about the buildroot mailing list