From dedd2d35e3a11ef478ff2a557623d5b7804433d6 Mon Sep 17 00:00:00 2001 From: Umair Raihan Date: Mon, 11 Jul 2022 17:41:19 +0300 Subject: [PATCH] Add new mkspecs device for Raspberry Pi 4 (64-bit) The existing mkspecs for Raspberry Pi 4 (devices/linux-rasp-pi4-v3d-g++) was intended to compile Qt application for the 32-bit version of Raspberry Pi, thus it used compiler flags that are incompatible when compiling Qt application for the ARM 64-bit architecture. According to ARM compiler documentation, -mfpu flag is rejected by AArch64 state while its alternative, -mcpu, has to be avoided when -march flag is already defined. -mfloat-abi flag is not valid with AArch64 targets. To support both 64-bit and 32-bit architectures, I proposed to add this new mkspecs. See: https://developer.arm.com/documentation/101754/0618/armclang-Reference/armclang-Command-line-Options/-mfpu https://developer.arm.com/documentation/101754/0618/armclang-Reference/armclang-Command-line-Options/-mfloat-abi Change-Id: I36574875e798281688601edd0f166922592d9830 Reviewed-by: Tatiana Borisova Reviewed-by: Laszlo Agocs (cherry picked from commit 55dd9439961b21f9b4929a80dbccfffc647678b3) Reviewed-by: Qt Cherry-pick Bot --- .../devices/linux-rasp-pi4-aarch64/qmake.conf | 25 +++++++++++++++++++ .../linux-rasp-pi4-aarch64/qplatformdefs.h | 8 ++++++ 2 files changed, 33 insertions(+) create mode 100644 mkspecs/devices/linux-rasp-pi4-aarch64/qmake.conf create mode 100644 mkspecs/devices/linux-rasp-pi4-aarch64/qplatformdefs.h diff --git a/mkspecs/devices/linux-rasp-pi4-aarch64/qmake.conf b/mkspecs/devices/linux-rasp-pi4-aarch64/qmake.conf new file mode 100644 index 00000000000..9903775883c --- /dev/null +++ b/mkspecs/devices/linux-rasp-pi4-aarch64/qmake.conf @@ -0,0 +1,25 @@ +# +# Generic qmake configuration for building with g++ on Raspberry Pi 4 (64-bit). +# +# Tested with Raspberry Pi OS 64-bit and aarch64 gcc compiler from Debian package repository +# +# A minimal configure line could look something like this: +# ./configure -release -opengl es2 -device linux-rasp-pi4-aarch64 -device-option CROSS_COMPILE=aarch64-linux-gnu- -sysroot ~/rpi-sysroot -prefix /usr/local/qt6 -extprefix $HOME/qt-raspi + +DISTRO_OPTS += deb-multi-arch + +include(../common/linux_device_pre.conf) + +QMAKE_LIBS_EGL += -lEGL +QMAKE_LIBS_OPENGL_ES2 += -lGLESv2 -lEGL + +QMAKE_CFLAGS += -march=armv8-a +QMAKE_CXXFLAGS += $$QMAKE_CFLAGS + +EGLFS_DEVICE_INTEGRATION = eglfs_kms + +LINKER_FLAGS += -Wl,-O1 -Wl,--hash-style=gnu -Wl,--as-needed + +include(../common/linux_device_post.conf) + +load(qt_config) diff --git a/mkspecs/devices/linux-rasp-pi4-aarch64/qplatformdefs.h b/mkspecs/devices/linux-rasp-pi4-aarch64/qplatformdefs.h new file mode 100644 index 00000000000..3fe85b661cf --- /dev/null +++ b/mkspecs/devices/linux-rasp-pi4-aarch64/qplatformdefs.h @@ -0,0 +1,8 @@ +/**************************************************************************** +** +** Copyright (C) 2022 The Qt Company Ltd. +** SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only +** +****************************************************************************/ + +#include "../../linux-g++/qplatformdefs.h"