Qt 6.11 is out! See what's new in the release
blog
Qt Cross Compilation for Tegra3 - Cannot find crt1.o
-
I've hit a stumbling block when attempting to cross-compile the qt-base sources for Linux.
Specifically targetting the NVIDIA Tegra3 architecture, I'm using the following
configurescript to start the process:./configure -device linux-tegra3-g++ -device-option CROSS_COMPILE=/opt/gcc-linaro/bin/arm-linux-gnueabihf- -sysroot /opt/sysroot/rootfs -nomake examples -nomake tests -prefix /usr/local/qt5 -extprefix /opt/qt/qt5 -hostprefix /opt/qt/qt5-host -opengl es2 -vI'm using the 5.2.1-2015.11-2-x86_64_arm-linux-gnueabihf toolchain which is symbolically linked to
/opt/gcc-linaroand therootfsof my target resides in/opt/sysroot/rootfsThe errors I get are:
Running configuration tests... + cd /opt/qt/qtbase/config.tests && /opt/gcc-linaro/bin/arm-linux-gnueabihf-g++ --sysroot=/opt/sysroot/rootfs -pipe -mtune=cortex-a9 -march=armv7-a -mhard-float -mfloat-abi=softfp -mfpu=vfpv3-d16 -mfloat-abi=softfp -fuse-ld=gold -o conftest-out conftest.cpp > collect2: fatal error: cannot find 'ld' > compilation terminated. + /opt/gcc-linaro/bin/arm-linux-gnueabihf-g++ -dumpmachine > arm-linux-gnueabihf Checking for valid makespec... + cd /opt/qt/qtbase/config.tests/verifyspec && /opt/qt/qtbase/bin/qmake "CONFIG -= qt debug_and_release app_bundle lib_bundle" "CONFIG += shared warn_off console single_arch" "QMAKE_CFLAGS += --sysroot=/opt/sysroot/rootfs" "QMAKE_CXXFLAGS += --sysroot=/opt/sysroot/rootfs" "QMAKE_LFLAGS += --sysroot=/opt/sysroot/rootfs" -early "CONFIG += cross_compile" /opt/qt/qtbase/config.tests/verifyspec + cd /opt/qt/qtbase/config.tests/verifyspec && MAKEFLAGS= /usr/bin/make clean && MAKEFLAGS= /usr/bin/make > rm -f verifyspec.o > rm -f *~ core *.core > /opt/gcc-linaro/bin/arm-linux-gnueabihf-g++ -c -pipe -mtune=cortex-a9 -march=armv7-a -mhard-float -mfloat-abi=softfp -mfpu=vfpv3-d16 -mfloat-abi=softfp --sysroot=/opt/sysroot/rootfs -O2 -w -fPIC -I. -I/opt/sysroot/rootfs/usr/include -I/opt/qt/qtbase/mkspecs/devices/linux-tegra3-g++ -o verifyspec.o verifyspec.cpp > /opt/gcc-linaro/bin/arm-linux-gnueabihf-g++ -Wl,-rpath-link,/opt/sysroot/rootfs/usr/lib -Wl,-rpath-link,/opt/sysroot/rootfs/usr/lib/arm-angstrom-linux-gnueabi -Wl,-rpath-link,/opt/sysroot/rootfs/lib/arm-angstrom-linux-gnueabi -mfloat-abi=softfp --sysroot=/opt/sysroot/rootfs -Wl,-O1 -Wl,-rpath-link,/opt/sysroot/rootfs/usr/lib -Wl,-rpath-link,/opt/sysroot/rootfs/usr/lib/arm-linux-gnueabi -Wl,-rpath-link,/opt/sysroot/rootfs/lib/arm-linux-gnueabi -o verifyspec verifyspec.o -L/opt/sysroot/rootfs/usr/lib -L/opt/sysroot/rootfs/lib/arm-linux-gnueabi -L/opt/sysroot/rootfs/usr/lib/arm-linux-gnueabi > /opt/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find crt1.o: No such file or directory > /opt/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find crti.o: No such file or directory > /opt/gcc-linaro-5.2-2015.11-2-x86_64_arm-linux-gnueabihf/bin/../lib/gcc/arm-linux-gnueabihf/5.2.1/../../../../arm-linux-gnueabihf/bin/ld: cannot find -lm > collect2: error: ld returned 1 exit status > Makefile:69: recipe for target 'verifyspec' failed > make: *** [verifyspec] Error 1I'm a little confused by the initial
collect2: fatal error: cannot find 'ld'error and I'm unsure as to whichldthe build is trying to find. Likewise, thecrtX.ofiles, are these the files contained in thesysroot/rootfsfrom the target device or are these files part of the toolchain?Any help would be greatly appreciated.