CMake issueshttps://gitlab.kitware.com/cmake/cmake/-/issues2021-09-02T12:13:13-04:00https://gitlab.kitware.com/cmake/cmake/-/issues/22574QNX: Compiler ABI detection fails for cross-compilation on Windows hosts2021-09-02T12:13:13-04:00Pablo RomeroQNX: Compiler ABI detection fails for cross-compilation on Windows hostsThis 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...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
```https://gitlab.kitware.com/cmake/cmake/-/issues/22208QNX: CMake fails to determine library architecture on Windows2021-09-01T10:55:44-04:00Cristian AdamQNX: CMake fails to determine library architecture on WindowsCMake has at the `CMakeParseLibraryArchitecture.cmake` for QNX the following block:
```cmake
if(CMAKE_CXX_COMPILER_ID STREQUAL QCC)
foreach(dir ${implicit_dirs})
if (dir MATCHES "/lib$")
get_filename_component(assume...CMake has at the `CMakeParseLibraryArchitecture.cmake` for QNX the following block:
```cmake
if(CMAKE_CXX_COMPILER_ID STREQUAL QCC)
foreach(dir ${implicit_dirs})
if (dir MATCHES "/lib$")
get_filename_component(assumedArchDir "${dir}" DIRECTORY)
get_filename_component(archParentDir "${assumedArchDir}" DIRECTORY)
if (archParentDir STREQUAL CMAKE_SYSROOT)
get_filename_component(archDirName "${assumedArchDir}" NAME)
set(library_arch "${archDirName}")
break()
endif()
endif()
endforeach()
endif()
```
The line:
```cmake
if (archParentDir STREQUAL CMAKE_SYSROOT)
```
fails due to non normalize path comparison.
Today I found two ways to make this break:
1. `C:/Users/Cristian/qnx710/target/qnx7` vs `C:/Users/Cristian/qnx710//target/qnx7`
2. `c:/Users/Cristian/qnx710/target/qnx7` vs `C:/Users/Cristian/qnx710/target/qnx7`https://gitlab.kitware.com/cmake/cmake/-/issues/22204QNX: CMake doesn't search after q++ for C++ compiler name2021-05-18T15:05:00-04:00Cristian AdamQNX: CMake doesn't search after q++ for C++ compiler nameCMake 3.20 searches only after `QCC` as the C++ compiler name for QNX.
QNX 7.0, 7.1 have the `q++` as the name of the C++ compiler. See http://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.utilities/topic/q/qcc.htmlCMake 3.20 searches only after `QCC` as the C++ compiler name for QNX.
QNX 7.0, 7.1 have the `q++` as the name of the C++ compiler. See http://www.qnx.com/developers/docs/7.1/index.html#com.qnx.doc.neutrino.utilities/topic/q/qcc.htmlhttps://gitlab.kitware.com/cmake/cmake/-/issues/21503CMake fails to compile for QNX2020-11-25T10:04:34-05:00Stephen KellyCMake fails to compile for QNXCMake did not build on QNX at least in version 3.16.2. There was also a blog post about patching cmake to build for QNX https://cristianadam.eu/20181202/a-better-qnx-cmake-toolchain-file/ . A patch like that was applied in commit f9e950d...CMake did not build on QNX at least in version 3.16.2. There was also a blog post about patching cmake to build for QNX https://cristianadam.eu/20181202/a-better-qnx-cmake-toolchain-file/ . A patch like that was applied in commit f9e950d4.
However, meanwhile commit f034b0f6633 changed cmake to compile with `-std=c++NN` instead of `-std=gnu++NN`. As discussed in #20454, this means that CMake no longer compiles for QNX.https://gitlab.kitware.com/cmake/cmake/-/issues/21381CUDA: Support QNX2020-11-03T07:23:06-05:00Jan BernlöhrCUDA: Support QNXThe native CUDA support for CMake currently misses a few ingredients to work correctly on QNX, namely
- cuda target name is not derived correctly (should be `aarch64-qnx`).
- linking `cudart` must not be linked against `rt`, `dl`, `pthre...The native CUDA support for CMake currently misses a few ingredients to work correctly on QNX, namely
- cuda target name is not derived correctly (should be `aarch64-qnx`).
- linking `cudart` must not be linked against `rt`, `dl`, `pthread`.3.19.0https://gitlab.kitware.com/cmake/cmake/-/issues/21376QNX: Preprocessing ASM .S source files2020-11-20T11:48:50-05:00Valentin DinitaQNX: Preprocessing ASM .S source filesStarting with CMake 3.19.0-rc1, a new flag was added to the QCC compiler, "-x c", when the LANGUAGE property for a source file was set to C. Before that, the source file was sent to the right compiler without any additional flag that mig...Starting with CMake 3.19.0-rc1, a new flag was added to the QCC compiler, "-x c", when the LANGUAGE property for a source file was set to C. Before that, the source file was sent to the right compiler without any additional flag that might be caused by the LANGUAGE property.
The .S source files (e.g. in libjpeg-turbo) are C-ASM source code that has to be compiled with the QNX C compiler. The compiler knows how to treat them by extension.
The problem here is the newly added "-x" compile flag. "-x c" tells the compiler to treat the source file as pure C code, and it fails. If we change the LANGUAGE property of the source file to any ASM variant, then the file will be sent to the assembler instead of the QCC compiler, and that fails too.
So, we have C-ASM code, two languages, that has to be compiled with QNX-C compiler (QCC), but not marked as pure-C code with the "-x c". CMake 3.18.0 works just fine.https://gitlab.kitware.com/cmake/cmake/-/issues/18285find_library/cross-compile: does not find libs without filename extension2018-08-28T05:53:04-04:00Hannes Groblerfind_library/cross-compile: does not find libs without filename extensionHi there,
I am cross compiling from Windows to QNX with qcc (modified GCC compiler) and CMake (>= 3.11.0). The compiled code depends on Boost. Additionally I am using Conan (https://conan.io) as dependency manager that generates a Findbo...Hi there,
I am cross compiling from Windows to QNX with qcc (modified GCC compiler) and CMake (>= 3.11.0). The compiled code depends on Boost. Additionally I am using Conan (https://conan.io) as dependency manager that generates a Findboost.cmake file to utilize find_library(boost ...). The generated Find-file does specify the boost libraries by their plain names (e.g. boost_system, boost_chrono, ...).
problem
-------
When I build from Windows for Windows (native build; Visual Studio compiler "VS2015") then the real library filename is "boost_system.lib". find_library finds the files, this works as expected.
When I build from Windows for QNX (cross build; qcc) then the real library filename is "boost_system.so". find_library does not find the files.
investigation
-------------
The calling code looks like this (copy-paste):
```
find_package (boost 1.67.0 REQUIRED COMPONENTS system thread date_time chrono atomic log filesystem)
```
This results in console output
> -- Library boost_system not found in package, might be system one
.
The line can be found at Findboost.cmake line 38 (see attachment).
While compiling for QNX I have checked the CMAKE_FIND_LIBRARY_SUFFIXES variable while building and it says ".so;.a" as expected. So in general find_library should find the requested library "boost_atomic".
To support the problem tracking I have attached the generated Find-file.
Best regards
[Findboost.cmake](/uploads/8930605428f65c9750bf123fa088f31a/Findboost.cmake)https://gitlab.kitware.com/cmake/cmake/-/issues/17537The QCC CXX toolchain does not set CMAKE_CXXnn_STANDARD_COMPILE_OPTIONs and f...2017-12-06T10:57:30-05:00Ghost UserThe QCC CXX toolchain does not set CMAKE_CXXnn_STANDARD_COMPILE_OPTIONs and friendsWhile Modules/Compiler/GNU-CXX.cmake handles CMAKE_CXX98_STANDARD_COMPILE_OPTION and friends, the QNX toolchain does not. See Modules/Compiler/QCC-CXX.cmake.
This breaks trying to set a C++ standard via target_compile_features, or even ...While Modules/Compiler/GNU-CXX.cmake handles CMAKE_CXX98_STANDARD_COMPILE_OPTION and friends, the QNX toolchain does not. See Modules/Compiler/QCC-CXX.cmake.
This breaks trying to set a C++ standard via target_compile_features, or even through the CXX_STANDARD target property.https://gitlab.kitware.com/cmake/cmake/-/issues/17169CMake ninja RSP generator for QNX2017-08-22T09:44:16-04:00Ghost UserCMake ninja RSP generator for QNXHello!
I'm using a recent CMake build from the master branch on a Windows host, targetting a QNX 6.6 / ARMv7 platform.
I've got a very large project. The linker command line is very long, which means I have to use a response file. I'm u...Hello!
I'm using a recent CMake build from the master branch on a Windows host, targetting a QNX 6.6 / ARMv7 platform.
I've got a very large project. The linker command line is very long, which means I have to use a response file. I'm using the ninja generator (the Unix Makefiles generator has additional issues for me). Judging by tests, the QCC compiler requires that the response file contains spaces to separate each flag (this is configurable for Ninja, but not for the Unix Makefiles), and requires a space at the end of the file. If QCC gets a response file without a space at the end, it adds memory garbage to the end of the last linker dependency argument, and generates an error of not being able to find that library. Example error message for libsac:
C:\qnx660\host\win32\x86\usr\bin\arm-unknown-nto-qnx6.6.0eabi-ld: cannot find -lsacMz�Člć
The QCC compiler is closed source and I have to support its current version, so a fix for this issue is not feasible within QCC. The ninja configuration is flexible enough to support QCC, so there is no issue within ninja itself.
The current CMake ninja-generator code trims all spaces from the ends of lines at the time of writing the ninja script within the cmGlobalNinjaGenerator::WriteVariable function (called from cmGlobalNinjaGenerator::WriteBuild). I see that this is required when writing some ninja variables elsewhere. I would like a workaround be implemented for just the "LINK_LIBRARIES" variable to not be trimmed at this point. By default the link libraries go to the end of the response file as generated by ninja, and if a space is added to the end of this variable within build.ninja, the linking succeeds. Without writing that space to build.ninja, the linking fails as above.
I'm capable of creating a fix within the CMake executable, testing it and contributing it back if needed, but right now I cannot think of a solution that would be acceptable.https://gitlab.kitware.com/cmake/cmake/-/issues/17126Error: target_compile_features no known features for CXX compiler for QNX QCC...2019-02-27T07:10:14-05:00Kevin FunkError: target_compile_features no known features for CXX compiler for QNX QCC compilertarget_compile_features does not support the QNX QCC compiler:
```
# enter QNX env
source /opt/qnx660/qnx660-env.sh
# attempt to build CMake test project (attached to this ticket)
rm tmp/build/* -rf; cmake -DCMAKE_TOOLCHAIN_FILE=../Too...target_compile_features does not support the QNX QCC compiler:
```
# enter QNX env
source /opt/qnx660/qnx660-env.sh
# attempt to build CMake test project (attached to this ticket)
rm tmp/build/* -rf; cmake -DCMAKE_TOOLCHAIN_FILE=../Toolchain-QNX660-armv7.cmake ..; make -j1 VERBOSE=1
-- The CXX compiler identification is QCC 4.7.3
-- Check for working CXX compiler: /opt/qnx660/host/linux/x86/usr/bin/qcc
-- Check for working CXX compiler: /opt/qnx660/host/linux/x86/usr/bin/qcc -- works
-- Detecting CXX compiler ABI info
-- Detecting CXX compiler ABI info - done
CMake Error at CMakeLists.txt:5 (target_compile_features):
target_compile_features no known features for CXX compiler
"QCC"
version 4.7.3.
```
Setting `cmake_policy(SET CMP0047 OLD)` does not help either:
```
...
CMake Error at CMakeLists.txt:5 (target_compile_features):
target_compile_features no known features for CXX compiler
"GNU"
version 4.7.3.
```
Attachments:
[Toolchain-QNX660-armv7.cmake](/uploads/a179382a1e5ef53cb521af14253e1df0/Toolchain-QNX660-armv7.cmake)
[CMakeLists.txt](/uploads/97970e82ce732dc037b7e6c5bb056a62/CMakeLists.txt)
[main.cpp](/uploads/c688fcd61dc9df639bb4fa5dd87bee96/main.cpp)https://gitlab.kitware.com/cmake/cmake/-/issues/16965CMake no longer compiles on QNX 6.52017-06-16T09:04:47-04:00Jörg RiesmeierCMake no longer compiles on QNX 6.5I just tried to compile CMake 3.8.2 (and since that did not work also CMake 3.7.2) on QNX 6.5. I thought that QNX is one of the supported platforms, but I experienced various errors, e.g. somewhere in the "cmjsoncpp" code. The [build log...I just tried to compile CMake 3.8.2 (and since that did not work also CMake 3.7.2) on QNX 6.5. I thought that QNX is one of the supported platforms, but I experienced various errors, e.g. somewhere in the "cmjsoncpp" code. The [build log](/uploads/1aa748bc729710de8f409afdf3653db3/cmake-3.8.2_build.log) (output of "make -i") is attached.