Unsolved Cross-compile 5.7 Ubuntu 16.04 Error
-
I'm attempting to set up cross-compile using Ubuntu 16.04 and Qt 5.7 following this guide:
https://wiki.qt.io/RaspberryPi2EGLFS
I get all the way to the configure step:
./configure -release -opengl es2 -device linux-rasp-pi2-g++ \ -device-option CROSS_COMPILE=~/raspi/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian/bin/arm-linux-gnueabihf- \ -sysroot ~/raspi/sysroot -opensource -confirm-license -make libs \ -prefix /usr/local/qt5pi -extprefix ~/raspi/qt5pi -hostprefix ~/raspi/qt5 -v
but I'm getting this error:
Makefile:195: recipe for target 'atomicfptr.o' failed make: *** [atomicfptr.o] Error 1 std::atomic for function pointers disabled. ERROR: detected a std::atomic implementation that fails for function pointers. Please apply the patch corresponding to your Standard Library vendor, found in /home/keepstockdev/raspi/qtbase/config.tests/common/atomicfptr
I am unsure what libraries I might be missing, or how to apply the patch that it's talking about in the error message.
Can anybody help point me in the right direction?
Thanks!
-
Hi,
You're not missing any library. What is suggested is to patch the STD library used by your toolchain. You might want to check with the folks behind it directly for more information about what version of the tools and libraries they are using.
-
I got the same problem. Did you still find any solution?
I use Ubuntu 14.04 and QT 5.7. -
Hi,
You just need to (re)mount the image of Raspbian with this :
sudo mount -o loop,offset=62914560 2015-05-05-raspbian-wheezy.img /mnt/rasp-pi-rootfs
Of course if you use Jessie instead you will need to change the offset,
Hope this helps,
Arthur -
Hey, today I was able to do this for Qt 5.7 for Raspbian Jessie. I have Ubuntu 16.04 if you ask ;).
Just do everything from site https://wiki.qt.io/Raspberry_Pi_Beginners_Guide until "Compiling qtbase".
In example I download from link in https://wiki.qt.io/Raspberry_Pi_Beginners_Guide compiler - https://www.dropbox.com/s/sl919ly0q79m1e6/gcc-4.7-linaro-rpi-gnueabihf.tbz because from https://wiki.qt.io/RaspberryPi2EGLFS doesn't work properly for me.
The only thing that will change is "Compiling qtbase".
You need doing this step from https://wiki.qt.io/RaspberryPi2EGLFS.6. Adjust symlinks to be relative. Instead of the old fixQualifiedLibraryPaths get a script that works: wget https://raw.githubusercontent.com/riscv/riscv-poky/master/scripts/sysroot-relativelinks.py chmod +x sysroot-relativelinks.py ./sysroot-relativelinks.py sysroot
and if this is work you can try, this configure
./configure \ -release \ -opengl es2 \ -optimized-qmake \ -no-pch \ -make libs \ -make tools \ -reduce-exports \ -device linux-rasp-pi-g++ \ -device-option CROSS_COMPILE=~/Raspberry/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- \ -sysroot /mnt/rasp-pi-rootfs \ -opensource \ -confirm-license \ -prefix /usr/local/Qt-5.7.0-raspberry \ -extprefix /usr/local/Qt-5.7.0-raspberry \ -hostprefix /usr/local/Qt-5.7.0-raspberry \
and this is all, it's work for me ;)
-
Hi, I've got same error when trying to compile Qt 5.7 on Ubuntu 16.04 with gcc 4.9.3 linaro toolchain.
I followed the suggestion of fenix_fire running this command:./sysroot-relativelinks.py /mnt/raspi-rootfs
and then:
./configure -release -opengl es2 -device linux-rasp-pi2-g++ -device-option CROSS_COMPILE=~/raspberry/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/raspi-rootfs -opensource -confirm-license -make libs -prefix /usr/local/qt5.7-raspi -extprefix ~/raspberry/qt5.7-raspi -hostprefix ~/raspberry/qt5.7 -v
configure fails and give the error of the topic because of this other error:
/mnt/raspi-rootfs/usr/include/features.h:374:25: fatal error: sys/cdefs.h: No such file or directory
If I search cdefs.h in /mnt/raspi-rootfs/usr/ it is found in /mnt/raspi-rootfs/usr/include/arm-linux-gnueabihf/sys/cdefs.h
How can I set compiler to search includes in the right directory?
Thanks -
@AlTro
Well if nobody can answer, may try another way.
Like I said, the compiler from https://github.com/raspberrypi/tools may not work correctly, so try download this compiler:https://www.dropbox.com/s/sl919ly0q79m1e6/gcc-4.7-linaro-rpi-gnueabihf.tbz
-Unzip this in your ~/raspberry folder
-Mount image
-If you must, use again:sudo ./sysroot-relativelinks.py /mnt/rasp-pi-rootfs
go to your qtbase and try this configure:
./configure \ -release \ -opengl es2 \ -optimized-qmake \ -no-pch \ -make libs \ -make tools \ -reduce-exports \ -device linux-rasp-pi-g++ \ -device-option CROSS_COMPILE=~/raspberry/gcc-4.7-linaro-rpi-gnueabihf/bin/arm-linux-gnueabihf- \ -sysroot /mnt/rasp-pi-rootfs \ -opensource \ -confirm-license \ -prefix /usr/local/Qt-5.7.0-raspberry \ -extprefix /usr/local/Qt-5.7.0-raspberry \ -hostprefix /usr/local/Qt-5.7.0-raspberry \
-
This configuration works, but the problem is that gcc 4.7 doesn't have full c++11 support and my code was compiled only with gcc 4.9.
Luckily I changed only one line of code and all compiled well; but this is a real problem with legacy code because it's not possible, and good, to downgrade it. -
Hey ALTro,
I'm facing the same problem right now.Could you post your solution, please?
Thanks!
-
@Oliver-Hertel
As I said there is no solution for now with gcc 4.9.3 cross-compiler from https://github.com/raspberrypi/tools.
The configuration that feniks_fire suggest works, so follow https://wiki.qt.io/RaspberryPi2EGLFS guide but use the gcc-4.7-linaro cross-compiler.
The big problem is that if you have already written code with some c++11 features that gcc4.7 doesn't support, you have to evaluate if downgrading your code is better than compile directly on raspberry.
For example look at this problem that I get because of this https://forum.qt.io/topic/71407/cross-compiling-errors-linking-my-own-libraryHope this answer can help you.