本文基于qt版本5.12.8在x86_64位上交叉移植出aarch64架构使用的库
一、编译环境 x86_64
uisrc@ubuntu:~$ arch
x86_64
uisrc@ubuntu:~$ ^C
uisrc@ubuntu:~$
二、QT版本5.12.8下载解压
wget http://download.qt.io/archive/qt/5.12/5.12.8/single/qt-everywhere-src-5.12.8.tar.xz
tar xcf qt-everywhere-src-5.12.8.tar.xz
三、linux交叉编译器
aarch64-linux-gnu-g++/aarch64-linux-gnu-gcc
四、配置临时交叉编译器,编译器路径配置自己的路径
uisrc@ubuntu:~$
uisrc@ubuntu:~$ export PATH=$PATH:/home/uisrc/SDK/toolchains/aarch64-linux/bin/
uisrc@ubuntu:~$ `
五、进入qt源码
uisrc@ubuntu:~/qt/qt-everywhere-src-5.12.8/qtbase/mkspecs/linux-aarch64-gnu-g++$ cd /home/uisrc/qt/qt-everywhere-src-5.12.8/qtbase/mkspecs/linux-aarch64-gnu-g++
uisrc@ubuntu:~/qt/qt-everywhere-src-5.12.8/qtbase/mkspecs/linux-aarch64-gnu-g++$ ls
qmake.conf qplatformdefs.h
六、查看qmake.conf内容修改如下:
#
# qmake configuration for building with aarch64-linux-gnu-g++
#
MAKEFILE_GENERATOR = UNIX
CONFIG += incremental
QMAKE_INCREMENTAL_STYLE = sublib
include(../common/linux.conf)
include(../common/gcc-base-unix.conf)
include(../common/g++-unix.conf)
# modifications to g++.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++
# modifications to linux.conf
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)
七、切换到源码路径下编写配置脚本cfg.sh并运行
uisrc@ubuntu:~/qt/qt-everywhere-src-5.12.8$gedit cfg.sh
#!/bin/sh
./configure -prefix /opt/qt5.12.8 \
-opensource \
-confirm-license \
-release \
-strip \
-no-eglfs -linuxfb \
-qt-zlib \
-no-gif \
-qt-libpng \
-qt-libjpeg \
-qt-freetype \
-no-rpath \
-no-pch \
-no-avx \
-no-openssl \
-no-cups \
-no-dbus \
-no-pkg-config \
-no-glib \
-no-iconv \
-xplatform linux-aarch64-g++ \
-no-opengl \
-nomake examples \
-nomake tools \
-no-sqlite \
-skip qtgamepad \
-skip qtandroidextras \
-skip qtmacextras \
-skip qtx11extras \
-skip qtsensors \
-skip qtserialbus \
-skip qtserialport \
-skip qtwebengine \
-skip qtwebchannel \
-skip qtwebsockets \
-skip qtlocation \
-skip qtquickcontrols \
-skip qtpurchasing \
-skip qtconnectivity \
-skip qtscxml \
-skip qtxmlpatterns \
uisrc@ubuntu:~/qt/qt-everywhere-src-5.12.8$ chmod 777 cfg.sh
uisrc@ubuntu:~/qt/qt-everywhere-src-5.12.8$ ./cfg.sh
八、编译
make -j8
九、安装
make install
十、库位置
配置文件/opt/qt5.12.8 安装的位置或者源码路径qtbase下lib和include
标签:架构,x86,gnu,aarch64,skip,linux,uisrc,qt From: https://blog.csdn.net/qq_42842833/article/details/143113485