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

Qt6 Beta4 fails to compile with Clang - SIMD issues

    XMLWordPrintable

Details

    • Bug
    • Resolution: Duplicate
    • Not Evaluated
    • None
    • 6.0.0 Beta4
    • Core: Other
    • None
    • Cmake version 3.18.4
      Clang version 11.0.0
          Target: x86_64-pc-windows-msvc
    • Windows

    Description

      When building Qt6 beta 4 with clang, it fails to build qtbase with missing SIMD functions.

       

      [3/6697] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/Debug/global/qsimd.cpp.obj
      FAILED: qtbase/src/corelib/CMakeFiles/Core.dir/Debug/global/qsimd.cpp.obj
      C:\PROGRA~1\LLVM\bin\CLANG_~1.EXE -DCore_EXPORTS -DPCRE2_CODE_UNIT_WIDTH=16 -DPCRE2_STATIC -DQT_ASCII_CAST_WARNINGS -DQT_BUILDING_QT -DQT_BUILD_CORE_LIB -DQT_CORE_QOBJECT_LIB -DQT_DEPRECATED_WARNINGS -DQT_DEPRECATED_WARNINGS_SINCE=0x060000 -DQT_DISABLE_DEPRECATED_BEFORE=0x040800 -DQT_MOC_COMPAT -DQT_NO_FOREACH -DQT_NO_USING_NAMESPACE -DQT_USE_QSTRINGBUILDER -DUNICODE -DWIN32 -DWIN64 -D_ENABLE_EXTENDED_ALIGNED_STORAGE -D_UNICODE -D_USE_MATH_DEFINES -D_WIN64 -DCMAKE_INTDIR=\"Debug\" -Iqtbase/src/corelib/Core_autogen/include_Debug -Iqtbase/include -Iqtbase/include/QtCore -Iqtbase/src/corelib -Iqtbase/src/corelib/global -Iqtbase/src/corelib/../3rdparty/tinycbor/src -Iqtbase/include/QtCore/6.0.0 -Iqtbase/include/QtCore/6.0.0/QtCore -Iqtbase/src/corelib/../3rdparty/double-conversion/.. -Iqtbase/src/corelib/../3rdparty/double-conversion/include -Iqtbase/src/corelib/.rcc -Iqtbase/mkspecs/win32-clang-msvc -Iqtbase/src/3rdparty/pcre2/src -isystem C:/Strawberry/c/include -g -Xclang -gcodeview -D_DEBUG -D_DLL -D_MT -Xclang --dependent-lib=msvcrtd -fvisibility-inlines-hidden -Wall -Wextra -Wno-ignored-attributes -std=c++17 -Xclang -include-pch -Xclang D:/Dev/Github/Qt6/qtbase/src/corelib/CMakeFiles/Core.dir/Debug/cmake_pch.hxx.pch -Xclang -include -Xclang D:/Dev/Github/Qt6/qtbase/src/corelib/CMakeFiles/Core.dir/Debug/cmake_pch.hxx -MD -MT qtbase/src/corelib/CMakeFiles/Core.dir/Debug/global/qsimd.cpp.obj -MF qtbase\src\corelib\CMakeFiles\Core.dir\Debug\global\qsimd.cpp.obj.d -o qtbase/src/corelib/CMakeFiles/Core.dir/Debug/global/qsimd.cpp.obj -c qtbase/src/corelib/global/qsimd.cpp
      qtbase/src/corelib/global/qsimd.cpp:660:44: error: use of undeclared identifier '_rdrand64_step'
      using randuint = ExtractParameter<decltype(_rdrandXX_step)>::Type;
       ^
      qtbase/src/corelib/global/qsimd.cpp:647:28: note: expanded from macro '_rdrandXX_step'
      # define _rdrandXX_step _rdrand64_step
       ^
      qtbase/src/corelib/global/qsimd.cpp:671:25: error: use of undeclared identifier 'randuint'
       while (ptr + sizeof(randuint) / sizeof(*ptr) <= end) {
       ^
      qtbase/src/corelib/global/qsimd.cpp:672:45: error: unknown type name 'randuint'
       if (_rdseedXX_step(reinterpret_cast<randuint *>(ptr)) == 0)
       ^
      qtbase/src/corelib/global/qsimd.cpp:672:13: error: use of undeclared identifier '_rdseed64_step'
       if (_rdseedXX_step(reinterpret_cast<randuint *>(ptr)) == 0)
       ^
      qtbase/src/corelib/global/qsimd.cpp:648:28: note: expanded from macro '_rdseedXX_step'
      # define _rdseedXX_step _rdseed64_step
       ^
      qtbase/src/corelib/global/qsimd.cpp:674:23: error: use of undeclared identifier 'randuint'
       ptr += sizeof(randuint) / sizeof(*ptr);
       ^
      qtbase/src/corelib/global/qsimd.cpp:677:32: error: use of undeclared identifier 'randuint'
       if (sizeof(*ptr) != sizeof(randuint) && ptr != end) {
       ^
      qtbase/src/corelib/global/qsimd.cpp:678:13: error: use of undeclared identifier '_rdseed32_step'
       if (_rdseed32_step(ptr) == 0)
       ^
      qtbase/src/corelib/global/qsimd.cpp:696:25: error: use of undeclared identifier 'randuint'
       while (ptr + sizeof(randuint)/sizeof(*ptr) <= end) {
       ^
      qtbase/src/corelib/global/qsimd.cpp:697:45: error: unknown type name 'randuint'
       if (_rdrandXX_step(reinterpret_cast<randuint *>(ptr)))
       ^
      qtbase/src/corelib/global/qsimd.cpp:697:13: error: use of undeclared identifier '_rdrand64_step'
       if (_rdrandXX_step(reinterpret_cast<randuint *>(ptr)))
       ^
      qtbase/src/corelib/global/qsimd.cpp:647:28: note: expanded from macro '_rdrandXX_step'
      # define _rdrandXX_step _rdrand64_step
       ^
      qtbase/src/corelib/global/qsimd.cpp:698:27: error: use of undeclared identifier 'randuint'
       ptr += sizeof(randuint)/sizeof(*ptr);
       ^
      qtbase/src/corelib/global/qsimd.cpp:703:35: error: use of undeclared identifier 'randuint'
       while (sizeof(*ptr) != sizeof(randuint) && ptr != end) {
       ^
      qtbase/src/corelib/global/qsimd.cpp:704:19: error: use of undeclared identifier '_rdrand32_step'
       bool ok = _rdrand32_step(ptr);
       ^
      13 errors generated.
      [28/6697] Building CXX object qtbase/src/corelib/CMakeFiles/Core.dir/Debug/kernel/qmetatype.cpp.obj
      ninja: build stopped: subcommand failed.

       

      I think the problem is with the #ifdef logic inside Clang's flavor of immintrin.h. 

       

      #if !(defined(_MSC_VER) || defined(__SCE__)) || __has_feature(modules) || \
       defined(__RDRND__)
      static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
      _rdrand16_step(unsigned short *__p)
      {
       return __builtin_ia32_rdrand16_step(__p);
      }
      static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
      _rdrand32_step(unsigned int *__p)
      {
       return __builtin_ia32_rdrand32_step(__p);
      }
      #ifdef __x86_64__
      static __inline__ int __attribute__((__always_inline__, __nodebug__, __target__("rdrnd")))
      _rdrand64_step(unsigned long long *__p)
      {
       return __builtin_ia32_rdrand64_step(__p);
      }
      #endif
      #endif /* __RDRND__ */
      

       

      Attachments

        1. CMakeCache.txt
          159 kB
        2. config.opt
          0.6 kB

        Issue Links

          For Gerrit Dashboard: QTBUG-88434
          # Subject Branch Project Status CR V

          Activity

            People

              thiago Thiago Macieira
              hernan.c.martinez Hernan da Cunha Martinez
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes