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

Modules added with qt6_add_qml_module have link errors when using universal macos packages

    XMLWordPrintable

Details

    • macOS

    Description

      我们用qt6_add_qml_module添加的模块在打双架构mac包时会出现链接错误,qt_add_qml_module 产生的模块,在上层target link这个module的时候,会往依赖target的other link 中添加对应的 .o 文件,这些理论上应该是不需要的,另外是生成这些.o的完整路径用到了 ARCH_STANDARD 属性,这个属性在双架构下带空格,会导致路径异常,cmake工程add target前设置 set(CMAKE_OSX_ARCHITECTURES "\$(ARCHS_STANDARD)") ,之后generator选xcode,可以产生构建双架构产物的xcode 工程,另外开asan的话,这些.o的路径也是不对的,这个地方是不是可以排查下,这些.o没必要暴露到上层二进制的链接,是不是add module里面这个link参数不小心给public到外部了

       

      English:I am a pre-sales engineer of Qt China, this is the feedback from the engineer of our customer Bytedance company. When the module added by the customer with qt_add_qml_module will have a link error when using the dual-architecture mac package, the module generated by qt_add_qml_module will add the corresponding .o file to the other link that depends on the target when the module generated by qt_add_qml_module is in the upper-level target link. The above should not be needed. In addition, the ARCH_STANDARD attribute is used to generate the full path of these .o. This attribute has spaces under the dual architecture, which will cause the path to be abnormal. Set the set(CMAKE_OSX_ARCHITECTURES "\$(ARCHS_STANDARD) before the cmake project add target) "), then the generator selects xcode, which can generate xcode projects to build dual-architecture products. In addition, if asan is opened, these .o paths are also wrong. The customer here recommends Qt to check, these .o files do not need to be exposed to the upper binary. The link, is the link parameter in the add module accidentally public to the outside?

       

      Attachments

        1. bug.jpg
          bug.jpg
          384 kB
        2. qt_bug.tar.gz
          202 kB
        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            qtbuildsystem Qt Build System Team
            paul_chen Paul Chen
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes