cross compiling to android and arm
-
https://github.com/shahriman/cross-compile-tools.git contains the same content,
so still the same error at /make step?????????
-
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?
-
hello @Lineaxe
let's do a slightly different approach clean everything and start fresh.
- 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-
now clone qt5 repository
git clone git://code.qt.io/qt/qt5.git -
now go to qt 5 folder [cd qt5]
run following
./init-repositoryit 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]
- 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-gccthen 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 :)
- create a directory in home folder and
-
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 -
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 -
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 4sudo make install
-
-
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?? -
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.htmlBut 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 relativeHowever 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. -
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/raspberrypiThanks