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

Qt fails to build on Lion when specifying another target SDKs using XCode 4.3

    XMLWordPrintable

Details

    • Bug
    • Resolution: Out of scope
    • Not Evaluated
    • None
    • 4.8.0, 4.8.4
    • Build System
    • None
    • Mac OS 10.7+, XCode 4.3+

    Description

      when compiling against the 10.6sdk in Lion (now located by default in /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.6.sdk) QtWebKit compilation fails with

      Undefined symbols for architecture i386:
        "__CFWebServicesCopyProviderInfo", referenced from:
            _WKCopyDefaultSearchProviderDisplayName in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "__NSRecommendedScrollerStyle", referenced from:
            _WKRecommendedScrollerStyle in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_strndup", referenced from:
            _WKSandboxExtensionCreateFromSerializedFormat in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_sandbox_release_fs_extension", referenced from:
            _WKSandboxExtensionInvalidate in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_sandbox_consume_fs_extension", referenced from:
            _WKSandboxExtensionConsume in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_sandbox_issue_fs_extension", referenced from:
            _WKSandboxExtensionCreate in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_CFURLRequestSetRequestPriority", referenced from:
            _WKSetHTTPPipeliningPriority in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_CFURLRequestGetRequestPriority", referenced from:
            _WKGetHTTPPipeliningPriority in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_CTTypesetterCreateWithUniCharProviderAndOptions", referenced from:
            _WKCreateCTTypesetterWithUniCharProviderAndOptions in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_CGIOSurfaceContextCreateImage", referenced from:
            _WKIOSurfaceContextCreateImage in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_CGIOSurfaceContextCreate", referenced from:
            _WKIOSurfaceContextCreate in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_SecTrustGetTrustResult", referenced from:
            _WKCopyNSURLResponseCertificateChain in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_kCFWebServicesProviderDefaultDisplayNameKey", referenced from:
            _WKCopyDefaultSearchProviderDisplayName in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_kCFWebServicesTypeWebSearch", referenced from:
            _WKCopyDefaultSearchProviderDisplayName in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
        "_kMDItemDownloadedDate", referenced from:
            _WKSetMetadataURL in libWebKitSystemInterfaceLion.a(WebKitSystemInterface.o)
      ld: symbol(s) not found for architecture i386
      collect2: ld returned 1 exit status
      make[3]: *** [../../../../../../lib/libQtWebKit.4.9.0.dylib] Error 1
      make[2]: *** [release-install] Error 2
      make[1]: *** [sub-WebKit-qt-QtWebKit-pro-install_subtargets-ordered] Error 2
      

      Upon investigating, you find in src/3rdparty/webkit/WebKit.pro:

              # We can know the Mac OS version by using the Darwin major version
              DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
              DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
              equals(DARWIN_MAJOR_VERSION, "9") | contains(QMAKE_MAC_SDK, "/Developer/SDKs
      /MacOSX10.5.sdk") {
                  LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.
      a
              } else: equals(DARWIN_MAJOR_VERSION, "10") | contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.6.sdk") {
                  LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
              } else: equals(DARWIN_MAJOR_VERSION, "11") | contains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10.7.sdk") {
                  LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a
              }
      

      so for -sdk to work its argument must be equal to "/Developer/SDKs/MacOSX10.6.sdk". However, with XCode 4.3, this location do not exist anymore.

      Instead of testing for the full path
      this should be changed into:

              # We can know the Mac OS version by using the Darwin major version
              DARWIN_VERSION = $$split(QMAKE_HOST.version, ".")
              DARWIN_MAJOR_VERSION = $$first(DARWIN_VERSION)
              equals(DARWIN_MAJOR_VERSION, "9") | contains(QMAKE_MAC_SDK, ".*MacOSX10.5.sdk") {
                  LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLeopard.
      a
              } else: equals(DARWIN_MAJOR_VERSION, "10") | contains(QMAKE_MAC_SDK, ".*MacOSX10.6.sdk") {
                  LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceSnowLeopard.a
              } else: equals(DARWIN_MAJOR_VERSION, "11") | contains(QMAKE_MAC_SDK, ".*MacOSX10.7.sdk") {
                  LIBS += $$SOURCE_DIR/../WebKitLibraries/libWebKitSystemInterfaceLion.a
              }
      

      No need to test for the full path, only the actual name of the SDKs will do.

      The same issue occur in other .pro file:
      The same issue occurs in another .pro file.
      One example is src/plugins/bearer/corewlan/corewlan.pro, just as in

      ontains(QMAKE_MAC_SDK, "/Developer/SDKs/MacOSX10\.[67]\.sdk")
      

      needs to be replaced with:

      ontains(QMAKE_MAC_SDK, ".*MacOSX10\.[67]\.sdk")
      

      as the SDK can now be located in different location than /Developer/SDKs

      There may be others, for the time being, I simply run a script replacing them all

      Attachments

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

        Activity

          People

            vestbo Tor Arne Vestbø
            jyavenard Jean-Yves Avenard
            Votes:
            3 Vote for this issue
            Watchers:
            7 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes