Details
-
Bug
-
Resolution: Done
-
P4: Low
-
Qt Creator 4.0.0-rc1
-
Qt Creator 4.0.0-rc1 under Ubuntu 16.04 with CMake 3.3.1 and a yocto cross compilation toolchain
Description
In case I set up a compiler toolchain for a yocto distribution with the following kit configuration:
Device Type: Generic Linux Device
Sysroot: /opt/yocto/build/tmp/sysroots/baytrail_soc
Compiler: /opt/yocto/build/tmp/sysroots/x86_64-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc
Qt version: None
CMake Tool: /usr/local/bin/cmake (points to CMake 3.3.1)
CMake Generator: CodeBlocks - Unix Makefiles
CMake Configuration:
CMAKE_CXX_COMPILER:STRING=%{Compiler:Executable}
QT_QMAKE_EXECUTABLE:STRING=%{Qt:qmakeExecutable}
The cmake check for the compiler fails when trying to link the cmake compiler test application with the following error:
Running "/usr/local/bin/cmake /home/volkerv/Repos/Software '-GCodeBlocks - Unix Makefiles' -DCMAKE_CXX_COMPILER:STRING=/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc -DQT_QMAKE_EXECUTABLE:STRING=" in /home/volkerv/Repos/Software/temp/baytrail_soc/Debug.
The C++ compiler
"/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc"
is not able to compile a simple test program.It fails with the following output:
Change Dir: /home/volkerv/Repos/Software/temp/baytrail_soc/Debug/CMakeFiles/CMakeTmp
Run Build Command:"/usr/bin/gmake" "cmTC_0e1a6/fast"
/usr/bin/gmake -f CMakeFiles/cmTC_0e1a6.dir/build.make
CMakeFiles/cmTC_0e1a6.dir/buildgmake[1]: Entering directory
'/home/volkerv/Repos/Software/temp/baytrail_soc/Debug/CMakeFiles/CMakeTmp'Building CXX object CMakeFiles/cmTC_0e1a6.dir/testCXXCompiler.cxx.o
/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc
-o CMakeFiles/cmTC_0e1a6.dir/testCXXCompiler.cxx.o -c
/home/volkerv/Repos/Software/temp/baytrail_soc/Debug/CMakeFiles/CMakeTmp/testCXXCompiler.cxxLinking CXX executable cmTC_0e1a6
/usr/local/bin/cmake -E cmake_link_script
CMakeFiles/cmTC_0e1a6.dir/link.txt --verbose=1/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/bin/x86_64-poky-linux/x86_64-poky-linux-gcc
CMakeFiles/cmTC_0e1a6.dir/testCXXCompiler.cxx.o -o cmTC_0e1a6 -rdynamic/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.3.0/ld:
cannot find crt1.o: No such file or directory/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.3.0/ld:
cannot find crti.o: No such file or directory/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.3.0/ld:
cannot find crtbegin.o: No such file or directory/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.3.0/ld:
cannot find -lgcc/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.3.0/ld:
cannot find -lgcc_s/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.3.0/ld:
cannot find -lc/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.3.0/ld:
cannot find -lgcc/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.3.0/ld:
cannot find -lgcc_s/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.3.0/ld:
cannot find crtend.o: No such file or directory/opt/yocto/build/tmp/sysroots/x86_64-linux/usr/libexec/x86_64-poky-linux/gcc/x86_64-poky-linux/5.3.0/ld:
cannot find crtn.o: No such file or directorycollect2: error: ld returned 1 exit status
CMakeFiles/cmTC_0e1a6.dir/build.make:97: recipe for target 'cmTC_0e1a6'
failed
The only way to get things working again is to add the following CMake configuration adjustments which bypassed the compiler check
CMAKE_CXX_COMPILER_WORKS:STRING=1
But this shouldn't be the solution. No idea what has to be passed to cmake to avoid that problem. Normally I adjust the compiler settings for cross compilation within my CMakeLists.txt files. That's why it worked in former Qt creator versions I guess. But normally it should be possible to let qt creator select all the stuff based on the kit configuration. If only it would pass at least the compiler check successfully
Attachments
Issue Links
- depends on
-
QTCREATORBUG-16156 CMake configuration changes are not applied to current project
- Closed
- is duplicated by
-
QTCREATORBUG-18437 Qt Creator does not pass the sysroot to CMake
- Closed
- relates to
-
QTCREATORBUG-17288 cmake projects using clang cross compilation cannot find stdlib include directories
- Closed