问题
Me and my friend are working on a portable internet radio driven by a Raspberry PI B+ and a little touch screen. I am developing the interface with Qt-5.9 which I've cross compiled for the ARMv6 CPU of the PI. My interface is using QML, so when I launch my app, everythings working but the QML animations are lagging.
Accordingly the console tells me that the QML JIT is not enabled (JIT is disabled for QML. Property bindings and animations will be very slow. Visit https://wiki.qt.io/V4 to learn about possible solutions for your platform.
), so I looked up on the given page about the V4 engine and after around two weeks of trying out, I found out that the problem is the missing possibility of using the Thumb-1 instruction set, which is needed by V4, and the HardFP configuration of the Raspbian Jessie running on the Pi. So now I think it would work if i get the cross-compiler to working with the Thumb-1 set. I tried a lot and in the end i got two problems.
- When I use the
-mthumb
flag in the command line, i get this error:sorry, unimplemented: Thumb-1 hard-float VFP ABI
. I need the Thumb-1, I can't change the Hard-Float implementation of the whole OS and there is no suitable compiler flag for ARMv6 to disable VFP. - When I use the
-mthumb-interwork
flag in the command line, the compilation works, but the executable doesn't change because of the ABI setting (https://gcc.gnu.org/onlinedocs/gcc-4.8.5/gcc/ARM-Options.html#ARM-Options) (-mthumb-interwork: ... In AAPCS (the ABI) configurations this option is meaningless.
). I tried every possible ABI but none works and compiles a running program.
I've read about some patches for the RPi too, but they got included in the upstream Qt a long time ago.
I modified the compiler arguments a bit for trying out (file: QT/qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf):
QMAKE_CFLAGS += \
-mthumb \
-mfpu=vfp \
-mtune=arm1176jzf-s \
-march=armv6zk \
-mabi=aapcs-linux
(This configuration doesn't work)
I configured QT with the following arguments:
./configure -release -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- -sysroot ~/raspi/sysroot -opensource -confirm-license -skip webengine -make libs -no-icu -tslib -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v
I hope you guys are smarter than me in solving those problems cause i think i tried everything possible to make the JIT working.
It would be bad if this problem is unsolvable, because Qt-QML is a very suitable GUI soulution for embedded devices like the PI, and six of eight RPis are running this old ARMv6 CPU.
Thank you in advance
回答1:
I don't know enough about your specific problem, but i propose this:
I recommend you to use Boot2Qt, which is a yocto-linux build and is designed for embedded hardware. With it you get a lightweight linux distro and all the Qt-Libraries.
You can conveniently setup your application to start on boot and it performs very well, even on slow hardware. here is the documentation on building it:
http://doc.qt.io/QtForDeviceCreation/qtee-custom-embedded-linux-image.html
This url is about the commercial product but you can get the source in the repo below. Otherwise follow the instructions of the documentation.
git clone git://code.qt.io/yocto/meta-boot2qt.git
You are going to need a linux os for building. Ubuntu 16 and 18 worked well for me.
Boot2Qt is compatible with R-PI 1-3, Zero and many other devices. See the documentation for a more complete list.
来源:https://stackoverflow.com/questions/45423474/qt-qml-jit-on-raspberry-pi-rev-1