您尚未登录。

楼主 # 2022-09-30 01:35:19

liefyuan
会员
注册时间: 2021-05-30
已发帖子: 69
积分: 95

T113-s3使用Tina SDK编译Qt5.12.9失败

硬件:mangopi MQ-R(T113-s3)
SDK: Tina
tslib:已经使用这个编译器编译、安装好了,位置在:/opt/tslib-t113
交叉编译器:Tina SDK自带的编译器

文件:/etc/profile

# /etc/profile: system-wide .profile file for the Bourne shell (sh(1))
# and Bourne compatible shells (bash(1), ksh(1), ash(1), ...).

if [ "$PS1" ]; then
  if [ "$BASH" ] && [ "$BASH" != "/bin/sh" ]; then
    # The file bash.bashrc already sets the default PS1.
    # PS1='\h:\w\$ '
    if [ -f /etc/bash.bashrc ]; then
      . /etc/bash.bashrc
    fi
  else
    if [ "`id -u`" -eq 0 ]; then
      PS1='# '
    else
      PS1='$ '
    fi
  fi
fi

if [ -d /etc/profile.d ]; then
  for i in /etc/profile.d/*.sh; do
    if [ -r $i ]; then
      . $i
    fi
  done
  unset i
fi

export PATH=$PATH:/usr/local/arm/gcc-linaro-4.9.4-2017.01-x86_64_arm-linux-gnueabihf/bin

export PATH=$PATH:/usr/local/arm/gcc-linaro-7.2.1-2017.11-x86_64_arm-linux-gnueabi/bin

# T113-s3 Tina-Linux Path
export PATH=$PATH:/home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin

export STAGING_DIR=$STAGING_DIR:/home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/out/t113-mq_r/staging_dir

如上最后两句已经添加了Tina SDK的交叉编译器的位置,和“STAGING_DIR”这个该死的环境变量

并且在终端也可以看到这个环境变量:

liefyuan@ubuntu:~/qt-src/qt-everywhere-src-5.12.9$ echo $STAGING_DIR
:/home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/out/t113-mq_r/staging_dir

编辑文件:vim qtbase/mkspecs/linux-arm-gnueabi-g++/qmake.conf

#
# qmake configuration for building with arm-linux-gnueabi-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                = /home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-gcc
QMAKE_CXX               = /home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-g++
QMAKE_LINK              = /home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-g++
QMAKE_LINK_SHLIB        = /home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-g++

# modifications to linux.conf
QMAKE_AR                = /home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-ar cqs
QMAKE_OBJCOPY           = /home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-objcopy
QMAKE_NM                = /home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-nm -P
QMAKE_STRIP             = /home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin/arm-openwrt-linux-muslgnueabi-strip
load(qt_config)
~               

配置文件 $ vim autoconfigure.sh

#!/bin/sh
export PATH=$PATH:/home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/prebuilt/gcc/linux-x86/arm/toolchain-sunxi-musl/toolchain/bin
./configure \
-prefix /opt/qt5.12.9-arm-t113 \
-opensource \
-confirm-license \
-release \
-strip \
-shared \
-xplatform linux-arm-gnueabi-g++ \
-optimized-qmake \
-c++std c++11 \
--rpath=no \
-pch \
-skip qt3d \
-skip qtactiveqt \
-skip qtandroidextras \
-skip qtcanvas3d \
-skip qtconnectivity \
-skip qtdatavis3d \
-skip qtdoc \
-skip qtgamepad \
-skip qtlocation \
-skip qtmacextras \
-skip qtnetworkauth \
-skip qtpurchasing \
-skip qtremoteobjects \
-skip qtscript \
-skip qtscxml \
-skip qtsensors \
-skip qtspeech \
-skip qtsvg \
-skip qttools \
-skip qttranslations \
-skip qtwayland \
-skip qtwebengine \
-skip qtwebview \
-skip qtwinextras \
-skip qtx11extras \
-skip qtxmlpatterns \
-make libs \
-nomake examples \
-nomake tools \
-nomake tests \
-gui \
-widgets \
-dbus-runtime \
--glib=no \
--iconv=no \
--pcre=qt \
--zlib=qt \
-no-openssl \
--freetype=qt \
--harfbuzz=qt \
-no-opengl \
-linuxfb \
--xcb=no \
-tslib \
--libpng=qt \
--libjpeg=qt \
--sqlite=qt \
-plugin-sql-sqlite \
-I/opt/tslib-t113/include \
-L/opt/tslib-t113/lib \
-plugin-sql-sqlite \
-I/home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/out/t113-mq_r/staging_dir/target/usr/include/ \
-I/home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/out/t113-mq_r/staging_dir/target/usr/include/allwinner/ \
-I/home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/out/t113-mq_r/staging_dir/target/usr/include/allwinner/include/ \
-L/home/liefyuan/Liefyuan/Tina-Linux/Tina-Linux/out/t113-mq_r/staging_dir/target/usr/lib/ \
-recheck-all

配置命令:$ ./autoconfigure.sh

编译命令:$ time sudo make -j16

配置没有问题

就是在编译的时候报错:

arm-openwrt-linux-muslgnueabi-g++.bin: warning: environment variable 'STAGING_DIR' not defined
arm-openwrt-linux-muslgnueabi-g++.bin: warning: environment variable 'STAGING_DIR' not defined
.obj/qlogging.o: In function `qFormatLogMessage(QtMsgType, QMessageLogContext const&, QString const&)':
qlogging.cpp:(.text+0x434c): undefined reference to `backtrace'
qlogging.cpp:(.text+0x440c): undefined reference to `backtrace_symbols'
collect2: error: ld returned 1 exit status
Makefile:1245: recipe for target '../../lib/libQt5Core.so.5.12.9' failed
make[3]: *** [../../lib/libQt5Core.so.5.12.9] Error 1
make[3]: Leaving directory '/home/liefyuan/qt-src/qt-everywhere-src-5.12.9/qtbase/src/corelib'
Makefile:226: recipe for target 'sub-corelib-make_first' failed
make[2]: *** [sub-corelib-make_first] Error 2
make[2]: Leaving directory '/home/liefyuan/qt-src/qt-everywhere-src-5.12.9/qtbase/src'
Makefile:50: recipe for target 'sub-src-make_first' failed
make[1]: *** [sub-src-make_first] Error 2
make[1]: Leaving directory '/home/liefyuan/qt-src/qt-everywhere-src-5.12.9/qtbase'
Makefile:58: recipe for target 'module-qtbase-make_first' failed
make: *** [module-qtbase-make_first] Error 2

real	0m38.265s
user	7m2.573s
sys	1m21.482s

网上能看的解答都看了:
【V853开发板试用】编译QT测试下
tina2.5|openwrt 交叉编译错误解决方法warning: environment variable 'STAGING_DIR' not defined
全志D1-H,官方SDK Tina2.0 移植 QT5.15

确实是没有办法了,向大佬们求救!
解决这个问题之后我会写一个详细的博客来介绍的:博客占坑:【Mangopi MQ-R:T113-s3编译Tina Linux系统(三)加Qt5】

最近编辑记录 liefyuan (2022-09-30 01:36:44)

离线

页脚

工信部备案:粤ICP备20025096号 Powered by FluxBB

感谢为中文互联网持续输出优质内容的各位老铁们。 QQ: 516333132, 微信(wechat): whycan_cn (哇酷网/挖坑网/填坑网) service@whycan.cn