I have been trying to figure out how to configure Qt cross compiling to the Dragonboard and was wondering if any tutorials have been made on how to do this in the Linaro Debian OS. There are many tutorials for Raspberry Pi, but I’m not sure how similar the setup would be.
i am not aware of any dragonboard specific instructions that we have. can you point us to the RPi instructions , I can have a quick look to confirm whether it should work on dragonboard (i suspect it should…)?
Thanks for checking.
from a very quick review, it seems that most of the instructions should work… a few notes (I haven’t tried, just after reading them)
- steps 1 to 4 need to be replaced by db410c setup instructions
- step 6, you can use user linaro, instead of pi.
- step 7, use the Linaro toolchain release directly instead of the RPi tools git.
- step 10 use Linaro cross compilation toolchain for CROSS_COMPILE
- step 14 is most likely not needed on DB410c which uses mesa for graphics
if you get it to work, perhaps you can write up a wiki page for that…
I’ve been trying to get the Qt configure script to run and I’m running into a problem with OpenGL configuration. The Raspberry Pi has its EGLFS GPU library at /opt/vc, which in the tutorial is used in the sysroot. I think the configure script can’t find the EGLFS library, I’m wondering what the Qt OpenGL configuration would be for the DragonBoard. Here’s a wiki from Qt about the configuration that I have been reviewing:
right. i missed that in the instructions. Qt5 has some custom device config for RPi, you probably want to try one of the default/generic device target instead, such as linux-generic-g++ or linux-arm-generic-g++ perhaps.
All possible targets can be found here: https://github.com/qt/qtbase/tree/5.11/mkspecs/devices
Since we are using a standard Graphics driver (from mesa), you don’t need much custom hacks in the build config for eglfs.
I’ve gotten Qt to successfully configure, I had to give it the path to the GLES libraries. Right now, I’m having trouble getting it to link correctly. The compilation seems to go alright, but the last step of linking the object files errors with:
/media/hdd/linaro/gcc-linaro-7.3.1-2018.05-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/7.3.1/../../../../aarch64-linux-gnu/bin/ld: /media/hdd/linaro/sysroot/usr/lib/aarch64-linux-gnu/libm.a(e_atan2.o): relocation R_AARCH64_ADR_PREL_PG_HI21 against external symbol__stack_chk_guard@@GLIBC_2.17’ can not be used when making a shared object; recompile with -fPIC`
I have tried to add -fPIC to the CFLAGS argument, but it doesn’t make any difference. This guy had the same problem: https://forum.qt.io/topic/75858/error-relocation-r_aarch64_adr_prel_pg_hi21-against-external-symbol-__stack_chk_guard-glibc_2-17-in-qt5-8-0-source-building-with-cross-compiler-aarch64/3
But when I changed the order of the paths (his solution), it didn’t make a difference. I thought it could have been something to do with linking the static libm.a library instead of the .so shared library, I removed the .a library to force using the shared one and ended up with another error earlier in the compilation
So I have successfully managed to configure and cross compile Qt, but I’m now running into trouble running the Qt app on the Dragonboard. When I run the app, it gives an error about not finding any X displays.
qt.qpa.screen: QXcbConnection: Could not connect to display
Could not connect to any X display.
I’m running with the linaro-developer version of Debian, the one without the desktop and just a console interface. Graphical applications are still expected to run on this version of the OS right?
So I think my unfamiliarity of the Linux X display system is getting in the way… I tried SSH X forwarding by running ssh -X linaro@… and the Qt apps actually ran successfully (albeit very slowly). How would I go about making the HDMI display on the dragonboard accessible to the Qt app?
Just wanted to say that I finally got Qt set up correctly for the Dragonboard. I have already kind of made a wiki for myself just to record this process, so if you would like me write up a wiki page that would be no problem.
great! please share instructions with everyone, that would be very much appreciated!
the “best” location might be around here: https://github.com/96boards/documentation/tree/master/consumer/dragonboard
once the material is ready for review, the maintainers of this project can decide where to put the doc in the end…
Ok, I’ll make a markdown file of the guide and do a pull request when it’s complete.
Hey @andrewloomis, I was wondering how you managed to cross-compile Qt? I’m having a similar problem as your original issue (errors when linking libm.a), but can’t find a way around it.
Hi reuben, I actually wrote up a wiki page explaining how I got it to work, please go through this, and if you have any more questions I’ll be happy to answer them. The main problem with the linking was that I had to define my own mkspec file which specifies the paths to the important libraries. But the wiki page explains all that: