Errors when building from source on macOS



  • Hi, I'm trying to build Qt from source on OSX El Capitan 10.11.6.
    I'm running the following script:

    git clone git://code.qt.io/qt/qt5.git Qt5;
    cd Qt5;
    git checkout "5.10";
    ./init-repository;
    ./configure -prefix $PWD/qtbase -opensource -no-framework -nomake tests -nomake examples;
    make -j4;
    

    Unfortunately, I'm getting the following error:

    [28/6446] CXX obj/cc/cc/layer_impl.o
    FAILED: obj/cc/cc/layer_impl.o
    ../../../../../../../../../../Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -MMD -MF obj/cc/cc/layer_impl.o.d -DCC_IMPLEMENTATION=1 -DV8_DEPRECATION_WARNINGS -DNO_TCMALLOC -DDISABLE_NACL -DFULL_SAFE_BROWSING -DSAFE_BROWSING_CSD -DSAFE_BROWSING_DB_LOCAL -DCHROMIUM_BUILD -DFIELDTRIAL_TESTING_ENABLED -DTOOLKIT_QT -DCR_CLANG_REVISION=\"307486-1\" -DCR_XCODE_VERSION=0731 -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__ASSERT_MACROS_DEFINE_VERSIONS_WITHOUT_UNDERSCORE=0 -DNDEBUG -DNVALGRIND -DDYNAMIC_ANNOTATIONS_ENABLED=0 -DSK_IGNORE_LINEONLY_AA_CONVEX_PATH_OPTS -DSK_HAS_PNG_LIBRARY -DSK_HAS_WEBP_LIBRARY -DSK_HAS_JPEG_LIBRARY -DSK_SUPPORT_GPU=1 -DSK_BUILD_FOR_MAC -DENABLE_IPC_FUZZER -DGOOGLE_PROTOBUF_NO_RTTI -DGOOGLE_PROTOBUF_NO_STATIC_INITIALIZER -DHAVE_PTHREAD -DU_USING_ICU_NAMESPACE=0 -DU_ENABLE_DYLOAD=0 -DU_STATIC_IMPLEMENTATION -DICU_UTIL_DATA_IMPL=ICU_UTIL_DATA_FILE -DUCHAR_TYPE=uint16_t -DMESA_EGL_NO_X11_HEADERS -Igen -I../../3rdparty/chromium -I../../3rdparty/chromium/third_party/libwebp/src -I../../3rdparty/chromium/third_party/khronos -I../../3rdparty/chromium/gpu -I../../3rdparty/chromium/skia/config -I../../3rdparty/chromium/skia/ext -I../../3rdparty/chromium/third_party/skia/include/c -I../../3rdparty/chromium/third_party/skia/include/config -I../../3rdparty/chromium/third_party/skia/include/core -I../../3rdparty/chromium/third_party/skia/include/effects -I../../3rdparty/chromium/third_party/skia/include/encode -I../../3rdparty/chromium/third_party/skia/include/images -I../../3rdparty/chromium/third_party/skia/include/lazy -I../../3rdparty/chromium/third_party/skia/include/pathops -I../../3rdparty/chromium/third_party/skia/include/pdf -I../../3rdparty/chromium/third_party/skia/include/pipe -I../../3rdparty/chromium/third_party/skia/include/ports -I../../3rdparty/chromium/third_party/skia/include/utils -I../../3rdparty/chromium/third_party/skia/third_party/vulkan -I../../3rdparty/chromium/third_party/skia/include/gpu -I../../3rdparty/chromium/third_party/skia/src/gpu -I../../3rdparty/chromium/third_party/skia/src/sksl -I../../3rdparty/chromium/third_party/protobuf/src -I../../3rdparty/chromium/third_party/icu/source/common -I../../3rdparty/chromium/third_party/icu/source/i18n -I../../3rdparty/chromium/third_party/mesa/src/include -I../../3rdparty/chromium/third_party/libwebm/source -I../../3rdparty/chromium/third_party/libyuv/include -fno-strict-aliasing -fstack-protector -Wno-builtin-macro-redefined -D__DATE__= -D__TIME__= -D__TIMESTAMP__= -Wno-unknown-attributes -Wno-unknown-warning-option -fcolor-diagnostics -arch x86_64 -Wall -Wextra -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=2 -Wunguarded-availability -Wno-missing-field-initializers -Wno-unused-parameter -Wno-c++11-narrowing -Wno-covered-switch-default -Wno-unneeded-internal-declaration -Wno-inconsistent-missing-override -Wno-undefined-var-template -Wno-nonportable-include-path -Wno-address-of-packed-member -Wno-unused-lambda-capture -Wno-user-defined-warnings -O2 -fno-omit-frame-pointer -g0 -isysroot ../../../../../../../../../../Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.11.sdk -mmacosx-version-min=10.10 -fvisibility=hidden -Wheader-hygiene -Wstring-conversion -Wtautological-overlap-compare -Wno-parentheses-equality -Wno-tautological-compare -Wno-undefined-bool-conversion -Wno-tautological-undefined-compare -std=c++11 -stdlib=libc++ -fno-rtti -fno-exceptions -fvisibility-inlines-hidden -include obj/cc/cc/precompile.h-cc -c ../../3rdparty/chromium/cc/layers/layer_impl.cc -o obj/cc/cc/layer_impl.o
    fatal error: error in backend: Cannot select: 0x104623d80: i32 = fadd 0x10462eab0, ConstantFP:f32<0.000000e+00>
      0x10462eab0: i32,glue = X86ISD::CMOV 0x104626eb0, Constant:i32<0>, Constant:i8<15>, 0x104625d80
        0x104626eb0: i32 = add 0x104629240, 0x10461ef10
          0x104629240: i32,ch = load<LD4[%138]> 0x104627fe0:1, 0x10461e7f0, undef:i64
            0x10461e7f0: i64 = add 0x10462d850, Constant:i64<36>
              0x10462d850: i64,ch = CopyFromReg 0x10c0f8b80, Register:i64 %vreg30
                0x1045fcbf0: i64 = Register %vreg30
              0x104628660: i64 = Constant<36>
            0x104622530: i64 = undef
          0x10461ef10: i32 = truncate 0x104629eb0
            0x104629eb0: i64 = srl 0x104627fe0, Constant:i8<32>
              0x104627fe0: i64,ch,glue = CopyFromReg 0x10461ecb0, Register:i64 %RAX, 0x10461ecb0:1
                0x104622fe0: i64 = Register %RAX
                0x10461ecb0: ch,glue = callseq_end 0x10461e330, TargetConstant:i64<0>, TargetConstant:i64<0>, 0x10461e330:1
                  0x104624530: i64 = TargetConstant<0>
                  0x104624530: i64 = TargetConstant<0>
                  0x10461e330: ch,glue = X86ISD::CALL 0x10462cbe0, TargetGlobalAddress:i64<i64 (%"class.gfx::Vector2dF"*)* @_ZN3gfx16ToCeiledVector2dERKNS_9Vector2dFE> 0, Register:i64 %RDI, RegisterMask:Untyped, 0x10462cbe0:1
                    0x104628fe0: i64 = TargetGlobalAddress<i64 (%"class.gfx::Vector2dF"*)* @_ZN3gfx16ToCeiledVector2dERKNS_9Vector2dFE> 0
                    0x1046238c0: i64 = Register %RDI
                    0x104621fe0: Untyped = RegisterMask
                    0x10462cbe0: ch,glue = CopyToReg 0x104628400, Register:i64 %RDI, FrameIndex:i64<0>
                      0x1046238c0: i64 = Register %RDI
                      0x104629c50: i64 = FrameIndex<0>
              0x10462c000: i8 = Constant<32>
        0x104624eb0: i32 = Constant<0>
        0x104624c50: i8 = Constant<15>
        0x104625d80: i32 = X86ISD::CMP 0x104626eb0, Constant:i32<0>
          0x104626eb0: i32 = add 0x104629240, 0x10461ef10
            0x104629240: i32,ch = load<LD4[%138]> 0x104627fe0:1, 0x10461e7f0, undef:i64
              0x10461e7f0: i64 = add 0x10462d850, Constant:i64<36>
                0x10462d850: i64,ch = CopyFromReg 0x10c0f8b80, Register:i64 %vreg30
                  0x1045fcbf0: i64 = Register %vreg30
                0x104628660: i64 = Constant<36>
              0x104622530: i64 = undef
            0x10461ef10: i32 = truncate 0x104629eb0
              0x104629eb0: i64 = srl 0x104627fe0, Constant:i8<32>
                0x104627fe0: i64,ch,glue = CopyFromReg 0x10461ecb0, Register:i64 %RAX, 0x10461ecb0:1
                  0x104622fe0: i64 = Register %RAX
                  0x10461ecb0: ch,glue = callseq_end 0x10461e330, TargetConstant:i64<0>, TargetConstant:i64<0>, 0x10461e330:1
                    0x104624530: i64 = TargetConstant<0>
                    0x104624530: i64 = TargetConstant<0>
                    0x10461e330: ch,glue = X86ISD::CALL 0x10462cbe0, TargetGlobalAddress:i64<i64 (%"class.gfx::Vector2dF"*)* @_ZN3gfx16ToCeiledVector2dERKNS_9Vector2dFE> 0, Register:i64 %RDI, RegisterMask:Untyped, 0x10462cbe0:1
                      0x104628fe0: i64 = TargetGlobalAddress<i64 (%"class.gfx::Vector2dF"*)* @_ZN3gfx16ToCeiledVector2dERKNS_9Vector2dFE> 0
                      0x1046238c0: i64 = Register %RDI
                      0x104621fe0: Untyped = RegisterMask
                      0x10462cbe0: ch,glue = CopyToReg 0x104628400, Register:i64 %RDI, FrameIndex:i64<0>
    
    
                0x10462c000: i8 = Constant<32>
          0x104624eb0: i32 = Constant<0>
      0x10462cd10: f32 = ConstantFP<0.000000e+00>
    In function: _ZNK2cc9LayerImpl11AsValueIntoEPN4base11trace_event11TracedValueE
    clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)
    Apple LLVM version 7.3.0 (clang-703.0.31)
    Target: x86_64-apple-darwin15.6.0
    Thread model: posix
    InstalledDir: /Users/martin/dev/Qt5/qtwebengine/src/core/release/../../../../../../../../../../Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
    clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.
    clang: note: diagnostic msg:
    ********************
    
    PLEASE ATTACH THE FOLLOWING FILES TO THE BUG REPORT:
    Preprocessed source(s) and associated run script(s) are located at:
    clang: note: diagnostic msg: /var/folders/d9/vsbynkf56rgc3q65cr5910p00000gn/T/layer_impl-fc7474.cpp
    clang: note: diagnostic msg: /var/folders/d9/vsbynkf56rgc3q65cr5910p00000gn/T/layer_impl-fc7474.sh
    clang: note: diagnostic msg:
    
    ********************
    [33/6446] CXX obj/media/gpu/gpu/vt_video_decode_accelerator_mac.o
    ninja: build stopped: subcommand failed.
    make[5]: *** [run_ninja] Error 1
    make[4]: *** [release-all] Error 2
    make[3]: *** [sub-gn_run-pro-make_first] Error 2
    make[2]: *** [sub-core-make_first] Error 2
    make[1]: *** [sub-src-make_first] Error 2
    make: *** [module-qtwebengine-make_first] Error 2
    

    Is there anything I'm doing wrong here that could be causing the issue?
    Many thanks!


  • Lifetime Qt Champion

    Hi,

    No, it seems to be a bug in Apple’s clang.

    Can you update your version of Xcode ?



  • I see. Unfortunately, there are no current updates for Xcode available, as I'm running El Capitan and they require 10.12.
    I was hoping that I could build Qt without frameworks as a workaround for my original issue, for which I've made a post now: https://forum.qt.io/topic/86688/debugging-qt-with-lldb-on-macos


  • Lifetime Qt Champion

    That has nothing to do with a no framework build.

    It's the QtWebEngine module dependency that is failing to build.

    So the question is: do you need the QtWebEngine module ? If not, then just don't build it.



  • The reason I mentioned a no framework build is because there seems to be an issue, which makes it difficult to debug Qt apps with frameworks on macOS unless done through QtCreator. My idea was to build both the release and debug libraries separately, so that I could get around the frameworks debug issue.
    Ultimately, I'd like to build PySide2 while still being able to debug Qt.
    I'm not entirely sure, but I think QtWebEngine is required to build PySide2, no?
    Looking through the PySide2 docs, I couldn't find a build flag to blacklist a module (like QtWebEngine for example).


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.