[Development] CMake && QtCreator cross-compilation for ARM fails

Kevin Kofler kevin.kofler at chello.at
Thu Dec 13 00:20:28 CET 2018


Denis Shienkov wrote:
>     Change Dir:
>     /tmp/QtCreator-iobfII/qtc-cmake-wCnOwxuI/CMakeFiles/CMakeTmp Run
>     Build
>     Command:«/mnt/data/Yocto-miatech/sdks/sysroots/cortexa9hf-neon-poky-linux-gnueabi/usr/bin/make»
>     «cmTC_afb4e/fast» /lib/ld-linux-armhf.so.3: No such file or directory

You cannot execute make from the sysroot without a binfmt handler and a
matching ld.so. See, e.g.:
https://wiki.debian.org/QemuUserEmulation
https://wiki.gentoo.org/wiki/Embedded_Handbook/General/Compiling_with_qemu_user_chroot

But you will probably want to just point CMake to a make from the build host
instead. Have you already set:
set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER)
in your CMake toolchain file? With that setting, it should not look for
executables in your sysroot, see:
https://cmake.org/cmake/help/latest/manual/cmake-toolchains.7.html#cross-compiling-for-linux

> PS: WTF? Why the Qt's management choosed the CMake's instead of QBS?

Because CMake is a widespread tool written in C++/STL (so, unlike QBS, it
does not depend on Qt, which would mean a circular dependency when building
Qt), widely packaged for GNU/Linux distributions, and with binaries for
Windows and macOS shipped by CMake upstream (Kitware) themselves. It has a
live upstream at Kitware, so Qt does not have to maintain it. And it is
already widely used in the Qt and KDE community.

QBS, on the other hand, is a custom tool, in practice only used by Qt and a
few Qt-using projects (I know the aim is to support also non-Qt projects,
but this is not really used in the wild), which requires constant
maintenance effort from the Qt project.

>  From my point of view, the CMake it is a crap...

CMake is not a "crap", it is a powerful tool, almost as easy to use as
QMake, but a lot more flexible and powerful.

> I know, that I'm not a CMake expert, but Why I need to spent a lot time
> to make the CMake working wich an unknown result,
> instead of just using QBS? Cross-compilation with QBS works
> immediatelly, but with CMake sucks!

Once you have the cross toolchain configured properly, which is a one-time
setup effort, CMake will just work, too.

        Kevin Kofler




More information about the Development mailing list