qt移植aarch64
时间: 2023-10-09 21:17:15 浏览: 128
引用中给出了在移植qt到aarch64平台的配置信息。要将qt移植到aarch64平台,需要进行以下步骤:
1. 使用arm64交叉编译器进行编译。在`qtbase/mkspecs/linux-arm-gnueabi-g/qmake.conf`文件中,修改以下参数:
```
QMAKE_CC = aarch64-linux-gnu-gcc
QMAKE_CXX = aarch64-linux-gnu-g++
QMAKE_LINK = aarch64-linux-gnu-g++
QMAKE_LINK_SHLIB = aarch64-linux-gnu-g++
QMAKE_AR = aarch64-linux-gnu-ar cqs
QMAKE_OBJCOPY = aarch64-linux-gnu-objcopy
QMAKE_NM = aarch64-linux-gnu-nm -P
QMAKE_STRIP = aarch64-linux-gnu-strip
```
2. 修改`qmake`配置文件。在配置文件中添加以下内容:
```
MAKEFILE_GENERATOR = UNIX
CONFIG = incremental
QMAKE_INCREMENTAL_STYLE = sublib
QT_QPA_DEFAULT_PLATFORM = linuxfb
QMAKE_CFLAGS_RELEASE = -O2 -march=armv8-a -lts
QMAKE_CXXFLAGS_RELEASE = -O2 -march=armv8-a -lts
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
QMAKE_CC = aarch64-linux-gnu-gcc
QMAKE_CXX = aarch64-linux-gnu-g++
QMAKE_LINK = aarch64-linux-gnu-g++
QMAKE_LINK_SHLIB = aarch64-linux-gnu-g++
QMAKE_AR = aarch64-linux-gnu-ar cqs
QMAKE_OBJCOPY = aarch64-linux-gnu-objcopy
QMAKE_NM = aarch64-linux-gnu-nm -P
QMAKE_STRIP = aarch64-linux-gnu-strip
load(qt_config)
```
3. 运行配置命令。使用以下命令运行`configure`脚本来进行配置:
```
./configure -prefix /usr/local/qt-5.6-arm -release -xplatform linux-arm-gnueabi-g -make libs -optimized-qmake -pch -qt-sql-sqlite -qt-libjpeg -qt-zlib -qt-libpng
```
阅读全文