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

Qt build with SDK 10.13

    XMLWordPrintable

Details

    • Bug
    • Resolution: Invalid
    • Not Evaluated
    • None
    • 5.12.4
    • Core: Other
    • None
    • macOS

    Description

      Build with SDK 10.13

      xcrun --show-sdk-version
      10.13
      

       

      kernel/qcore_mac_objc.mm:147:13: error: use of undeclared identifier
            'backtrace_from_fp'
              if (backtrace_from_fp(__builtin_frame_address(0), &frame, 1))
                  ^
      1 error generated.
      

      SDK 10.13 need for static build with target 10.13.

      Application not linked with static builded Qt from SDK 10.14 - error linking function not existed on the platform 10.13. Shared Qt worked with week linked function!  

      Problem in the QMacAutoReleasePool::QMacAutoReleasePool()
      : pool([[NSAutoreleasePool alloc] init]) with backtrace_from_fp - not exists in the SDK 10.13

      QMacAutoReleasePool::QMacAutoReleasePool()
          : pool([[NSAutoreleasePool alloc] init])
      {
          Class trackerClass = [QMacAutoReleasePoolTracker class];
      
      #ifdef QT_DEBUG    
          void *poolFrame = nullptr;
          if (__builtin_available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 5.0, *)) {
              void *frame;
              if (backtrace_from_fp(__builtin_frame_address(0), &frame, 1))
                  poolFrame = frame;
          } else {
              static const int maxFrames = 3;
              void *callstack[maxFrames];
              if (backtrace(callstack, maxFrames) == maxFrames)
                  poolFrame = callstack[maxFrames - 1];
          }
      

      Workaround in the attached patch file - made by pattern in this file below in the function bool qt_mac_applicationIsInDarkMode() - add preprocessor quard for exclude code for new platform 

      QMacAutoReleasePool::QMacAutoReleasePool()
          : pool([[NSAutoreleasePool alloc] init])
      {
          Class trackerClass = [QMacAutoReleasePoolTracker class];
      
      #ifdef QT_DEBUG
          void *poolFrame = nullptr;
      #if QT_DARWIN_PLATFORM_SDK_EQUAL_OR_ABOVE(__MAC_10_14, __IPHONE_12_0, __TVOS_12_0, __WATCHOS_5_0)
          if (__builtin_available(macOS 10.14, iOS 12.0, tvOS 12.0, watchOS 5.0, *)) {
              void *frame;
              if (backtrace_from_fp(__builtin_frame_address(0), &frame, 1))
                  poolFrame = frame;
          } else {
              static const int maxFrames = 3;
              void *callstack[maxFrames];
              if (backtrace(callstack, maxFrames) == maxFrames)
                  poolFrame = callstack[maxFrames - 1];
          }
      #else
          static const int maxFrames = 3;
          void *callstack[maxFrames];
          if (backtrace(callstack, maxFrames) == maxFrames)
              poolFrame = callstack[maxFrames - 1];
      #endif
      
      

      Attachments

        Issue Links

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

          Activity

            People

              vestbo Tor Arne Vestbø
              sv99 Viacheslav Volkov
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes