Unsolved Error building Webengine 5.15 with Qt5.15.2 on mac M1
-
I'm trying to build Webengine 5.15 branch with Qt5.15.2.
I'm on macOS Monterey 12.2.1, Apple M1 Pro Chip
Here's 2 commands I tried to use.../qt5/configure -release -prefix ./qtbase -nomake examples -nomake tests QMAKE_APPLE_DEVICE_ARCHS=arm64 -opensource -confirm-license -skip qt3d
katkit@KatKit ~ % /usr/local/mac-bigsur/qt-5.15.2/dev/mac/bin/qmake /Users/katkit/WorkDir/Qt/qt5.15.2/src/qt/qtwebengine -- -no-webengine-geolocation -enable-webengine-proprietary-codecs
but I kept getting the below error. Any Idea what is causing it?
with -skip webengine it builds fine.ld: warning: ignoring file /Users/katkit/src/core/api/debug/libqtwebenginecoreapi_debug.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64 Undefined symbols for architecture arm64: "QWebEngineUrlScheme::lockSchemes()", referenced from: QtWebEngineCore::WebEngineContext::WebEngineContext() in web_engine_context.o "QWebEngineUrlScheme::schemeByName(QByteArray const&)", referenced from: QtWebEngineCore::(anonymous namespace)::CustomURLLoader::CustomURLLoader(network::ResourceRequest const&, mojo::InterfaceRequest<network::mojom::URLLoader>, mojo::InterfacePtrInfo<network::mojom::URLLoaderClient>, QPointer<QtWebEngineCore::ProfileAdapter>) in custom_url_loader_factory.o QtWebEngineCore::schemeType(QByteArray const&) in profile_adapter.o QtWebEngineCore::WebEngineContext::WebEngineContext() in web_engine_context.o "QWebEngineUrlScheme::registerScheme(QWebEngineUrlScheme const&)", referenced from: QtWebEngineCore::WebEngineContext::WebEngineContext() in web_engine_context.o "QWebEngineUrlScheme::setFlags(QFlags<QWebEngineUrlScheme::Flag>)", referenced from: QtWebEngineCore::WebEngineContext::WebEngineContext() in web_engine_context.o "QWebEngineUrlScheme::QWebEngineUrlScheme(QByteArray const&)", referenced from: QtWebEngineCore::WebEngineContext::WebEngineContext() in web_engine_context.o "QWebEngineUrlScheme::QWebEngineUrlScheme()", referenced from: QtWebEngineCore::schemeType(QByteArray const&) in profile_adapter.o QtWebEngineCore::WebEngineContext::WebEngineContext() in web_engine_context.o "QWebEngineUrlScheme::~QWebEngineUrlScheme()", referenced from: QtWebEngineCore::(anonymous namespace)::CustomURLLoader::CustomURLLoader(network::ResourceRequest const&, mojo::InterfaceRequest<network::mojom::URLLoader>, mojo::InterfacePtrInfo<network::mojom::URLLoaderClient>, QPointer<QtWebEngineCore::ProfileAdapter>) in custom_url_loader_factory.o QtWebEngineCore::schemeType(QByteArray const&) in profile_adapter.o QtWebEngineCore::WebEngineContext::WebEngineContext() in web_engine_context.o "QWebEngineCookieStore::QWebEngineCookieStore(QObject*)", referenced from: QtWebEngineCore::ProfileAdapter::cookieStore() in profile_adapter.o "QWebEngineHttpRequest::QWebEngineHttpRequest(QUrl const&, QWebEngineHttpRequest::Method const&)", referenced from: QtWebEngineCore::WebContentsAdapter::load(QUrl const&) in web_contents_adapter.o "QWebEngineHttpRequest::~QWebEngineHttpRequest()", referenced from: QtWebEngineCore::WebContentsAdapter::load(QUrl const&) in web_contents_adapter.o "QWebEngineQuotaRequest::QWebEngineQuotaRequest(QSharedPointer<QtWebEngineCore::QuotaRequestController>)", referenced from: QtWebEngineCore::QuotaPermissionContextQt::RequestQuotaPermission(content::StorageQuotaParams const&, int, base::OnceCallback<void (content::QuotaPermissionContext::QuotaPermissionResponse)>) in quota_permission_context_qt.o "QWebEngineUrlRequestJob::fail(QWebEngineUrlRequestJob::Error)", referenced from: QtWebEngineCore::QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob*) in qrc_url_scheme_handler.o "QWebEngineUrlRequestJob::reply(QByteArray const&, QIODevice*)", referenced from: QtWebEngineCore::QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob*) in qrc_url_scheme_handler.o "QWebEngineUrlRequestJob::QWebEngineUrlRequestJob(QtWebEngineCore::URLRequestCustomJobDelegate*)", referenced from: QtWebEngineCore::URLRequestCustomJobProxy::initialize(GURL, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, base::Optional<url::Origin>, std::__1::map<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, std::__1::less<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > >, std::__1::allocator<std::__1::pair<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > >) in url_request_custom_job_proxy.o "QWebEngineFindTextResult::QWebEngineFindTextResult(int, int)", referenced from: QtWebEngineCore::FindTextHelper::handleFindReply(content::WebContents*, int, int, gfx::Rect const&, int, bool) in find_text_helper.o "QWebEngineFindTextResult::QWebEngineFindTextResult()", referenced from: QtWebEngineCore::FindTextHelper::startFinding(QString const&, bool, bool, QWebEngineCallback<bool>) in find_text_helper.o QtWebEngineCore::FindTextHelper::startFinding(QString const&, bool, bool) in find_text_helper.o QtWebEngineCore::FindTextHelper::startFinding(QString const&, bool, bool, QJSValue const&) in find_text_helper.o "QWebEngineFindTextResult::~QWebEngineFindTextResult()", referenced from: QtWebEngineCore::FindTextHelper::startFinding(QString const&, bool, bool, QWebEngineCallback<bool>) in find_text_helper.o QtWebEngineCore::FindTextHelper::startFinding(QString const&, bool, bool) in find_text_helper.o QtWebEngineCore::FindTextHelper::startFinding(QString const&, bool, bool, QJSValue const&) in find_text_helper.o QtWebEngineCore::FindTextHelper::handleFindReply(content::WebContents*, int, int, gfx::Rect const&, int, bool) in find_text_helper.o "QWebEngineUrlRequestInfo::QWebEngineUrlRequestInfo(QWebEngineUrlRequestInfoPrivate*)", referenced from: QtWebEngineCore::InterceptedRequest::Restart() in proxying_url_loader_factory_qt.o "QWebEngineUrlRequestInfo::~QWebEngineUrlRequestInfo()", referenced from: QtWebEngineCore::InterceptedRequest::cleanup(QWebEngineUrlRequestInfo*) in proxying_url_loader_factory_qt.o "QWebEngineUrlSchemeHandler::qt_metacall(QMetaObject::Call, int, void**)", referenced from: vtable for QtWebEngineCore::QrcUrlSchemeHandler in qrc_url_scheme_handler.o "QWebEngineUrlSchemeHandler::qt_metacast(char const*)", referenced from: vtable for QtWebEngineCore::QrcUrlSchemeHandler in qrc_url_scheme_handler.o "QWebEngineUrlSchemeHandler::QWebEngineUrlSchemeHandler(QObject*)", referenced from: QtWebEngineCore::QrcUrlSchemeHandler::QrcUrlSchemeHandler() in profile_adapter.o "QWebEngineUrlSchemeHandler::~QWebEngineUrlSchemeHandler()", referenced from: QtWebEngineCore::QrcUrlSchemeHandler::~QrcUrlSchemeHandler() in qrc_url_scheme_handler.o QtWebEngineCore::QrcUrlSchemeHandler::~QrcUrlSchemeHandler() in profile_adapter.o "QWebEngineCookieStorePrivate::onCookieChanged(QNetworkCookie const&, bool)", referenced from: QtWebEngineCore::CookieMonsterDelegateQt::OnCookieChanged(net::CookieChangeInfo const&) in cookie_monster_delegate_qt.o "QWebEngineCookieStorePrivate::onSetCallbackResult(long long, bool)", referenced from: QtWebEngineCore::CookieMonsterDelegateQt::SetCookieCallbackOnUIThread(long long, net::CookieAccessResult) in cookie_monster_delegate_qt.o "QWebEngineCookieStorePrivate::onDeleteCallbackResult(long long, int)", referenced from: QtWebEngineCore::CookieMonsterDelegateQt::DeleteCookiesCallbackOnUIThread(long long, unsigned int) in cookie_monster_delegate_qt.o "QWebEngineCookieStorePrivate::onGetAllCallbackResult(long long, QByteArray const&)", referenced from: QtWebEngineCore::CookieMonsterDelegateQt::GetAllCookiesCallbackOnUIThread(long long, std::__1::vector<net::CanonicalCookie, std::__1::allocator<net::CanonicalCookie> > const&) in cookie_monster_delegate_qt.o "QWebEngineCookieStorePrivate::processPendingUserCookies()", referenced from: QtWebEngineCore::CookieMonsterDelegateQt::setMojoCookieManager(mojo::InterfacePtrInfo<network::mojom::CookieManager>) in cookie_monster_delegate_qt.o QtWebEngineCore::CookieMonsterDelegateQt::setClient(QWebEngineCookieStore*) in cookie_monster_delegate_qt.o "QWebEngineMessagePumpScheduler::scheduleWork()", referenced from: QtWebEngineCore::MessagePumpForUIQt::ScheduleWork() in browser_main_parts_qt.o "QWebEngineMessagePumpScheduler::scheduleDelayedWork(int)", referenced from: QtWebEngineCore::MessagePumpForUIQt::ScheduleDelayedWork(base::TimeTicks const&) in browser_main_parts_qt.o "QWebEngineMessagePumpScheduler::QWebEngineMessagePumpScheduler(std::__1::function<void ()>)", referenced from: QtWebEngineCore::MessagePumpForUIQt::MessagePumpForUIQt() in browser_main_parts_qt.o "QWebEngineUrlRequestInfoPrivate::QWebEngineUrlRequestInfoPrivate(QWebEngineUrlRequestInfo::ResourceType, QWebEngineUrlRequestInfo::NavigationType, QUrl const&, QUrl const&, QUrl const&, QByteArray const&)", referenced from: QtWebEngineCore::InterceptedRequest::Restart() in proxying_url_loader_factory_qt.o "QWebEngineClientCertificateStore::QWebEngineClientCertificateStore(QtWebEngineCore::ClientCertificateStoreData*)", referenced from: QtWebEngineCore::ProfileAdapter::clientCertificateStore() in profile_adapter.o "QWebEngineClientCertificateStore::~QWebEngineClientCertificateStore()", referenced from: QtWebEngineCore::ProfileAdapter::~ProfileAdapter() in profile_adapter.o "QWebEngineRegisterProtocolHandlerRequest::QWebEngineRegisterProtocolHandlerRequest(QSharedPointer<QtWebEngineCore::RegisterProtocolHandlerRequestController>)", referenced from: QtWebEngineCore::WebContentsDelegateQt::RegisterProtocolHandler(content::RenderFrameHost*, std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > const&, GURL const&, bool) in web_contents_delegate_qt.o "QWebEngineUrlScheme::flags() const", referenced from: QtWebEngineCore::(anonymous namespace)::CustomURLLoader::CustomURLLoader(network::ResourceRequest const&, mojo::InterfaceRequest<network::mojom::URLLoader>, mojo::InterfacePtrInfo<network::mojom::URLLoaderClient>, QPointer<QtWebEngineCore::ProfileAdapter>) in custom_url_loader_factory.o "QWebEngineUrlScheme::operator==(QWebEngineUrlScheme const&) const", referenced from: QWebEngineUrlScheme::operator!=(QWebEngineUrlScheme const&) const in profile_adapter.o QtWebEngineCore::WebEngineContext::WebEngineContext() in web_engine_context.o "QWebEngineHttpRequest::url() const", referenced from: QtWebEngineCore::WebContentsAdapter::load(QWebEngineHttpRequest const&) in web_contents_adapter.o "QWebEngineHttpRequest::header(QByteArray const&) const", referenced from: QtWebEngineCore::WebContentsAdapter::load(QWebEngineHttpRequest const&) in web_contents_adapter.o "QWebEngineHttpRequest::method() const", referenced from: QtWebEngineCore::WebContentsAdapter::load(QWebEngineHttpRequest const&) in web_contents_adapter.o "QWebEngineHttpRequest::headers() const", referenced from: QtWebEngineCore::WebContentsAdapter::load(QWebEngineHttpRequest const&) in web_contents_adapter.o "QWebEngineHttpRequest::postData() const", referenced from: QtWebEngineCore::WebContentsAdapter::load(QWebEngineHttpRequest const&) in web_contents_adapter.o "QWebEngineUrlRequestJob::requestUrl() const", referenced from: QtWebEngineCore::QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob*) in qrc_url_scheme_handler.o "QWebEngineUrlRequestJob::requestMethod() const", referenced from: QtWebEngineCore::QrcUrlSchemeHandler::requestStarted(QWebEngineUrlRequestJob*) in qrc_url_scheme_handler.o "QWebEngineUrlRequestInfo::changed() const", referenced from: QtWebEngineCore::InterceptedRequest::Restart() in proxying_url_loader_factory_qt.o QtWebEngineCore::InterceptedRequest::InterceptOnUIThread(QWebEngineUrlRequestInterceptor*) in proxying_url_loader_factory_qt.o "QWebEngineUrlSchemeHandler::metaObject() const", referenced from: vtable for QtWebEngineCore::QrcUrlSchemeHandler in qrc_url_scheme_handler.o "QWebEngineCookieStorePrivate::canAccessCookies(QUrl const&, QUrl const&) const", referenced from: QtWebEngineCore::ContentBrowserClientQt::AllowAppCache(GURL const&, GURL const&, base::Optional<url::Origin> const&, content::BrowserContext*) in content_browser_client_qt.o QtWebEngineCore::ContentBrowserClientQt::AllowServiceWorkerOnUI(GURL const&, GURL const&, base::Optional<url::Origin> const&, GURL const&, content::BrowserContext*) in content_browser_client_qt.o QtWebEngineCore::ContentBrowserClientQt::AllowWorkerFileSystem(GURL const&, content::BrowserContext*, std::__1::vector<content::GlobalFrameRoutingId, std::__1::allocator<content::GlobalFrameRoutingId> > const&, base::OnceCallback<void (bool)>) in content_browser_client_qt.o QtWebEngineCore::ContentBrowserClientQt::AllowWorkerIndexedDB(GURL const&, content::BrowserContext*, std::__1::vector<content::GlobalFrameRoutingId, std::__1::allocator<content::GlobalFrameRoutingId> > const&) in content_browser_client_qt.o QtWebEngineCore::CookieMonsterDelegateQt::canSetCookie(QUrl const&, QByteArray const&, QUrl const&) const in cookie_monster_delegate_qt.o QtWebEngineCore::CookieMonsterDelegateQt::canGetCookies(QUrl const&, QUrl const&) const in cookie_monster_delegate_qt.o "vtable for QWebEngineMessagePumpScheduler", referenced from: QWebEngineMessagePumpScheduler::~QWebEngineMessagePumpScheduler() in browser_main_parts_qt.o NOTE: a missing vtable usually means the first non-inline virtual member function has no definition. ld: symbol(s) not found for architecture arm64 clang: error: linker command failed with exit code 1 (use -v to see invocation) make[4]: *** [../../lib/libQt5WebEngineCore_debug.5.15.11.dylib] Error 1 make[3]: *** [debug-all] Error 2 make[2]: *** [sub-core_module-pro-make_first] Error 2 make[1]: *** [sub-core-make_first] Error 2 make: *** [sub-src-make_first] Error 2
-
I think if you add the following to the end of your configure statement, -- -DCMAKE_OSX_ARCHITECTURES="x86_64;arm64" you should be able to build.
-
Nope, it doesn't work. That statement is meant for cmake only no?
Here's the error anyways.Running configuration tests... Checking for valid makespec... ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
-
@katkit said in Error building Webengine 5.15 with Qt5.15.2 on mac M1:
Checking for valid makespec... ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
I double checked and I was compiling Qt 6.3.2. I'm sorry about that. You'll want to remove the arm64 and append a different targeted sdk, For example,
../qt/configure -prefix ../qt6-install -webengine-webrtc -no-warnings-are-errors -framework -- -DCMAKE_OSX_ARCHITECTURES="x86_64"
-DCMAKE_OSX_SDK=macosx10.14I would target the SDK listed in the Qt 5.15.2 documentation if you can find that. This is only a hunch, so I hope it works for you.
-
@steno said in Error building Webengine 5.15 with Qt5.15.2 on mac M1:
../qt/configure -prefix ../qt6-install -webengine-webrtc -no-warnings-are-errors -framework -- -DCMAKE_OSX_ARCHITECTURES="x86_64"
-DCMAKE_OSX_SDK=macosx10.14Hmm, it still produce the same error.
Anyways, I just noticed this. Does this mean webengine is building in macOS-arm64 while the other file is in macOS-X86_64?
ld: warning: ignoring file /Users/katkit/src/core/api/debug/libqtwebenginecoreapi_debug.a, building for macOS-arm64 but attempting to link with file built for macOS-x86_64
-
Yes, you are trying to link libraries built from different architectures. Those OSX flags were my attempt to see if they would stop building ARM. But it seems that they are still trying to build ARM and link to x86_64.