[Qt-creator] Problem with clang code model when cross-compiling with clang

Christian Gagneraud chgans at gmail.com
Fri Jun 28 01:42:42 CEST 2019

Hi there,

QtCreator v4.9.1, from online installer.
x86_64 Ubuntu 18.04
clang-8 from https://apt.llvm.org
target: armv7a-custom-linux (g++-5.3.0)

As an experiment, i'm currently cross-compiling our project with clang-8.
Since then, the clang-code model is broken.
I've noticed these asserts and error messages:
"The command \"/usr/bin/clang++-8\" terminated with exit code 1."
SOFT ASSERT: "false && "__cplusplus is not predefined, assuming latest
C++ we support."" in file
line 327

Followed by a few of these (that we've always had, so here for the
sake of completeness)
C++ Indexer: Skipping file "..." because it is too big.

And Finally:
Parsing /current/source/file/in/editor.cpp failed: CXError_Failure
Reparsing /current/source/file/in/editor.cpp failed: 3

And the whole code model is broken (no completion, type hierarchy,
file/class outline, symbol lookup, etc...)

I'm using cmake, with a custom (but simple) toolchain file. And i can
cross build our project (from command line and fromQtC), and run the
exe on the target.

For QtCreator i had to do one "special" things.
Since clang is multi target, the compiler is auto detected as x86_64,
so i had to select the "<custom>" ABI, and set it to
I then cloned the original kit (a gcc-5 cross kit), and simply change
the compiler settings and the toolchain file.

The cmake toolchain file doesn't do anything fancy apart from setting
cmake sets clang's -target and --sysroot, which works out of the box.
I do not need to do crazy things with include/lib search path.
The only trick in there is forcing the linker, since it defaults to
/usr/bin/ld, and ld is not clever enough to pick up our cross env, so
i ended up adding "-luse-ld=lld-8"  which is "sysroot aware"
I can build an hello world with just
clang++-8 -target arm-navico-linux-gnueabi -march=armv7-a
--sysroot=$SYSROOT test.cpp

Point is: this toolchain is valid and functional.

For the sake of completeness i have (and had for a while) these other
soft asserts:
SOFT ASSERT: "type == "INTERNAL" || type == "UNINITIALIZED"" in file
line 153

Any idea what is going on? Is it a problem with my setup, is this
setup supported by QtCreator? any special log domain i could enable to
troubleshoot that?


More information about the Qt-creator mailing list