Cross-Compile on Banana Pi



  • Hi guys!

    I successfully cross-compiled Qt on my Raspberry Pi but due to performance issues I needed to get faster hardware. Therefore I bought a Banana Pi which does the job.
    Apparently I'm not able to cross-compile Qt on that device. My host system is Ubuntu 14.04.1 LTS and the Pi runs with Bananian Linux.
    I already tried the "Beginners guide":http://qt-project.org/wiki/RaspberryPi_Beginners_guide and used different image files.
    Well I guess I'm using the wrong toolchain since I only found the gcc-4.7-linaro-rpi-gnueabihf which is for the Raspberry Pi.

    Did anyone face the same problems or is there a guide like there is for the Raspberry Pi?

    I am very grateful for help or any advice!! :)

    Thanks.

    Seb


  • Lifetime Qt Champion

    Hi and welcome to devnet,

    What error are you getting ?



  • The Banana PI board is similar to Cubieboard2, so you can try "this":http://wickwire2099.blogspot.com/2014/02/qt5-on-cubieboard-a10a20.html tutorial.



  • Thank you so much for your quick replies.

    SGaist:
    The errors appear while running the ./configure command with the following parameters:

    @./configure -v -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=~/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/ban-pi-rootfs -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi@

    The errors itself are as follows (just a small extract):

    @/opt/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -pipe -marm -mfpu=vfp -mtune=arm1176jzf-s -march=armv6zk -mabi=aapcs-linux -mfloat-abi=hard --sysroot=/mnt/ban-pi-rootfs -g -Wall -W -fPIE -I../../mkspecs/devices/linux-rasp-pi-g++ -I. -o arch.o arch.cpp
    arch.cpp:45:19: fatal error: stdio.h: No such file or directory
    compilation terminated.
    make: *** [arch.o] Error 1
    Unable to determine architecture!

    Could not determine the target architecture!
    Turn on verbose messaging (-v) to see the final report.
    Determining architecture... ()
    g++ -c -pipe -g -Wall -W -fPIE -I../../mkspecs/linux-g++ -I. -o arch.o arch.cpp
    g++ -o arch arch.o
    Found architecture in binary
    CFG_HOST_ARCH="i386"
    CFG_HOST_CPUFEATURES=""
    System architecture: 'unknown'
    Host architecture: 'i386'
    C++11 auto-detection... ()

    [..]

    /opt/gcc-4.7-linaro-rpi-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.7.2/../../../../arm-linux-gnueabihf/include/c++/4.7.2/arm-linux-gnueabihf/bits/os_defines.h:40:22: fatal error: features.h: No such file or directory
    compilation terminated.
    make: *** [c++11.o] Error 1
    C++11 disabled.
    floatmath auto-detection... ()
    @
    etc.

    diabolic:
    Thanks for the link. I'll give it a try and get back to you as soon as I tested it.



  • Of course in this tutorial you must use rootfs from bananapi, instead from cubieboard. Toolchain can be the same (banana and cubieboard have same CPU and GPU).



  • -Sorry but I already get stuck after the first few steps.-

    -I downloaded all the necessary files like the image file for the BananaPi, the toolchain and the sunxi-bsp.-

    -But there is no BananaPi environment selectable for the ./configure command of the sunxi-bsp. This needs to be -modified according to "this tutorial":https://github.com/bananapi-dev/BPi/blob/master/HowToBuild_BPi_image.en.txt .-

    -As pointed out in recital 4 the environment needs to be set as follows:-
    -$ source bpi_env.sh-

    -But I can't figure out where to get that file..-
    -Does it work with the "cubietruck" or "cubieboard2" entry as well?-

    NVM - got that one working!



  • Mark topic as solved.



  • Sorry, my bad. The comment was misleading.
    I found out how to set up the BananaPi environment for the sunxi-bsp but after hours of loading/working I still didn't manage to cross-compile the Pi..



  • Well, I don't find any rootfs for the BananaPi. In particular, for the Bananian Linux which is a debian based image.
    Do you have any suggestions where I can get those since the "Linaro Releases":https://releases.linaro.org/ site doesn't provide it?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.