为 macOS arm64

问题描述

我正在尝试为 arm64 架构本地编译 Qt 5.15.2(开源)。 我正在使用 MacMini(英特尔)和 MacOS BigSur 11.2.3,Xcode 12.4 构建版本 12D4e, macOS 11.1 SDK。

使用他们的在线安装程序下载 qt 源

这样配置:

% ./configure $CONfigURE_OPTIONS -device-option QMAKE_APPLE_DEVICE_ARCHS=arm64 -prefix ~/Qt/5.15.2/clang_64_arm -nomake examples -nomake tests -skip qt3d

“make”命令,在成功构建各种库(qtbase 和许多其他库)后,在编译 qtwebenginecore 时失败,说“ld: symbol(s) not found for architecture x86_64”;它似乎是为 x86_64 构建的,但链接到 arm64 库。

这里是 make 输出的片段,请参阅警告“忽略文件 /Users/user3/Qt/5.15.2/Src/qtdeclarative/lib/QtQuick.framework/QtQuick,为 macOS-x86_64 构建但试图链接为 macOS-arm64 构建的文件

( test -e Makefile.core_module || /Users/user3/Qt/5.15.2/Src/qtbase/bin/qmake -o Makefile.core_module /Users/user3/Qt/5.15.2/Src/qtwebengine/src/core/core_module.pro ) && /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.core_module /Applications/Xcode.app/Contents/Developer/usr/bin/make -f Makefile.core_module.Debug all rm -f QtWebEngineCore_debug QtWebEngineCore.framework/QtWebEngineCore_debug ../../lib/QtWebEngineCore.framework/QtWebEngineCore_debug /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang++ -stdlib=libc++ -Wl,-filelist,/Users/user3/Qt/5.15.2/Src/qtwebengine/src/core/debug/QtWebEngineCore_o.rsp @/Users/user3/Qt/5.15.2/Src/qtwebengine/src/core/debug/QtWebEngineCore_a.rsp -Wl,-fatal_warnings -stdlib=libc++ -arch x86_64 -isysroot ../../../../../../../../../Applications/Xcode.app/Contents/Developer /Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -Wl,-ObjC -stdlib=libc++ -headerpad_max_install_names -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -weak_framework MediaPlayer -headerpad_max_install_names -fapplication-extension -arch arm64 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk -mmacosx-version-min=10.13 -Wl,-rpath,@executable_path/../Frameworks -Wl,@loader_path/Frameworks -Wl,@loader_path/../../../ - single_module -dynamiclib -compatibility_version 5.15 -current_version 5.15.2 -install_name @rpath/QtWebEngineCore.framework/Versions/5/QtWebEngineCore_debug -o QtWebEngineCore_debug -F/Users/user3/Qt/5.15.2/Src/qtdeclarative/lib -F/Users/user3/Qt/5.15.2/Src/qtbase/lib -F/Users/user3/Qt/5.15. 2/Src/qtwebchannel/lib -F/Users/user3/Qt/5.15.2/Src/qtlocation/lib -F/Users/user3/Qt/5.15.2/Src/qtwebengine/lib -framework QtQuick -F/Users /user3/Qt/5.15.2/Src/qtbase/lib -F/Users/user3/Qt/5.15.2/Src/qtdeclarative/lib -framework QtGui -framework AppKit -framework Metal -framework QtQmlModels -framework QtQml -framework QtNetwork -framework QtCore -framework diskarbitration -framework IOKit -framework QtGui -F/Users/user3/Qt/5.15.2/Src/qtbase/lib -framework AppKit -framework Metal -framework QtCore -framework diskarbitration -framework IOKit -framework QtQmlModels -F/Users/user3/Qt/5.15.2/Src/qtdeclarative/lib -F/Users/user3/Qt/5.15.2/Src/qtbase/lib -framework QtQml -framework QtNetwork -framework QtCore -framework磁盘仲裁框架 IOKit 框架 QtWebChannel -F/Users/user3/Qt/5.15.2/Src/qtdeclarative/lib -F/Users/user3/Qt/5.15.2/Src/qtbase/lib -framework QtQml -framework QtNetwork -framework QtCore -framework diskarbitration -framework IOKit -framework QtQml -F/Users/user3/Qt/5.15.2/Src/qtbase/lib -framework QtNetwork -framework QtCore -framework diskarbitration -framework IOKit -framework QtNetwork -F/Users/user3/Qt/5.15.2/Src/qtbase/lib -framework QtCore -framework diskarbitration -framework IOKit -framework QtPositioning -F/Users/user3/Qt/5.15.2/Src/qtbase/lib -framework QtCore -framework diskarbitration -framework IOKit -framework QtCore -framework 磁盘仲裁 - 框架 IOKit -L/Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX11.1.sdk/usr/lib -framework applicationservices -framework AppKit -lbsm -framework CoreFoundation -framework IOKit -framework OpenDirectory -lpmenergy -lpmsample -framework 安全 -framework CFNetwork -framework CoreServices -framework Foundation -framework SystemConfiguration -lresolv -framework IOSurface -framework AVFoundation -framework CoreMedia -framework CoreGraphics -framework CoreText -framework Metal -framework Cocoa -framework QuartzCore -framework OpenGL -framework Quartz -framework Accelerate -framework AudioUnit -framework Carbon -framework CoreVideo -framework AudioToolBox -framework CoreAudio -framework VideoToolBox -lsandBox -framework LocalAuthentication -framework IOBluetooth -framework CoreMIDI -framework MediaAccessibility -framework diskarbitration -framework ForceFeedback -framework GameController -framework CoreWLAN -L/Users/user3/Qt/5.15.2/Src/qtwebengine/src/core/api/debug -Wl,-force_load,/Users/user3/Qt/5.15.2/Src/qtwebengine /src/core/api/debug/libqtwebenginecoreapi_debug.a -framework OpenGL -framework AGL ld: 警告:忽略文件 /Users/user3/Qt/5.15.2/Src/qtbase/lib/QtGui.framework/QtGui,building 适用于 macOS-x86_64 但尝试链接为 macOS-arm64 ld:警告:忽略文件 /Users/user3/Qt/5.15.2/Src/qtdeclarative/lib/QtQuick.framework/QtQuick, 为 macOS-x86_64 构建,但尝试链接为 macOS-x86_64 构建的文件 macOS-arm64 ld:警告:忽略文件 /Users/user3/Qt/5.15.2/Src/qtdeclarative/lib/QtQmlModels.framework/QtQmlModels,为 macOS-x86_64 构建,但尝试链接为 macOS-x86_64 构建的文件 macOS-arm64 ld:警告:忽略文件 /Users/user3/Qt/5.15.2/Src/qtdeclarative/lib/QtQml.framework/QtQml,为 macOS-x86_64 构建,但尝试链接为 macOS-x86_64 构建的文件 macOS-arm64 ld:警告:忽略文件 /Users/user3/Qt/5.15.2/Src/qtbase/lib/QtCore.framework/QtCore, 为 macOS-x86_64 构建,但尝试链接为 macOS-x86_64 构建的文件 macOS-arm64 ld:警告:忽略文件 /Users/user3/Qt/5.15.2/Src/qtbase/lib/QtNetwork.framework/QtNetwork, 为 macOS-x86_64 构建,但尝试链接为 macOS-x86_64 构建的文件 macOS-arm64 ld:警告:忽略文件 /Users/user3/Qt/5.15.2/Src/qtwebchannel/lib/QtWebChannel.framework/QtWebChannel,为 macOS-x86_64 构建,但尝试链接为 macOS-x86_64 构建的文件 macOS-arm64 ld:警告:忽略文件 /Users/user3/Qt/5.15.2/Src/qtlocation/lib/QtPositioning.framework/QtPositioning, 为 macOS-x86_64 构建,但尝试链接为 macOS-x86_64 构建的文件 macOS-arm64 ld:警告:忽略文件 /Users/user3/Qt/5.15.2/Src/qtwebengine/src/core/api/debug/libqtwebenginecoreapi_debug.a,为 macOS-x86_64 构建但试图链接为构建的文件 macOS-arm64 架构 x86_64 的未定义符号:
"qt_assert_x(char const
,char const
,char const*,int)",引用 从:** int qRegisternormalizedMetaTypeQClipboard::Mode(QByteArray const&,QClipboard::Mode*,QtPrivate::MetaTypeDefinedHelper<:mode>::DefinedType) 中 clipboard_qt.o qmutexLocker::qmutexLocker(QBasicMutex*) 在 display_frame_sink.o QtWebEngineCore::imageFormat(SkColorType) in display_software_output_surface.o qmutexLocker::qmutexLocker(QBasicMutex*) in display_software_output_surface.o QList::at(int) const in content_client_qt.o QtWebEngineCore::QtShareGLContext::Initialize(gl::GLSurface*,gl::GLContextAttribs const&) in content_browser_client_qt.o QtWebEngineCore::QtShareGLContext::MakeCurrent(gl::GLSurface*) in content_browser_client_qt.o ... "qFlagLocation(char const*)",引用自: QtWebEngineCore::ClipboardChangeObserver::ClipboardChangeObserver() 在 clipboard_qt.o

然后是大量的“引用形式:”函数,最后是链接错误

"operator const&) in web_channel_ipc_transport_host.o "operator>(QDataStream&,QByteArray&)",引用自: QtWebEngineCore::deserializeNavigationHistory(QDataStream&,int*,std::__1::vector<:__1::unique_ptr std::__1::default_deletecontent::navigationentry>,std::__1::allocator<:__1::unique_ptr std::__1::default_deletecontent::navigationentry> > >, content::browserContext) 在 web_contents_adapter.o
"operator>>(QDataStream&,QUrl&)",引用自: QtWebEngineCore::deserializeNavigationHistory(QDataStream&,QString&)",引用自: QtWebEngineCore::deserializeNavigationHistory(QDataStream&,std::__1::allocator<:__1::unique_ptr std::__1::default_deletecontent::navigationentry> > >, content::browserContext) 在 web_contents_adapter.o ld:找不到架构 x86_64 clang 的符号:错误链接器命令失败 退出代码 1(使用 -v 查看调用) make[5]: *** [../../lib/QtWebEngineCore.framework/QtWebEngineCore_debug] 错误 1 make[4]: *** [debug-all] 错误 2 make[3]: *** [sub-core_module-pro-make_first] 错误 2 make[2]: *** [sub-core-make_first] 错误 2 make[1]: *** [sub-src-make_first] 错误 2 make: *** [module-qtwebengine-make_first] 错误 2

我不明白为什么它是为 x86_64 构建的

预先感谢您的帮助

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)