Cross compile Qt 5.7 for raspberry pi 3 problem : font (text words) in application not showing up during running
-
I'm already passing in -v to ./configure. Is there somewhere else I should be passing it in?
I have been fiddling around, and trying to use system-freetype as the prereq for fontconfig (I hope I am understanding that properly). I did notice something in the config.log about that:
/home/malachi/x-tools/armv6-rpi-linux-gnueabihf/bin/armv6-rpi-linux-gnueabihf-g++ -Wl,-rpath-link,/home/malachi/Projects/rpi/zero/sysroot/opt/vc/lib -Wl,-rpath-link,/home/malachi/Projects/rpi/zero/sysroot/usr/lib/armv6-rpi-linux-gnueabihf -Wl,-rpath-link,/home/malachi/Projects/rpi/zero/sysroot/lib/armv6-rpi-linux-gnueabihf -mfloat-abi=hard -Wl,-O1 -fuse-ld=gold -o freetype freetype.o -L/home/malachi/Projects/rpi/zero/sysroot/usr/lib/arm-linux-gnueabihf -lfreetype > /home/malachi/x-tools/armv6-rpi-linux-gnueabihf/lib/gcc/armv6-rpi-linux-gnueabihf/4.9.4/../../../../armv6-rpi-linux-gnueabihf/bin/ld.gold: error: cannot open /lib/arm-linux-gnueabihf/libc.so.6: No such file or directory > /home/malachi/x-tools/armv6-rpi-linux-gnueabihf/lib/gcc/armv6-rpi-linux-gnueabihf/4.9.4/../../../../armv6-rpi-linux-gnueabihf/bin/ld.gold: error: cannot open /usr/lib/arm-linux-gnueabihf/libc_nonshared.a: No such file or directory > /home/malachi/x-tools/armv6-rpi-linux-gnueabihf/lib/gcc/armv6-rpi-linux-gnueabihf/4.9.4/../../../../armv6-rpi-linux-gnueabihf/bin/ld.gold: error: cannot open /lib/arm-linux-gnueabihf/ld-linux-armhf.so.3: No such file or directory > ../sysdeps/arm/start.S:124: error: undefined reference to '__libc_start_main' > ../sysdeps/arm/start.S:128: error: undefined reference to 'abort' > ../sysdeps/arm/start.S:113: error: undefined reference to '__libc_csu_fini' > ../sysdeps/arm/start.S:120: error: undefined reference to '__libc_csu_init' > collect2: error: ld returned 1 exit status > Makefile:64: recipe for target 'freetype' failed > make: *** [freetype] Error 1 => source failed verification.
I seems the linker is looking for the raw target paths to find some libs, but of course on the cross-compiling host those paths aren't present. I had to specify "-no-gcc-sysroot" to get things to compile in general, is it possible that flag is causing a problem here?
I'm definitely specifying the -sysroot parameter...so this one surprised me
It's worth noting I'm using a crosstool-ng toolchain, targeting GCC 4.9 LINARO
-
Do you mean that you are using a self-built toolchain ?
-
@SGaist yes
ct-ng has an rpi preset, so I'm more or less using that
EDIT: If "no-gcc-sysroot" is not specified, we see:
/home/malachi/x-tools/armv6-rpi-linux-gnueabihf/bin/armv6-rpi-linux-gnueabihf-g++ -Wl,-rpath-link,/home/malachi/Projects/rpi/zero/sysroot/opt/vc/lib -Wl,-rpath-link,/home/malachi/Projects/rpi/zero/sysroot/usr/lib/armv6-rpi-linux-gnueabihf -Wl,-rpath-link,/home/malachi/Projects/rpi/zero/sysroot/lib/armv6-rpi-linux-gnueabihf -mfloat-abi=hard --sysroot=/home/malachi/Projects/rpi/zero/sysroot -Wl,-O1 -fuse-ld=gold -o verifyspec verifyspec.o > /home/malachi/x-tools/armv6-rpi-linux-gnueabihf/lib/gcc/armv6-rpi-linux-gnueabihf/4.9.4/../../../../armv6-rpi-linux-gnueabihf/bin/ld.gold: error: cannot open crt1.o: No such file or directory > /home/malachi/x-tools/armv6-rpi-linux-gnueabihf/lib/gcc/armv6-rpi-linux-gnueabihf/4.9.4/../../../../armv6-rpi-linux-gnueabihf/bin/ld.gold: error: cannot open crti.o: No such file or directory > /home/malachi/x-tools/armv6-rpi-linux-gnueabihf/lib/gcc/armv6-rpi-linux-gnueabihf/4.9.4/../../../../armv6-rpi-linux-gnueabihf/bin/ld.gold: error: cannot open crtn.o: No such file or directory > /home/malachi/x-tools/armv6-rpi-linux-gnueabihf/lib/gcc/armv6-rpi-linux-gnueabihf/4.9.4/../../../../armv6-rpi-linux-gnueabihf/bin/ld.gold: error: cannot find -lstdc++ > /home/malachi/x-tools/armv6-rpi-linux-gnueabihf/lib/gcc/armv6-rpi-linux-gnueabihf/4.9.4/../../../../armv6-rpi-linux-gnueabihf/bin/ld.gold: error: cannot find -lm ...
The lines like:
-rpath-link,/home/malachi/Projects/rpi/zero/sysroot/lib/armv6-rpi-linux-gnueabihf
are wrong. Should be
-rpath-link,/home/malachi/Projects/rpi/zero/sysroot/lib/arm-linux-gnueabihf
Is there an additional config option for me to specify this?
Strangely, even if I symlink an armv6-rpi-linux-gnueabihf folder into existence it still fails...
-
Why not use the Raspberry Pi provided toolchain ?
-
@SGaist Reason is, I don't know if it (the provided toolchain) will fully work within buildroot environment, which is where I want to end up eventually. That and for other projects, ct-ng has been working quite nicely.
That said, it is feeling like time to at least give the provided toolchain a shot
EDIT: So, using the provided toolchain (gcc-linaro-arm-linux-gnueabihf-raspbian-x64) faces issues compiling qtwebkit and qtwebengine modules (demands NEON code). Are these modules supported on ARMv6?
-
Had the same issue cross-compiling Qt 5.8 for the Pi 2. Turns out it was caused by having absolute links in libraries in the sysroot. I fixed the problem using the symlinks program. Use the following commands on the Pi to fix it before running configure on the host (much cleaner than the fixQualifiedLibraryPaths shell script suggested on several Pi sites):
mkdir ~/tmp
cd ~/tmp
git clone https://github.com/brandt/symlinks
cd symlinks
makeEdit Makefile (e.g. vi Makefile) and add the following variable definition:
INSTALL = /usr/bin/install
Save and then run these commands:
sudo mkdir /usr/man/man8
sudo make install
sudo symlinks -cr /usr/lib /lib -
something can resolve the problem ?????
-
Fonts copied FROM /usr/share/fonts/truetype/dejavu/ TO target device: /usr/local/Qt5pi/lib/fonts
- The Fonts folder had to be created manually.
And it worked !!!!
-
@paul_espinosa thanks ,, worked for me also installing Qt-5.7.1 on armhf