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

Qt fails to build from source for single-arch Android x86_64

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P1: Critical
    • None
    • 5.15.1, 5.15.2
    • Build System
    • None
    • macOS
    • Android

    Description

      Building Qt for the single target architecture x86_64 fails with:

       2020-09-20T20:23:24.3746450Z .obj/qdrawhelper.o:qdrawhelper.cpp:function intermediate_adder(unsigned int*, unsigned int*, IntermediateBuffer const&, int, int&, int): error: undefined reference to 'intermediate_adder_avx2(unsigned int*, unsigned int*, IntermediateBuffer const&, int, int&, int)'
      2020-09-20T20:23:24.3756540Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'qt_memfill32_avx2(unsigned int*, unsigned int, long long)'
      2020-09-20T20:23:24.3850200Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'qt_memfill64_avx2(unsigned long long*, unsigned long long, long long)'
      2020-09-20T20:23:24.3954290Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'qt_blend_rgb32_on_rgb32_avx2(unsigned char*, int, unsigned char const*, int, int, int, int)'
      2020-09-20T20:23:24.4060720Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'qt_blend_argb32_on_argb32_avx2(unsigned char*, int, unsigned char const*, int, int, int, int)'
      2020-09-20T20:23:24.4093930Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'comp_func_Source_avx2(unsigned int*, unsigned int const*, int, unsigned int)'
      2020-09-20T20:23:24.4096180Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'comp_func_SourceOver_avx2(unsigned int*, unsigned int const*, int, unsigned int)'
      2020-09-20T20:23:24.7778640Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'comp_func_solid_SourceOver_avx2(unsigned int*, int, unsigned int, unsigned int)'
      2020-09-20T20:23:24.7825560Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'comp_func_Source_rgb64_avx2(QRgba64*, QRgba64 const*, int, unsigned int)'
      2020-09-20T20:23:24.7836770Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'comp_func_SourceOver_rgb64_avx2(QRgba64*, QRgba64 const*, int, unsigned int)'
      2020-09-20T20:23:24.7838740Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'comp_func_solid_SourceOver_rgb64_avx2(QRgba64*, int, QRgba64, unsigned int)'
      2020-09-20T20:23:24.7840780Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'fetchTransformedBilinearARGB32PM_simple_scale_helper_avx2(unsigned int*, unsigned int*, QTextureData const&, int&, int&, int, int)'
      2020-09-20T20:23:24.7842620Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'fetchTransformedBilinearARGB32PM_downscale_helper_avx2(unsigned int*, unsigned int*, QTextureData const&, int&, int&, int, int)'
      2020-09-20T20:23:24.7844880Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'fetchTransformedBilinearARGB32PM_fast_rotate_helper_avx2(unsigned int*, unsigned int*, QTextureData const&, int&, int&, int, int)'
      2020-09-20T20:23:24.7846630Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'fetchARGB32ToARGB32PM_avx2(unsigned int*, unsigned char const*, int, int, QVector<unsigned int> const*, QDitherInfo*)'
      2020-09-20T20:23:24.7848250Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'convertARGB32ToARGB32PM_avx2(unsigned int*, int, QVector<unsigned int> const*)'
      2020-09-20T20:23:24.7849880Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'fetchRGBA8888ToARGB32PM_avx2(unsigned int*, unsigned char const*, int, int, QVector<unsigned int> const*, QDitherInfo*)'
      2020-09-20T20:23:24.7851490Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'convertRGBA8888ToARGB32PM_avx2(unsigned int*, int, QVector<unsigned int> const*)'
      2020-09-20T20:23:24.7853080Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'convertARGB32ToRGBA64PM_avx2(QRgba64*, unsigned int const*, int, QVector<unsigned int> const*, QDitherInfo*)'
      2020-09-20T20:23:24.7854750Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'convertRGBA8888ToRGBA64PM_avx2(QRgba64*, unsigned int const*, int, QVector<unsigned int> const*, QDitherInfo*)'
      2020-09-20T20:23:24.7856420Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'fetchARGB32ToRGBA64PM_avx2(QRgba64*, unsigned char const*, int, int, QVector<unsigned int> const*, QDitherInfo*)'
      2020-09-20T20:23:24.7858090Z .obj/qdrawhelper.o:qdrawhelper.cpp:function _GLOBAL__sub_I_qdrawhelper.cpp: error: undefined reference to 'fetchRGBA8888ToRGBA64PM_avx2(QRgba64*, unsigned char const*, int, int, QVector<unsigned int> const*, QDitherInfo*)'
      2020-09-20T20:23:24.7859390Z clang++: error: linker command failed with exit code 1 (use -v to see invocation)
      2020-09-20T20:23:24.7859960Z make[9]: *** [../../lib/libQt5Gui_x86_64.so] Error 1

      Analysing logs and sources reveals:

      1. There is no AVX support on Android x86_64:
        https://developer.android.com/ndk/guides/abis
      2. "Configure summary" reports AVX2 under "Configuration:" and "Target compiler supports:", but not in "Building for: ... CPU features:"
        2020-09-20T20:06:43.7217570Z Building on: macx-clang (x86_64, CPU features: cx16 mmx sse sse2 sse3 ssse3 sse4.1)
        2020-09-20T20:06:43.7264580Z Building for: android-clang (x86_64, CPU features: cx16 mmx popcnt sse sse2 sse3 ssse3 sse4.1 sse4.2 sse4)
        2020-09-20T20:06:43.7402850Z Target compiler: clang (Apple) 9.0.8
        2020-09-20T20:06:43.7488730Z Configuration: cross_compile sse2 aesni sse3 ssse3 sse4_1 sse4_2 avx avx2 avx512f avx512bw avx512cd avx512dq avx512er avx512ifma avx512pf avx512vbmi avx512vl compile_examples enable_new_dtags f16c precompile_header rdrnd rdseed shani x86SimdAlways shared shared release c++11 c++14 c++17 c++1z concurrent no-pkg-config reduce_exports reduce_relocations release_tools stl
        2020-09-20T20:06:43.9270760Z Build options:
        2020-09-20T20:06:43.9272430Z   Mode ................................... release; optimized tools
        2020-09-20T20:06:43.9280210Z   Optimize release build for size ........ no
        2020-09-20T20:06:43.9286940Z   Building shared libraries .............. yes
        2020-09-20T20:06:43.9294460Z   Using C standard ....................... C11
        2020-09-20T20:06:43.9297040Z   Using C++ standard ..................... C++17
        2020-09-20T20:06:43.9299490Z   Using ccache ........................... no
        2020-09-20T20:06:43.9305230Z   Using new DTAGS ........................ yes
        2020-09-20T20:06:43.9306150Z   Relocatable ............................ yes
        2020-09-20T20:06:43.9314140Z   Using precompiled headers .............. yes
        2020-09-20T20:06:43.9316430Z   Using LTCG ............................. no
        2020-09-20T20:06:43.9317190Z   Target compiler supports:
        2020-09-20T20:06:43.9317900Z     SSE .................................. SSE2 SSE3 SSSE3 SSE4.1 SSE4.2
        2020-09-20T20:06:43.9327300Z     AVX .................................. AVX AVX2
        2020-09-20T20:06:43.9332990Z     AVX512 ............................... F ER CD PF DQ BW VL IFMA VBMI
        2020-09-20T20:06:43.9334200Z     Other x86 ............................ AES F16C RDRAND SHA
        2020-09-20T20:06:43.9336300Z     Intrinsics without -mXXX option ...... yes
        2020-09-20T20:06:43.9355010Z   Build parts ............................ libs
        2020-09-20T20:06:43.9357790Z   App store compliance ................... yes
        
      3. The missing functions are used in src/gui/painting/qdrawhelper.cpp when  QT_COMPILER_SUPPORTS_AVX2 is defined. This is the case in the detected configuration: The definition is in src/corelib/global/qconfig.h.
      4. The missing functions are defined in src/gui/painting/qdrawhelper_avx2.cpp. By src/gui/painting/painting.pri, this source files is not compiled and linked for Android.
      5. The issue seems to be hidden from CI which is doing only a multi-architecture build for Android. Despite being multi-architecture, this build only reports an ARM CPU configuration. For example, a recent log from COIN:
         agent:2020/09/19 21:58:49 build.go:302: Building on: macx-clang (x86_64, CPU features: cx16 mmx sse sse2 sse3 ssse3 sse4.1)
        agent:2020/09/19 21:58:49 build.go:302: Building for: android-clang (arm64, CPU features: neon)
        agent:2020/09/19 21:58:49 build.go:302: Target compiler: clang (Apple) 8.0.7
        agent:2020/09/19 21:58:49 build.go:302: Configuration: cross_compile compile_examples enable_new_dtags neon precompile_header shared shared release c++11 c++14 c++17 c++1z concurrent no-pkg-config reduce_exports stl
        agent:2020/09/19 21:58:49 build.go:302: Build options:
        agent:2020/09/19 21:58:49 build.go:302:   Mode ................................... release
        agent:2020/09/19 21:58:49 build.go:302:   Optimize release build for size ........ no
        agent:2020/09/19 21:58:49 build.go:302:   Building shared libraries .............. yes
        agent:2020/09/19 21:58:49 build.go:302:   Using C standard ....................... C11
        agent:2020/09/19 21:58:49 build.go:302:   Using C++ standard ..................... C++17
        agent:2020/09/19 21:58:49 build.go:302:   Using ccache ........................... no
        agent:2020/09/19 21:58:49 build.go:302:   Using new DTAGS ........................ yes
        agent:2020/09/19 21:58:49 build.go:302:   Relocatable ............................ yes
        agent:2020/09/19 21:58:49 build.go:302:   Using precompiled headers .............. yes
        agent:2020/09/19 21:58:49 build.go:302:   Using LTCG ............................. no
        agent:2020/09/19 21:58:49 build.go:302:   Target compiler supports:
        agent:2020/09/19 21:58:49 build.go:302:     NEON ................................. yes
        agent:2020/09/19 21:58:49 build.go:302:   Build parts ............................ libs
        agent:2020/09/19 21:58:49 build.go:302:   App store compliance ................... yes

        — there is no other "Building for:" line. This seems to create a configuration which happens to work for the its combination of definitions and source files. Note that some CPU feature definitions for Android x86(_64) are set explicitly in src/gui/painting/painting.pri and src/gui/image/image.pri.

      Attachments

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

        Activity

          People

            qtbuildsystem Qt Build System Team
            dg0yt Kai Pastor
            Votes:
            1 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes