Solved Cross-compiling with diffrent motherboard
-
I have an ARM-based (Rockchip RK3288, ARM Cortex-A17 CPU, Mali-T760 MP4 (T764) GPU)motherboard and I want to cross-compile using it, but I keep getting errors. I use debian 9 as the operating system on this card, and I use ubuntu on the host PC.
I used this commands:
./configure -release -opengl es2 -device linux-arm-generic-g++ -device-option CROSS_COMPILE=~/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot ~/linaro/sysroot -opensource -confirm-license -make libs -prefix /usr/local/qt5li -extprefix ~/linaro/qt5li -hostprefix ~/linaro/qt5 -no-use-gold-linker -v
and I got these errors:
~~> /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/bin/ld: warning: libm.so.6, needed by /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so, not found (try using -rpath or -rpath-link) > /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/bin/ld: error: verifyspec uses VFP register arguments, verifyspec.o does not > /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/bin/ld: failed to merge target specific data of file verifyspec.o > /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `acos@GLIBC_2.4' > /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `pow@GLIBC_2.4' > /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `log@GLIBC_2.4' > /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `floor@GLIBC_2.4' > /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `log10@GLIBC_2.4' > /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `exp@GLIBC_2.4' > /home/buket/linaro/gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.5.0/../../../../arm-linux-gnueabihf/lib/libstdc++.so: undefined reference to `cosh@GLIBC_2.4' > collect2: hata: ld çıkış durumu 1 ile döndü > gmake: *** [Makefile:68: verifyspec] Error 1 Note: Also available for Linux: linux-clang linux-icc ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.
I'm sure I typed the paths correctly. I don't know where I went wrong and I can't solve this problem.
-
@Buket said in Cross-compiling with diffrent motherboard:
Edit :
I solved the problem here. I updated sysroot and before correcting my configure command, I prepared a qmake.conf file suitable for the processor of my motherboard. I adjusted the paths accordingly and got an error-free output.
Configure command:
./configure -static -release -opengl es2 -device linux-jetway-arm-g++ -device-option CROSS_COMPILE=~/linaro/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -no-eglfs -sysroot ~/linaro/sysroot -opensource -confirm-license -prefix /usr/local/qt5li -extprefix ~/linaro/qt5li -hostprefix ~/linaro/qt5 -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtdatavis3d -nomake examples -make libs -pkg-config -no-use-gold-linker -v
I can also optionally share the qmake.conf file. Thanks for your help.
-
Hi and welcome to devnet,
Your Linaro version looks quite old, is that intentional ?
Which version of Qt are you trying to cross-compile ?
Where does the sysroot come from ? -
Yes, I use it on purpose.
Qt Creator version 5.15.2.
I don't understand your last question. I downloaded and installed using the commands below. As a folder, I show the~/linaro/sysroot
folder as the path.
wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py chmod +x sysroot-relativelinks.py ./sysroot-relativelinks.py sysroot
-
@Buket said in Cross-compiling with diffrent motherboard:
This script does not download the sysroot.
So, how did you get the sysroot?
Or is there anything inside ~/linaro/sysroot?
Sysroot is usually a copy of the root file system of the target device. Especially /usr/lib and /usr/include folders are important, so the headers and libs can be found. -
@jsulm
I got it from target device using similar command below.rsync -avz device@ip_address:/usr/include sysroot/usr
It contains the folders you mentioned.
-
@Buket But you also got /usr/lib* from your target device?
-
@jsulm
I got the following folders from the target device.rsync -avz device@ip_address:/usr/include sysroot/usr rsync -avz device@ip_address:/lib sysroot rsync -avz device@ip_address:/usr/lib sysroot/usr
What I suspect is that I chose it wrong.
gcc-linaro-5.5.0-2017.10-x86_64_arm-linux-gnueabihf
I don't know how I should choose the toolchain. I think the error I am getting is due to the incompatibility.
-
@Buket said in Cross-compiling with diffrent motherboard:
Yes, I use it on purpose.
Why ?
How old is your sysroot compared to your toolchain ? -
@SGaist
I was watching a youtube video for cross-compile and I didn't want to use a different tool and get an error.
I changed the toolchain I used after your comment. You can see the version below. I cannot comment on sysroot, but I leave the command and link I used to download it below.toolchain version :
gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf
sysroot link :
wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py
-
@Buket said in Cross-compiling with diffrent motherboard:
but I leave the command and link I used to download it below.
Once again, that link provides you with a Python script to adjust symlinks to be relative in your sysroot folder, which you need to create/update from your device into your host machine.
-
@Pablo-J-Rogina I understand what you mean, but I don't understand what you mean about it being old. The day I cross-compiled, I created sysroot and got the necessary files from the target device. If that's what you're talking about, sysroot is up to date, but if you're talking about something different, can you tell me how I can find out?
-
@Buket said in Cross-compiling with diffrent motherboard:
Edit :
I solved the problem here. I updated sysroot and before correcting my configure command, I prepared a qmake.conf file suitable for the processor of my motherboard. I adjusted the paths accordingly and got an error-free output.
Configure command:
./configure -static -release -opengl es2 -device linux-jetway-arm-g++ -device-option CROSS_COMPILE=~/linaro/gcc-linaro-7.5.0-2019.12-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -no-eglfs -sysroot ~/linaro/sysroot -opensource -confirm-license -prefix /usr/local/qt5li -extprefix ~/linaro/qt5li -hostprefix ~/linaro/qt5 -opensource -confirm-license -skip qtscript -skip qtwayland -skip qtdatavis3d -nomake examples -make libs -pkg-config -no-use-gold-linker -v
I can also optionally share the qmake.conf file. Thanks for your help.