Crosscompile QT5.11.2 on TX2

Hi,
i would crosscompile QT 5.11.2 on TX2 but i have a problem in ./configure.

i download and put qt-source to /opt/qt5 and try

./configure \
-opengl es2 \
-device-option CROSS_COMPILE=/home/giga/64_TX2/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu/bin/aarch64-linux-gnu- \
-sysroot /home/giga/64_TX2/Linux_for_Tegra_tx2/rootfs \
-prefix /usr/local/qt5 \
-opensource \
-confirm-license \
-skip qtwebengine \
-skip qtscript \
-skip webview \
-nomake examples \
-nomake tests \
-make libs \
-extprefix /home/giga/64_TX2/qt5 \
-hostprefix /home/giga/64_TX2/qt5-host \
-device linux-tegra2-g++ \ 
-v

The result is:

> aarch64-linux-gnu-g++: error: unrecognized command line option ‘-mhard-float’
> aarch64-linux-gnu-g++: error: unrecognized command line option ‘-mfloat-abi=softfp’
> aarch64-linux-gnu-g++: error: unrecognized command line option ‘-mfpu=vfpv3-d16’
> aarch64-linux-gnu-g++: error: unrecognized command line option ‘-mfloat-abi=softfp’
> Makefile:178: recipe for target 'verifyspec.o' failed
> make: *** [verifyspec.o] Error 1
Note: Also available for Linux: linux-clang linux-icc

what am I wrong? maybe the device?
I read this discussion but I did not succeed anyway:
https://devtalk.nvidia.com/default/topic/1018352/jetson-tx2/issue-with-cross-compiling-qt5-9-1-qt-enterprise-eval-version-for-jetson-tx2-board/

in this second way the error is:

> /home/giga/64_TX2/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/5.5.0/../../../../aarch64-linux-gnu/bin/ld: impossibile trovare crt1.o: File o directory non esistente
> /home/giga/64_TX2/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/5.5.0/../../../../aarch64-linux-gnu/bin/ld: impossibile trovare crti.o: File o directory non esistente
> /home/giga/64_TX2/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/5.5.0/../../../../aarch64-linux-gnu/bin/ld: impossibile trovare -lm
> /home/giga/64_TX2/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/5.5.0/../../../../aarch64-linux-gnu/bin/ld: impossibile trovare -lc
> /home/giga/64_TX2/gcc-linaro-5.5.0-2017.10-x86_64_aarch64-linux-gnu/bin/../lib/gcc/aarch64-linux-gnu/5.5.0/../../../../aarch64-linux-gnu/bin/ld: impossibile trovare crtn.o: File o directory non esistente
> collect2: error: ld returned 1 exit status
> Makefile:66: recipe for target 'verifyspec' failed
> make: *** [verifyspec] Error 1
Note: Also available for Linux: linux-clang linux-icc

I can’t answer all of this, but “-mhard-float” is not valid on arm64/aarch64. This was something optional in arm32, but is guaranteed to be present in arm64 (there is no option for hard-float since hard-float is always available). This shows the options are somewhat out of date…looks like the config was intended for older 32-bit hardware.

In a similar way, consider that the “optional” hardware of older generation 32-bit arm will all become mandatory in 64-bit arm. Soft float ABI is not relevant. Try removing any option the compiler doesn’t understand.

Not sure, but the culprit might be:

-device linux-tegra2-g++

This may be related to Tegra2 that was arm32, but not suitable for TX2.

It would be rather interesting if the “tegra2” of “linux-tegra2-g++” was the old “Tegra 2” (tegra20 series). Because the older tegra2 was 32-bit it would make sense, but that’s incredibly ancient. I didn’t even notice that…it would explain a lot. A TX2 is definitely not a Tegra2.

I was wrong to select linux-tegra2-g++ but What should I select?
In the post that i’ve linked the user has created a copy of linux-jetson-tx1-g++ but not work for me becouse not found crt1.o / crt.o / -lm / -lc.

The lack of link file dependencies wouldn’t be solved by picking another target. The TX1 is the same architecture as a TX2 and so it would probably be valid. The “-lm” might be one you need to add (but likely have somewhere it wasn’t searched for), and the “-lc” has to already exist or the system wouldn’t run. The “crt1.o” and “crt.o” exist on all running Linux systems…these too exist already, but the software needed to know where they are.

I’m not where I can look more closely to see what is there, but the configure step probably also has instructions to name alternate or extra search paths. If you want to see what libraries are in the linker’s standard search path (these won’t necessarily be the only libs you have):

ldconfig -p

(then “-lm” would be an abbreviation for anything “libm.”, “-lc” would be short for anything prefixed “libc.”)

If you want to search for “crt1.o” and “crt.o”:

sudo find / -type f -name 'crt1.o'
sudo find / -type f -name 'crt.o'