From c919fc5f65c1c509370df7e616263ed007931a7a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Mon, 21 Sep 2020 15:16:21 +0200 Subject: Pass -arch when running toolchain configure test on Apple platforms MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Clang doesn't automatically switch architecture just because we're passing an iPhoneOS sysroot. In the past this resulted in a warning about trying to link an x86_64 binary to arm64 libraries, but with Xcode 12 this is now a hard error. Fixes: QTBUG-86718 Change-Id: I7e9d2ca513d276029fc2a6cfe694a35fe41c39b3 Reviewed-by: Tor Arne Vestbø (cherry picked from commit ac43986aa5d07685cc61a5dbc00d76abf0cd1017) Reviewed-by: Qt Cherry-pick Bot (cherry picked from commit 168438dc3144091fc7df7aa1d4b2f1d8f7a6b51c) Reviewed-by: Jani Heikkinen --- mkspecs/features/toolchain.prf | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/mkspecs/features/toolchain.prf b/mkspecs/features/toolchain.prf index 03612e5689..5003679bd0 100644 --- a/mkspecs/features/toolchain.prf +++ b/mkspecs/features/toolchain.prf @@ -182,6 +182,10 @@ isEmpty($${target_prefix}.INCDIRS) { # UIKit simulator platforms will see the device SDK's sysroot in # QMAKE_DEFAULT_*DIRS, because they're handled in a single build pass. darwin { + # Clang doesn't pick up the architecture from the sysroot, and will + # default to the host architecture, so we need to manually set it. + cxx_flags += -arch $$QMAKE_APPLE_DEVICE_ARCHS + uikit:macx-xcode: \ cxx_flags += -isysroot $$sdk_path_device.value else: \ -- cgit v1.2.3