QNX: Compiler ABI detection fails for cross-compilation on Windows hosts
This error is reproducible with a basic QNX toolchain file when cross-compiling from Windows. Same QNX toolchain file and build configuration in Linux succeeds to detect the compiler ABI info.
Detecting C compiler ABI info failed to compile with the following output:
Change Dir: C:/Users/promero/git_work/Utilities/hello-world-qnx/_build_qnx/CMakeFiles/CMakeTmp
Run Build Command(s):C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710/host/win64/x86_64/usr/bin/make.exe -f Makefile cmTC_e50c6/fast && C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710/host/win64/x86_64/usr/bin/make.exe -f CMakeFiles/cmTC_e50c6.dir/build.make CMakeFiles/cmTC_e50c6.dir/build
make.exe[1]: Entering directory 'C:/Users/promero/git_work/Utilities/hello-world-qnx/_build_qnx/CMakeFiles/CMakeTmp'
Building C object CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o
C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710/host/win64/x86_64/usr/bin/qcc.exe -Vgcc_ntox86_64_gpp -Wc,-isysroot,C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710//target/qnx7 -v -Wp,-MD,CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o.d -Wp,-MT,CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o -Wp,-MF,CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o.d -o CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o -c "C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeCCompilerABI.c"
cc1: fatal error: "C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeCCompilerABI.c": Invalid argument
compilation terminated.
cc: looking for gcc_ntox86_64_gpp in C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710//host/win64/x86_64/etc/qcc/gcc/8.3.0/gcc_ntox86_64_gpp++.conf
cc: looking for gcc_ntox86_64_gpp in C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710//host/win64/x86_64/etc/qcc/gcc/8.3.0/gcc_ntox86_64_gpp.conf
C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710//host/win64/x86_64/usr/lib/gcc/x86_64-pc-nto-qnx7.1.0/8.3.0/cc1 -quiet -fstack-protector-strong -mcmodel=small -nostdinc -D__LANGUAGE_C -D_LANGUAGE_C -D__QNX__ -D__QNXNTO__ -D__GNUC__=8 -D__GNUC_MINOR__=3 -D__GNUC_PATCHLEVEL__=0 -D__unix__ -D__unix -D__ELF__ -fPIE -D__X86_64__ -D__LITTLEENDIAN__ -Asystem(unix) -isysroot C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710//target/qnx7 -MD CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o.d -MT CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o -MF CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o.d -isystem C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710//target/qnx7/usr/include -isystem C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710//host/win64/x86_64/usr/lib/gcc/x86_64-pc-nto-qnx7.1.0/8.3.0/include C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeCCompilerABI.c -dumpbase C:/Program Files/CMake/share/cmake-3.21/Modules/CMakeCCompilerABI.c -o C:\Users\promero\AppData\Local\Temp\2qcc0lPFNc\CMakeCCompilerABI.s
cc: C:/ProgramData/MATLAB/SupportPackages/R2021a/toolbox/slrealtime/target/supportpackage/qnx710//host/win64/x86_64/usr/lib/gcc/x86_64-pc-nto-qnx7.1.0/8.3.0/cc1 caught signal 1
cc: unlinking CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o
cc: unlinking C:\Users\promero\AppData\Local\Temp\2qcc0lPFNc\CMakeCCompilerABI.s
cc: removing C:\Users\promero\AppData\Local\Temp\2qcc0lPFNc
CMakeFiles/cmTC_e50c6.dir/build.make:78: recipe for target 'CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o' failed
make.exe[1]: *** [CMakeFiles/cmTC_e50c6.dir/CMakeCCompilerABI.c.o] Error 1
make.exe[1]: Leaving directory 'C:/Users/promero/git_work/Utilities/hello-world-qnx/_build_qnx/CMakeFiles/CMakeTmp'
Makefile:127: recipe for target 'cmTC_e50c6/fast' failed
make.exe: *** [cmTC_e50c6/fast] Error 2