From 70a8caaf69224ffd55391d72f6f5693a15e4f8b7 Mon Sep 17 00:00:00 2001 From: Allan Sandfeld Jensen Date: Tue, 14 Mar 2017 11:21:43 +0100 Subject: Port ARM configuration to GN MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Detect ARM configuration and pass it to GN. Change-Id: I809db0e096dc8c8785b37990769d4a981b147624 Reviewed-by: Michael BrĂ¼ning --- src/core/config/linux.pri | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) (limited to 'src/core') diff --git a/src/core/config/linux.pri b/src/core/config/linux.pri index 232cf2ddd..e5d48539d 100644 --- a/src/core/config/linux.pri +++ b/src/core/config/linux.pri @@ -40,6 +40,43 @@ use?(gn) { !isEmpty(TOOLCHAIN_SYSROOT): gn_args += target_sysroot=\"$${TOOLCHAIN_SYSROOT}\" } + contains(QT_ARCH, "arm") { + # Extract ARM specific compiler options that we have to pass to gn, + # but let gn figure out a default if an option is not present. + MTUNE = $$extractCFlag("-mtune=.*") + !isEmpty(MTUNE): gn_args += arm_tune=\"$$MTUNE\" + + MFLOAT = $$extractCFlag("-mfloat-abi=.*") + !isEmpty(MFLOAT): gn_args += arm_float_abi=\"$$MFLOAT\" + + MARCH = $$extractCFlag("-march=.*") + + MARMV = $$replace(MARCH, "armv",) + !isEmpty(MARMV) { + MARMV = $$split(MARMV,) + MARMV = $$member(MARMV, 0) + lessThan(MARMV, 6): error("$$MARCH architecture is not supported") + gn_args += arm_version=$$MARMV + } + + !lessThan(MARMV, 8) { + gn_args += arm_use_neon=true + } else { + MFPU = $$extractCFlag("-mfpu=.*") + !isEmpty(MFPU):contains(MFPU, ".*neon.*") { + gn_args += arm_use_neon=true + } else { + gn_args += arm_use_neon=false + # If the toolchain does not explicitly specify to use NEON instructions + # we use arm_neon_optional for ARMv7 + equals(MARMV, 7): gn_args += arm_optionally_use_neon=true + } + } + + if(isEmpty(MARMV)|lessThan(MARMV, 7)):contains(QMAKE_CFLAGS, "-marm"): gn_args += arm_use_thumb=false + else: contains(QMAKE_CFLAGS, "-mthumb"): gn_args += arm_use_thumb=true + } + host_build { gn_args += custom_toolchain=\"$$QTWEBENGINE_OUT_ROOT/src/toolchain:host\" # Don't bother trying to use system libraries in this case -- cgit v1.2.3