无法在 Cubian 上为 cubieboard2 构建 QTAV

无法在 Cubian 上为 cubieboard2 构建 QTAV

我正在努力使QTAV库用于立方体板2环境和遇到的问题。能否请你帮忙。

qmake 是这么说的:

cubie@Cubian:~/QtAV/output$ qmake ../QtAV.pro
Project MESSAGE: BUILD_DIR=/home/cubie/QtAV/output
Info: creating cache file /home/cubie/QtAV/output/.qmake.cache
Project MESSAGE: target arch: arm
Project MESSAGE: target arch features:
Project MESSAGE: To disable config tests, you can use 1 of the following methods
Project MESSAGE: 1. create '.qmake.conf' in the root source dir, add 'CONFIG += no_config_tests'(Qt5)
Project MESSAGE: 2. pass 'CONFIG += no_config_tests' or '-config no_config_tests' to qmake
Project MESSAGE: 3. add 'CONFIG += no_config_tests' in /home/cubie/QtAV/user.conf
Project MESSAGE: To manually set a config test result to true, disable config tests and enable config_name like above
Checking for avutil... yes
Checking for avcodec... yes
Checking for avformat... yes
Checking for swscale... yes
Project MESSAGE: checking for optional features...
Checking for swresample... yes
Checking for avresample... no
Checking for gl... yes
Checking for avfilter... yes
Checking for sse4_1... no
Checking for openal... no
Checking for portaudio... yes
Checking for direct2d... no
Checking for gdiplus... no
Checking for dxva... no
Checking for xv... yes
Checking for vaapi... yes
Checking for libcedarv... yes
Project MESSAGE: To recheck the dependencies, delete '.qmake.cache' in the root of build dir, run qmake with argument 'CONFIG+=recheck' or '-config recheck’

然后我做了,这是最后一条消息:

g++ -c -pipe -isystem /home/cubie/QtAV/src -isystem /home/cubie/QtAV/src/.. -O2 -Wall -W -D_REENTRANT -fPIC -DBUILD_QTAV_LIB -D__STDC_CONSTANT_MACROS -DQTAV_HAVE_AVFILTER=1 -DQTAV_HAVE_SWRESAMPLE=1 -DQTAV_HAVE_PORTAUDIO=1 -DQTAV_HAVE_XV=1 -DQTAV_HAVE_GL=1 -DQTAV_HAVE_CUDA=1 -DQTAV_HAVE_VAAPI=1 -DQTAV_HAVE_CEDARV=1 -DQT_NO_DEBUG -DQT_OPENGL_LIB -DQT_WIDGETS_LIB -DQT_GUI_LIB -DQT_CORE_LIB -I/usr/local/Qt-5.3.1/mkspecs/linux-g++ -I/home/cubie/QtAV/src -I/usr/local/Qt-5.3.1/include -isystem /home/cubie/QtAV/src -I/home/cubie/QtAV -isystem /home/cubie/QtAV/src/QtAV -isystem /home/cubie/QtAV/src/cuda -isystem /home/cubie/QtAV/src/cuda/dllapi -I/usr/local/Qt-5.3.1/include/QtOpenGL -I/usr/local/Qt-5.3.1/include/QtWidgets -I/usr/local/Qt-5.3.1/include/QtGui -I/usr/local/Qt-5.3.1/include/QtCore -I.moc/5.3.1/QtAV -I. -o .obj/QtAV_linux_arm/VideoDecoderCedarv.o /home/cubie/QtAV/src/VideoDecoderCedarv.cpp
{standard input}: Assembler messages:
{standard input}:730: Error: selected processor does not support Thumb mode `vuzp.8 d0,d1'
{standard input}:731: Error: selected processor does not support Thumb mode `vuzp.8 d2,d3'

我在用着古巴人(cubieboard 的 Debian 克隆):

cubie@Cubian:~/QtAV/output$ uname -a
Linux Cubian 3.4.75-sun7i #35 SMP PREEMPT Sat Feb 8 02:10:31 CST 2014 armv7l GNU/Linux

这是我的 gcc 版本:

cubie@Cubian:~/QtAV/output$ gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/arm-linux-gnueabihf/4.6/lto-wrapper
Target: arm-linux-gnueabihf
Configured with: ../src/configure -v --with-pkgversion='Debian 4.6.3-14' --with-bugurl=file:///usr/share/doc/gcc-4.6/README.Bugs --enable-languages=c,c++,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.6 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.6 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --disable-sjlj-exceptions --with-arch=armv7-a --with-fpu=vfpv3-d16 --with-float=hard --with-mode=thumb --enable-checking=release --build=arm-linux-gnueabihf --host=arm-linux-gnueabihf --target=arm-linux-gnueabihf
Thread model: posix
gcc version 4.6.3 (Debian 4.6.3-14)

这是我的cpu信息

cubie@Cubian:~$ cat /proc/cpuinfo
Processor   : ARMv7 Processor rev 4 (v7l)
processor   : 0
BogoMIPS    : 2004.17

processor   : 1
BogoMIPS    : 2011.05

Features    : swp half thumb fastmult vfp edsp neon vfpv3 tls vfpv4 idiva idivt
CPU implementer : 0x41
CPU architecture: 7
CPU variant : 0x0
CPU part    : 0xc07
CPU revision    : 4

Hardware    : sun7i
Revision    : 0000
Serial      : 0000000000000000
Chipid      : 16516592-80826652-56484848-088254ea

cubie@Cubian:~$ gcc -dumpmachine
arm-linux-gnueabihf

可能出什么问题了?

答案1

你的问题在这里:

{standard input}: Assembler messages:
{standard input}:730: Error: selected processor does not support Thumb mode `vuzp.8 d0,d1'
{standard input}:731: Error: selected processor does not support Thumb mode `vuzp.8 d2,d3'

解释

iOS 开发人员应该了解的有关 ARM 处理器的一些知识

拇指

Thumb 指令集是 ARM 指令集的子集,经过压缩,指令仅占用 16 位(所有 ARM 指令的大小均为 32 位;Thumb 仍然是 32 位架构,只是指令占用的空间更少)。它并不是一种不同的架构,而是应该被视为最常见的 ARM 指令和功能的简写。当然,优点是它可以显着减少代码大小,节省内存、缓存和代码带宽;虽然这在微控制器类型的应用程序中更有用,它允许硬件节省所使用的内存,但它在 iOS 设备上仍然有用,因此它在 Xcode iOS 项目中默认启用。代码大小减少固然不错,但实际上从未达到 50%,因为有时一条等效 ARM 指令需要两条 Thumb 指令。 ARM和Thumb指令不能自由混合,处理器从一种指令切换到另一种指令时需要切换模式;这仅在调用函数或从函数返回时才会发生。因此,一个函数必须是 Thumb 或 ARM 作为一个整体;实际上,您无法控制代码是在函数粒度上编译为 Thumb 还是 ARM,而是在源文件粒度上控制。

来自 Debian 维基手臂硬漂浮

三胞胎

GCC 在针对 GNU arm-linux-gnueabi 三元组构建时将支持硬浮点和软浮点调用约定。

dpkg 依赖三元组来识别端口(gcc -dumpmachine 输出)。其他一些项目(例如多架构)依赖于在所有 Debian 架构中拥有不同的三元组。

一种选择是使用三元组中的供应商字段来具有不同的三元组。例如,三元组可以是arm-hardfloat-linux-gnueabi。

arm-none-linux-gnueabi,就像在 CodeSourcery 编译器中一样,将是一个选项,但将 arm-linux-gnueabi 与 arm-none-linux-gnueabi 联系起来会令人困惑;它与arm-hardfloat-linux-gnueabi 的关系更加清晰,并且还允许区分CodeSourcery 和新端口。

最终决定使用三元组arm-linux-gnueabihf


简而言之,上面发布的错误消息表明编译器在当前设置下不支持部分或全部拇指指令集。虽然我无法告诉您是否有其他编译器可用,但我可以告诉您需要检查两件事:

  1. 您是否已验证编译器支持您的此处列出的型号
  2. 您是否设置了QTAV 环境,如 Wiki 中所述?

作为旁注,并不是为了吹捧我的发行版喇叭,但你有没有想过使用ARM 上的 Gentoo


您可能需要的其他东西:

CHOST="armv7a-hardfloat-linux-gnueabi" CFLAGS="-O2 -march=armv7-a -mtune=cortex-a(7 或 8) -mfpu=vfpv3-d16 -mfloat-abi=hard -pipe -fomit-帧指针" CXXFLAGS="${CFLAGS}"

相关内容