What can cause the CXX compiler to fail? (Cross compiling)
-
When configuring the "Build & Run" for an Arm cortex A7 processor, the CXX compiler is failing even before it has tried to compile the actual project (it seems that Qt creator might have a small piece of code to confirm, that the settings for compiler works). The questions is, what can cause the CXX compiler to fail in CMakeTestCXXCompiler.cmake (line 70 -> if(NOT CMAKE_CXX_COMPILER_WORKS))
The CXX compiler that the error is referring to is defined under build environment as:CXX="arm-poky-linux-gnueabi-g++ -mthumb -mfpu=neon -mfloat-abi=hard -mcpu=cortex-a7 -fstack-protector-strong -O2 -D_FORTIFY_SOURCE=2 -Wformat -Wformat-security -Werror=format-security -D_TIME_BITS=64 -D_FILE_OFFSET_BITS=64 --sysroot=$SDKTARGETSYSROOT"
I have tried to compile a very simple program outside Qt Creator (in the terminal) using the above settings for the compiler, and it produces an output file without any problems. When compiled from Qt Creator, I get the following issues:
/opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++" is not able to compile a simple test program. It fails with the following output: Change Dir: '/home/sm/development_HZ/GreetingsMCU/build/iMX7ULP_KIT-Debug/CMakeFiles/CMakeScratch/TryCompile-9OLwoV' Run Build Command(s): /usr/bin/ninja -v cmTC_ec202 [1/2] /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -DQT_QML_DEBUG -fdiagnostics-color=always -o CMakeFiles/cmTC_ec202.dir/testCXXCompiler.cxx.o -c /home/sm/development_HZ/GreetingsMCU/build/iMX7ULP_KIT-Debug/CMakeFiles/CMakeScratch/TryCompile-9OLwoV/testCXXCompiler.cxx [2/2] : && /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -DQT_QML_DEBUG CMakeFiles/cmTC_ec202.dir/testCXXCompiler.cxx.o -o cmTC_ec202 && : FAILED: cmTC_ec202 : && /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/bin/arm-poky-linux-gnueabi/arm-poky-linux-gnueabi-g++ -DQT_QML_DEBUG CMakeFiles/cmTC_ec202.dir/testCXXCompiler.cxx.o -o cmTC_ec202 && : /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find Scrt1.o: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find crti.o: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find crtbeginS.o: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find -lstdc++: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find -lm: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find -lgcc_s: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find -lgcc: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find -lc: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find -lgcc_s: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find -lgcc: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find crtendS.o: No such file or directory /opt/fsl-imx-wayland/6.6-scarthgap-imx-full-image/sysroots/x86_64-pokysdk-linux/usr/libexec/arm-poky-linux-gnueabi/gcc/arm-poky-linux-gnueabi/13.3.0/ld: cannot find crtn.o: No such file or directory collect2: error: ld returned 1 exit status ninja: build stopped: subcommand failed.
Any ideas why the compiler is failing - and how to solve it?
-