Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-33781

Build errors with QT_COORD_TYPE=double for Android ARM

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • 5.2.0 RC1
    • 5.1.0
    • GUI: Painting
    • None
    • Linux 3.8.0-19-generic #30-Ubuntu x86_64 GNU/Linux
      android ndk-r9
    • e696bef863ba4cc21a36cbfdc0d6e811060916f7

    Description

      Trying to build Qt5 from sources with qreal as double instead of float for ARM platform.

      I used configure with -DQT_COORD_TYPE=double

      Got an error:

      cd gui/ && ( test -e Makefile || /home/user/Qt5.1.1/5.1.1/android_armv7_double/qtbase/bin/qmake /home/user/Qt5.1.1/5.1.1/android_armv7_double/qtbase/src/gui/gui.pro -o Makefile ) && make -f Makefile
      make[3]: Entering directory `/home/user/Qt5.1.1/5.1.1/android_armv7_double/qtbase/src/gui'
      /home/user/Android/android-ndk-r9/toolchains/arm-linux-androideabi-4.8/prebuilt/linux-x86_64/bin/arm-linux-androideabi-g++ -c -Wno-psabi -march=armv7-a -mfloat-abi=softfp -mfpu=vfp -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -DANDROID -Wa,--noexecstack -std=gnu++0x -g -g -marm -O0 -fno-omit-frame-pointer -fvisibility=hidden -fvisibility-inlines-hidden -fno-exceptions -Wall -Wno-psabi -W -D_REENTRANT -fPIC -DQT_NO_PRINTDIALOG -DQT_NO_LIBUDEV -DQT_NO_XCB -DQT_NO_XKBCOMMON -DQT_COORD_TYPE=double -DQT_NO_USING_NAMESPACE -DQT_BUILD_GUI_LIB -DQT_BUILDING_QT -DQT_NO_CAST_TO_ASCII -DQT_ASCII_CAST_WARNINGS -DQT_MOC_COMPAT -DQT_USE_QSTRINGBUILDER -DQT_DEPRECATED_WARNINGS -DQT_DISABLE_DEPRECATED_BEFORE=0x050000 -DQT_USE_BUNDLED_LIBPNG -DQT_NO_EXCEPTIONS -DQT_CORE_LIB -mfpu=neon -I../../mkspecs/android-g++ -I. -I../../include -I../../include/QtGui -I../../include/QtGui/5.1.1 -I../../include/QtGui/5.1.1/QtGui -Iimage -I../3rdparty/libpng -I../../include/QtCore -I../../include/QtCore/5.1.1 -I../../include/QtCore/5.1.1/QtCore -I.moc/debug-shared -I/home/user/Android/android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.8/include -I/home/user/Android/android-ndk-r9/sources/cxx-stl/gnu-libstdc++/4.8/libs/armeabi-v7a/include -I/home/user/Android/android-ndk-r9/platforms/android-9/arch-arm/usr/include painting/qdrawhelper_neon.cpp -o .obj/debug-shared/qdrawhelper_neon.o
      In file included from ../../include/QtGui/5.1.1/QtGui/private/qdrawhelper_p.h:1:0,
                      from painting/qdrawhelper_neon.cpp:42:
      ../../include/QtGui/5.1.1/QtGui/private/../../../../../src/gui/painting/qdrawhelper_p.h: In instantiation of 'static void QRadialFetchSimd<Simd>::fetch(uint*, uint*, const Operator*, const QSpanData*, qreal, qreal, qreal, qreal, qreal) [with Simd = QSimdNeon; uint = unsigned int; qreal = double]':
      ../../include/QtGui/5.1.1/QtGui/private/../../../../../src/gui/painting/qdrawhelper_p.h:440:98:   required from 'const uint* qt_fetch_radial_gradient_template(uint*, const Operator*, const QSpanData*, int, int, int) [with RadialFetchFunc = QRadialFetchSimd<QSimdNeon>; uint = unsigned int]'
      painting/qdrawhelper_neon.cpp:995:106:   required from here
      ../../include/QtGui/5.1.1/QtGui/private/../../../../../src/gui/painting/qdrawhelper_p.h:503:94: error: call of overloaded 'v_dup(qreal)' is ambiguous
              const typename Simd::Float32x4 v_delta_delta_det16 = Simd::v_dup(16 * delta_delta_det);
                                                                                                   ^
      ../../include/QtGui/5.1.1/QtGui/private/../../../../../src/gui/painting/qdrawhelper_p.h:503:94: note: candidates are:
      painting/qdrawhelper_neon.cpp:967:29: note: static QSimdNeon::Float32x4 QSimdNeon::v_dup(float)
          static inline Float32x4 v_dup(float x) { return vdupq_n_f32(x); }
                                  ^
      ...
      ...
      painting/qdrawhelper_neon.cpp:969:27: note: static QSimdNeon::Int32x4 QSimdNeon::v_dup(uint)
          static inline Int32x4 v_dup(uint x) { return vdupq_n_s32(x); }
                                ^
      make[3]: *** [.obj/debug-shared/qdrawhelper_neon.o] Error 1
      

      Fixed by changing source code in qtbase/src/gui/paining/qdrawhelper_p.h (explicit cast to float)

      Line 502:

              const typename Simd::Float32x4 v_delta_delta_det16 = Simd::v_dup({color:red}(float){color} (16 * delta_delta_det));
              const typename Simd::Float32x4 v_delta_delta_det6 = Simd::v_dup({color:red}(float){color} (6 * delta_delta_det));
              const typename Simd::Float32x4 v_delta_b4 = Simd::v_dup(float(4 * delta_b));
      
              const typename Simd::Float32x4 v_r0 = Simd::v_dup({color:red}(float){color} (data->gradient.radial.focal.radius));
              const typename Simd::Float32x4 v_dr = Simd::v_dup({color:red}(float){color} (op->radial.dr));
      
              const typename Simd::Float32x4 v_min = Simd::v_dup(0.0f);
              const typename Simd::Float32x4 v_max = Simd::v_dup({color:red}(float){color} (GRADIENT_STOPTABLE_SIZE-1));
              const typename Simd::Float32x4 v_half = Simd::v_dup(0.5f);
      

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            tvete Paul Olav Tvete
            zeal0t Sergey Monichev
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes