1

Is there anybody having this error while build qt libraries for raspberry pi 3 ?

/ssd/rpi/rpi-tools2/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/../lib/gcc/arm-linux-gnueabihf/4.8.3/../../../../arm-linux-gnueabihf/bin/ld.gold: error: /ssd/rpi/tmp/qt-everywhere-opensource-src-5.7.0/qtbase/lib/libqtpcre.a(pcre16_chartables.o): unknown CPU architecture

I've read this link (https://stackoverflow.com/questions/13626726/an-error-building-qt-libraries-for-the-raspberry-pi#=) , but I can't find any clue on this.

This is what I'm trying..

On ubuntu 16.04, gcc 5.3.1,

mount jessie

sudo mount -o loop,offset=70254592 /ssd/rpi/2016-05-27-raspbian-jessie.img /mnt/rasp-pi-rootfs/

fix library paths

./fixQualifiedLibraryPaths /mnt/rasp-pi-rootfs/ /ssd/rpi/rpi-tools2/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-gcc

export

export RPI_TOOLCHAIN=/ssd/rpi/rpi-tools2/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf-
export RPI_SYSROOT=/mnt/rasp-pi-rootfs

configure..

./configure -opengl es2 -c++std 11 -device linux-rpi3-g++ -fontconfig -device-option CROSS_COMPILE=$RPI_TOOLCHAIN -sysroot $RPI_SYSROOT -opensource -confirm-license -optimized-qmake -reduce-exports -release -make libs -prefix /usr/local/qt57pi -hostprefix /usr/local/qt57pi -v

make

make -j4 
Community
  • 1
  • 1
David
  • 223
  • 3
  • 7

1 Answers1

4

Run configure again with the parameter "-no-use-gold-linker".

The problem seems to be related to gold linker with ARMv8. I've changed one Makefile to test, changing "-fuse-ld=gold" to "-fuse-ld=bfd". The link runs fine.

In qtbase/mkspecs/devices/linux-rpi3-vc4-g++/qmake.conf you can check the comments:

# Example configure command below. We disable using the GNU gold
# linker as it apparently has issues with ARMv8. In the configure
# output check that "EGLFS GBM .......... yes" is present, otherwise
# eglfs will not be functional.
#
# ./configure -release -opengl es2 -device linux-rpi3-vc4-g++ \
#   -device-option CROSS_COMPILE=~/raspbian/tools/arm-bcm2708/gcc-linaro-arm-linux-gnueabihf-raspbian-x64/bin/arm-linux-gnueabihf- \
#   -sysroot ~/raspbian/sysroot \
#   -prefix /usr/local/qt5pi -extprefix ~/raspbian/qt5pi -hostprefix ~/raspbian/qt5 \
#   -v -nomake examples -nomake tests -no-use-gold-linker