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

Pick-to: 6.3 6.4
Change-Id: I36574875e798281688601edd0f166922592d9830
Reviewed-by: Tatiana Borisova <tatiana.borisova@qt.io>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
This commit is contained in:
Umair Raihan 2022-07-11 17:41:19 +03:00
parent 6767ac20c9
commit 55dd943996
2 changed files with 33 additions and 0 deletions

View File

@ -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)

View File

@ -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"