Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. cross compiling to android and arm

cross compiling to android and arm

Scheduled Pinned Locked Moved Unsolved General and Desktop
50 Posts 7 Posters 19.2k Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • P Offline
    P Offline
    Pheonix
    wrote on 7 Mar 2016, 13:59 last edited by Pheonix 3 Jul 2016, 14:13
    #38

    hi, you have to clone a cross compile repository it must be mentioned in whatever manual or steps you are following for cross compilation . From that cloned repository you have to run a script for fixing broken links and path.
    please post all the errors you face in this cross-compilation battle because i myself have spent almost 10 days in this process and i just wanna know how many errors are possible in this process.

    1 Reply Last reply
    0
    • L Offline
      L Offline
      Lineaxe
      wrote on 8 Mar 2016, 00:55 last edited by Lineaxe 3 Aug 2016, 01:00
      #39

      Nice to know I am not struggling on alone here...Here is the link to the article I have been working from...
      http://exploreembedded.tumblr.com/post/115333857238/guide-to-cross-compile-qt-54-for-the-raspberry-pi
      I had been trying these steps out with Qt/5.4/Src and Qt/5.6/Src . I tested both Debian 8 and 7 O/S's for arm6 computer. I am using a Ubuntu 15 machine with a 64 bit O/S .
      Phoenix you mentioned cloning the cross compile repository . I copy my results of trying out that step described in the online article.
      cd ..
      sudo git clone git://gitorious.org/cross-compile-tools/cross-compile-tools.git

      This responded with the following:

      Cloning into 'cross-compile-tools'...
      fatal: unable to connect to gitorious.org:
      gitorious.org[0: 2a02:c0:1014::1]: errno=Connection timed out
      gitorious.org[1: 64.13.172.37]: errno=Connection refused

      Looking into the problem a bit further I find the following online at http://blog.gitorious.org
      Gitorious.org is dead, long live gitorious.org...
      As you may know, Gitorious was acquired by GitLab about a month ago, and we announced that Gitorious.org would be shutting down at the end of May, 2015.

      ( I locate and d/l a copy of files as a zip from https://github.com/shahriman/cross-compile-tools and put the files from it into the cross-compile directory which I had previously created) but I don't know if it contains the exact files , it does contain the /home/UbuntuUser/rpi/cross-compile-tools/fixQualifiedLibraryPaths file. I later ran the command from the cross-compile-tools folder with no errors. I copy the terminal results.
      ./fixQualifiedLibraryPaths /mnt/rasp-pi-rootfs ~/rpi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf-gcc
      Passed valid toolchain
      Adjusting the symlinks in /mnt/rasp-pi-rootfs/usr/lib to be relative
      Testing for existence of potential debian multi-arch dir: /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf
      Debian multiarch dir exists, adjusting
      Adjusting the symlinks in /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf to be relative

      1 Reply Last reply
      0
      • P Offline
        P Offline
        Pheonix
        wrote on 8 Mar 2016, 09:23 last edited by
        #40

        https://github.com/shahriman/cross-compile-tools.git contains the same content,

        so still the same error at /make step?????????

        1 Reply Last reply
        0
        • L Offline
          L Offline
          Lineaxe
          wrote on 9 Mar 2016, 06:01 last edited by
          #41

          After running ./configure ... ,I get the following line found at the bottom of the results after executing it.

          Prior to reconfiguration, make sure you remove any leftovers from
          the previous build.

          What should I be cleaning up? that is why I tried make clean since I wasn't sure what it wanted me to do to remove the leftovers? remove leftover ? Maybe these leftovers are causing the problem?

          1 Reply Last reply
          0
          • P Offline
            P Offline
            Pheonix
            wrote on 10 Mar 2016, 05:36 last edited by
            #42

            hello @Lineaxe

            let's do a slightly different approach clean everything and start fresh.

            1. create a directory in home folder and
              :- put jessie image in it
              :- download cross compilation tool chain using following command:-
              [wget https://www.dropbox.com/s/sl919ly0q79m1e6/gcc-4.7-linaro-rpi-gnueabihf.tbz]

            :- Extract it in directory.

            :- mount image as you previously did in mnt/rasp-pi-rootfs

            :- now clone cross compile tools repository using.
            [git clone git://github.com/shahriman/cross-compile-tools.git]

            :- now in directory you created in first step you have 1) image, 2) cross-compiling toolchain 3) cross compile tools repository.

            :- now if using 64 bit system run following commands :
            sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
            sudo apt-get install lib32stdc++6

            1. now clone qt5 repository
              git clone git://code.qt.io/qt/qt5.git

            2. now go to qt 5 folder [cd qt5]

            run following
            ./init-repository

            it will take a while depending upon your Ethernet speed ,make sure that this process is successful [the size of repository will be around 3.4 GB]

            1. now go to the directory we created in step 1(lets say you have created pheonix named directory) there you have a cross-compile-tools folder go to it.
              eg : command

            cd ~/pheonix/cross-compile-tools

            then run
            sudo ./fixQualifiedLibraryPaths /mnt/rasp-pi-rootfs/ ~/pheonix/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-gcc

            then go to qt5/qtbase folder and run the configure , and make command you were running previously.

            i did the following while cross compiling pi 2 with qt using my ubuntu 14.04 lts desktop system. cant point to single manual available online because what i did was a cocktail of alll :)

            1 Reply Last reply
            0
            • L Offline
              L Offline
              Lineaxe
              wrote on 13 Mar 2016, 08:53 last edited by
              #43

              Hi , I am trying out your steps Phoenix ... I while I was installing , I got the following error.
              sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
              E: Couldn't find any package by regex 'lib32bz2-1.0'
              I read up on the error and found out this information.
              The package (32 bit) you are looking for is libbz2-1.0:i386, its 64 bit version is libbz2-1.0:amd64.
              At first enable multi-arch support (if not done already):

              sudo dpkg --add-architecture i386

              Now run:

              sudo apt-get update

              You can now install the package by:

              sudo apt-get install libbz2-1.0:i386

              Later as I went into the qt5/qtbase folder and ran
              ~/rpi2/qt5/qtbase$ ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -skip qtwebkit -v
              Which edition of Qt do you want to use ?

              Type 'c' if you want to use the Commercial Edition.
              Type 'o' if you want to use the Open Source Edition.

              o

              This is the Qt Open Source Edition.

              You are licensed to use this software under the terms of
              the Lesser GNU General Public License (LGPL) versions 2.1.
              You are also licensed to use this software under the terms of
              the GNU Lesser General Public License (LGPL) versions 3.

              You have already accepted the terms of the Open Source license.

              Running configuration tests (phase 1)...
              Precompiled-headers support enabled.
              g++ -c -fvisibility=hidden fvisibility.c
              Symbol visibility control enabled.
              g++ --sysroot=-opensource -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
              Symbolic function binding enabled.
              DEFAULT_INCDIRS="/usr/include
              /usr/local/include"
              DEFAULT_LIBDIRS="/lib
              /usr/lib"
              Done running configuration tests.
              <srcbase> = /home/ubuntuUserName/rpi2/qt5/qtbase
              <outbase> = /home/ubuntuUserName/rpi2/qt5/qtbase
              Creating qmake...
              g++ -c -o qlibraryinfo.o -pipe -ffunction-sections -O2 -g -I/home/ubuntuUserName/rpi2/qt5/qtbase/qmake -I/home/ubuntuUserName/rpi2/qt5/qtbase/qmake/library -I/home/ubuntuUserName/rpi2/qt5/qtbase/qmake/generators -I/home/ubuntuUserName/rpi2/qt5/qtbase/qmake/generators/unix -I/home/ubuntuUserName/rpi2/qt5/qtbase/qmake/generators/win32 -I/home/ubuntuUserName/rpi2/qt5/qtbase/qmake/generators/mac -I/home/ubuntuUserName/rpi2/qt5/qtbase/qmake/generators/integrity -I../include -I../include/QtCore -I../include/QtCore/5.6.0 -I../include/QtCore/5.6.0/QtCore -I../src/corelib/global -DHAVE_QCONFIG_CPP -I/home/ubuntuUserName/rpi2/qt5/qtbase/mkspecs/linux-g++ -I/home/ubuntuUserName/rpi2/qt5/qtbase/tools/shared -DQT_VERSION_STR="5.6.0" -DQT_VERSION_MAJOR=5 -DQT_VERSION_MINOR=6 -DQT_VERSION_PATCH=0 -DQT_BUILD_QMAKE -DQT_BOOTSTRAPPED -DPROEVALUATOR_FULL -DQT_NO_TEXTCODEC -DQT_NO_UNICODETABLES -DQT_NO_COMPONENT -DQT_NO_COMPRESS -DQT_NO_THREAD -DQT_NO_QOBJECT -DQT_NO_GEOM_VARIANT -DQT_NO_DATASTREAM -DQT_CRYPTOGRAPHICHASH_ONLY_SHA1 -DQT_JSON_READONLY -DQT_NO_STANDARDPATHS /home/ubuntuUserName/rpi2/qt5/qtbase/src/corelib/global/qlibraryinfo.cpp
              g++ -o "../bin/qmake" project.o option.o property.o main.o ioutils.o proitems.o qmakevfs.o qmakeglobals.o qmakeparser.o qmakeevaluator.o qmakebuiltins.o makefile.o unixmake2.o unixmake.o mingw_make.o winmakefile.o projectgenerator.o meta.o makefiledeps.o metamakefile.o xmloutput.o pbuilder_pbx.o msvc_vcproj.o msvc_vcxproj.o msvc_nmake.o msvc_objectmodel.o msbuild_objectmodel.o cesdkhandler.o qtextcodec.o qutfcodec.o qstring.o qstring_compat.o qstringbuilder.o qtextstream.o qiodevice.o qringbuffer.o qdebug.o qmalloc.o qglobal.o qarraydata.o qbytearray.o qbytearraymatcher.o qdatastream.o qbuffer.o qlist.o qfiledevice.o qfile.o qfilesystementry.o qfilesystemengine.o qfsfileengine.o qfsfileengine_iterator.o qregexp.o qvector.o qbitarray.o qdir.o qdiriterator.o quuid.o qhash.o qfileinfo.o qdatetime.o qstringlist.o qabstractfileengine.o qtemporaryfile.o qmap.o qmetatype.o qsettings.o qsystemerror.o qlibraryinfo.o qvariant.o qvsnprintf.o qlocale.o qlocale_tools.o qlinkedlist.o qnumeric.o qcryptographichash.o qxmlstream.o qxmlutils.o qlogging.o qjson.o qjsondocument.o qjsonparser.o qjsonarray.o qjsonobject.o qjsonvalue.o qfilesystemengine_unix.o qfilesystemiterator_unix.o qfsfileengine_unix.o qlocale_unix.o -Wl,--gc-sections
              Running configuration tests (phase 2)...
              Failed to process makespec for platform 'devices/linux-rasp-pi-g++'
              Project ERROR: CROSS_COMPILE needs to be set via -device-option CROSS_COMPILE=<path>
              Could not read qmake configuration file /home/ubuntuUserName/rpi2/qt5/qtbase/mkspecs/devices/linux-rasp-pi-g++/qmake.conf.
              Error processing project file: /dev/null

              1 Reply Last reply
              0
              • L Offline
                L Offline
                Lineaxe
                wrote on 13 Mar 2016, 09:18 last edited by
                #44

                I changed an export variable to the new toolchain and ran config again from ~/rpi2/qt5/qtbase
                export RPI_TOOLCHAIN=~/rpi2/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-

                ~/rpi2/qt5/qtbase$ ./configure -opengl es2 -device linux-rasp-pi-g++ -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt5pi -skip qtwebkit -v
                Which edition of Qt do you want to use ?

                Type 'c' if you want to use the Commercial Edition.
                Type 'o' if you want to use the Open Source Edition.

                o

                This is the Qt Open Source Edition.

                You are licensed to use this software under the terms of
                the Lesser GNU General Public License (LGPL) versions 2.1.
                You are also licensed to use this software under the terms of
                the GNU Lesser General Public License (LGPL) versions 3.

                You have already accepted the terms of the Open Source license.

                Running configuration tests (phase 1)...
                Precompiled-headers support enabled.
                /home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -fvisibility=hidden fvisibility.c
                Symbol visibility control enabled.
                arm-linux-gnueabihf-g++: error: unrecognized command line option ‘-fuse-ld=gold’
                /home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf-g++ --sysroot=-opensource -o libtest.so -shared -Wl,-Bsymbolic-functions -fPIC bsymbolic_functions.c
                bsymbolic_functions.c:2:2: error: #error "Symbolic function binding on this architecture may be broken, disabling it (see QTBUG-36129)."
                Symbolic function binding disabled.
                DEFAULT_INCDIRS="/home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/arm-linux-gnueabihf/include/c++/4.7.2
                /home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/arm-linux-gnueabihf/include/c++/4.7.2/arm-linux-gnueabihf
                /home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/arm-linux-gnueabihf/include/c++/4.7.2/backward
                /home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/lib/gcc/arm-linux-gnueabihf/4.7.2/include
                /home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/lib/gcc/arm-linux-gnueabihf/4.7.2/include-fixed
                /home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/arm-linux-gnueabihf/include
                "
                DEFAULT_LIBDIRS="/home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/lib/gcc/arm-linux-gnueabihf/4.7.2
                /home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/lib/gcc
                /home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/lib/gcc/arm-linux-gnueabihf
                /home/ubuntuUserName/rpi2/gcc-4.7-linaro-rpi-gnueabihf/arm-linux-gnueabihf/lib
                "
                Done running configuration tests.
                <srcbase> = /home/ubuntuUserName/rpi2/qt5/qtbase
                <outbase> = /home/ubuntuUserName/rpi2/qt5/qtbase
                Creating qmake...
                make: Nothing to be done for 'first'.
                Running configuration tests (phase 2)...
                Found pkg-config from $PATH: /usr/bin/pkg-config
                Warning: Disabling pkg-config since PKG_CONFIG_LIBDIR is not set and
                the host's .pc files would be used (even if you set PKG_CONFIG_PATH).
                Set this variable to the directory that contains target .pc files
                for pkg-config to function correctly when cross-compiling or
                use -pkg-config to override this test.
                Note: PKG_CONFIG_SYSROOT_DIR automatically set to -opensource
                Determining architecture... ()
                /home/ubuntuUserName/rpi2/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=-opensource -g -Wall -W -fPIC -I. -I../../mkspecs/devices/linux-rasp-pi-g++ -o arch.o arch.cpp
                arch.cpp:37:19: fatal error: stdio.h: No such file or directory

                compilation terminated.
                Makefile:188: recipe for target 'arch.o' failed
                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 -fPIC -I. -I../../mkspecs/linux-g++ -o arch.o arch.cpp
                g++ -o arch arch.o

                1 Reply Last reply
                0
                • P Offline
                  P Offline
                  Pheonix
                  wrote on 14 Mar 2016, 04:26 last edited by Pheonix
                  #45

                  hello @Lineaxe

                  try this configure command:-

                  after fixing the symlinks try this configure command

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

                  • from your above comment i think you you have made rpi2 folder in ur home directory the italic word in above mention command replace it with right folder and make sure it contains what is mentioned in command.

                  if it works sucessfully
                  run:-
                  make -j 4

                  sudo make install

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    Lineaxe
                    wrote on 14 Mar 2016, 11:45 last edited by
                    #46

                    Hi Pheonix ,
                    your configure command worked for me
                    your make -j 4 worked as well for me
                    and finally the sudu make install worked ...
                    I think I can continue on with writing the New Jessie O/S onto the chip :)
                    The quagmire is now reduced to only a mire ...

                    1 Reply Last reply
                    0
                    • L Offline
                      L Offline
                      Lineaxe
                      wrote on 14 Mar 2016, 12:45 last edited by
                      #47

                      I have been doing what is nearly the final steps in the article and found a problem.
                      When I did copy the .img over to the arm computers memory, the .img was corrupt and won't boot up ... says things like superbad sector ...Here is something interesting , the arm O/S usually starts using only 4GB of memory and you need to expand it to use the full amount of memory. The latest O/S already seems to use alot of the 4GB up. We are adding QT creator to the O/S image . I am wondering if It might go over arm O/S's maximum of 4GB on initialization??

                      1 Reply Last reply
                      0
                      • P Offline
                        P Offline
                        Pheonix
                        wrote on 19 Mar 2016, 11:17 last edited by
                        #48

                        hello, @Lineaxe any progress????????

                        1 Reply Last reply
                        0
                        • kingvittuK Offline
                          kingvittuK Offline
                          kingvittu
                          wrote on 24 Mar 2016, 10:03 last edited by kingvittu
                          #49

                          Hi Lineaxe,

                          I have been trying to set up Qt creator for developing apps for Raspberry Pi 2 just like the way you are trying.
                          I followed the following link on Ubuntu 32 bit machine and it worked fine -
                          http://c2rb.blogspot.in/2015/09/qt-55-on-raspberry-pi-2-1.html

                          But I'm failing at the make step while trying on Ubuntu 64 bit machine and I have faced the exact same problems that you faced/are facing. Let us help each other and get this done.

                          First of all when you fix symbolic links your output should show some symlink adjustments including the libz.so and it should look like the output below (extract from the blog):

                          Passed valid toolchain
                          Adjusting the symlinks in /mnt/rasp-pi-rootfs/usr/lib to be relative
                          Adjusting the symlinks in /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf to be relative
                          ./libnss_nisplus.so
                          ../../../lib/arm-linux-gnueabihf/libnss_nisplus.so.2
                          ./libresolv.so
                          ../../../lib/arm-linux-gnueabihf/libresolv.so.2
                          ./libanl.so
                          ../../../lib/arm-linux-gnueabihf/libanl.so.1
                          ./libcrypt.so
                          ../../../lib/arm-linux-gnueabihf/libcrypt.so.1
                          ./libnss_compat.so
                          ../../../lib/arm-linux-gnueabihf/libnss_compat.so.2
                          ./libthread_db.so
                          ../../../lib/arm-linux-gnueabihf/libthread_db.so.1
                          ./libz.so
                          ../../../lib/arm-linux-gnueabihf/libz.so.1.2.7
                          ./libutil.so
                          ../../../lib/arm-linux-gnueabihf/libutil.so.1
                          ./libnss_hesiod.so
                          ../../../lib/arm-linux-gnueabihf/libnss_hesiod.so.2
                          ./libdl.so
                          ../../../lib/arm-linux-gnueabihf/libdl.so.2
                          ./libnsl.so
                          ../../../lib/arm-linux-gnueabihf/libnsl.so.1
                          ./libnss_nis.so
                          ../../../lib/arm-linux-gnueabihf/libnss_nis.so.2
                          ./libm.so
                          ../../../lib/arm-linux-gnueabihf/libm.so.6
                          ./libBrokenLocale.so
                          ../../../lib/arm-linux-gnueabihf/libBrokenLocale.so.1
                          ./librt.so
                          ../../../lib/arm-linux-gnueabihf/librt.so.1
                          ./libnss_dns.so
                          ../../../lib/arm-linux-gnueabihf/libnss_dns.so.2
                          ./libnss_files.so
                          ../../../lib/arm-linux-gnueabihf/libnss_files.so.2
                          ./libcidn.so
                          ../../../lib/arm-linux-gnueabihf/libcidn.so.1
                          ./libpng12.so
                          ../../../lib/arm-linux-gnueabihf/libpng12.so.0
                          Testing for existence of potential debian multi-arch dir: /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf
                          Debian multiarch dir exists, adjusting
                          Adjusting the symlinks in /mnt/rasp-pi-rootfs/usr/lib/arm-linux-gnueabihf to be relative

                          However your output and mine aren't showing such a list of fixes which is worrysome. When I ran it on 32-bit I had got a few such lines but now I'm not getting it on 64 bit.

                          Secondly when I tried to boot the image which I built using 32 bit machine, it got stuck up at a cursor.
                          I later figured out with my tech lead's help that there was no free space due to partition not using entire 16GB of my sdcard. The solution was to expand the file system using raspi-config and reboot. You too can try similarly.

                          I'm looking at the fixQualifiedLibraryPaths script to see what's going wrong.
                          Hope we can fix this soon.

                          1 Reply Last reply
                          0
                          • kingvittuK Offline
                            kingvittuK Offline
                            kingvittu
                            wrote on 5 Apr 2016, 10:36 last edited by
                            #50

                            Hi,

                            I have edited the shell script to work with Ubuntu 15.10. I have not tested on other releases but I think it should work.
                            https://github.com/kingvittu/raspberrypi

                            Thanks

                            1 Reply Last reply
                            0

                            • Login

                            • Login or register to search.
                            • First post
                              Last post
                            0
                            • Categories
                            • Recent
                            • Tags
                            • Popular
                            • Users
                            • Groups
                            • Search
                            • Get Qt Extensions
                            • Unsolved