Kukkimonsuta / rpi-buildqt

Guide for cross compiling QT 5.8 with piomxtextures for raspberry pi
MIT License
45 stars 24 forks source link

ld.gold does not find crt1.o crti.o crtn.o on Ubuntu 64bit with pi3 #4

Open MarkusIppy opened 7 years ago

MarkusIppy commented 7 years ago

/home/markus/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/markus/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC -I. -I/home/markus/raspi/src/qtbase/mkspecs/devices/linux-rpi3-g++ -o verifyspec.o verifyspec.cpp /home/markus/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/home/markus/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/markus/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/markus/raspi/sysroot/lib/arm-linux-gnueabihf -mfloat-abi=hard --sysroot=/home/markus/raspi/sysroot -Wl,-O1 -fuse-ld=gold -o verifyspec verifyspec.o
/usr/bin/arm-linux-gnueabihf-ld.gold: error: cannot open crt1.o: No such file or directory /usr/bin/arm-linux-gnueabihf-ld.gold: error: cannot open crti.o: No such file or directory /usr/bin/arm-linux-gnueabihf-ld.gold: error: cannot open crtn.o: No such file or directory collect2: error: ld returned 1 exit status Makefile:65: recipe for target 'verifyspec' failed make: *** [verifyspec] Error 1 Note: Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx

ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.

I have checked and the files are all in the /home/markus/sysroot/usr/lib/arm-linux-gnueabihf how can i fix this ?

Kukkimonsuta commented 7 years ago

I don't think I've tried building with gold linker, try -fuse-ld=bfd

darkladen commented 7 years ago

Hi, I had a similar problem and change "-fuse-ld=gold" to "-fuse-ld=bsd" and the problem persists.

Running configuration tests...
Checking for valid makespec... 
+ cd /home/andres/raspi/src/qtbase/config.tests/common/verifyspec && /home/andres/raspi/src/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared console" "QMAKE_CFLAGS += --sysroot=/home/andres/raspi/sysroot" "QMAKE_CXXFLAGS += --sysroot=/home/andres/raspi/sysroot" "QMAKE_LFLAGS += --sysroot=/home/andres/raspi/sysroot" -early "CONFIG += cross_compile" /home/andres/raspi/src/qtbase/config.tests/common/verifyspec
+ cd /home/andres/raspi/src/qtbase/config.tests/common/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make
> rm -f verifyspec.o
> rm -f *~ core *.core
> /home/andres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -c -march=armv8-a -mtune=cortex-a53 -mfpu=crypto-neon-fp-armv8 -mfloat-abi=hard --sysroot=/home/andres/raspi/sysroot -O2 -std=gnu++11 -Wall -W -fPIC  -I. -I/home/andres/raspi/src/qtbase/mkspecs/devices/linux-rpi3-g++ -o verifyspec.o verifyspec.cpp
> /home/andres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/home/andres/raspi/sysroot/opt/vc/lib -Wl,-rpath-link,/home/andres/raspi/sysroot/usr/lib/arm-linux-gnueabihf -Wl,-rpath-link,/home/andres/raspi/sysroot/lib/arm-linux-gnueabihf -mfloat-abi=hard --sysroot=/home/andres/raspi/sysroot -Wl,-O1 -o verifyspec verifyspec.o    
> /home/andres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory
> /home/andres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory
> /home/andres/raspi/tools/arm-bcm2708/arm-rpi-4.9.3-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/4.9.3/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm
> collect2: error: ld returned 1 exit status
> Makefile:65: recipe for target 'verifyspec' failed
> make: *** [verifyspec] Error 1
Note: Also available for Linux: linux-clang linux-kcc linux-icc linux-cxx

ERROR: Cannot compile a minimal program. The toolchain or QMakeSpec is broken.

I use Ubuntu 16.04.2 LTS 64bit.

Thanks.

Kukkimonsuta commented 7 years ago

Have you tried using fresh RASPBIAN JESSIE LITE to make sysroot? I can think of anything else, sorry.

darkladen commented 7 years ago

Yes, I have try using fresh install "RASPBIAN JESSIE LITE" and "RASPBIAN JESSIE" and always came to the same error. Now i try using the package "Binaries 20170317". I hope have good news. Thanks for your work.

malcolmpl commented 7 years ago

You should add to file 3.1_build_qtbase.sh from dev brach -no-use-gold-linker in configure options.