How to get rid of `unknown target` warning


I get warnings about unknown target:

WARN: /__w/OpenBikeSensorFirmware/OpenBikeSensorFirmware/src/utils/streams.cpp: unknown target "xtensa-esp32-elf", using "x86_64-unknown-unknown" instead
ERROR: unknown target triple 'xtensa-esp32-unknown-elf', please use -triple or -arch

Is there a way to get rid of this, or point to a better matching arch than “x86_64”?

Analysis is at ff.


Hi @Andreas_Mandel,

no, currently there is no way to get rid of this nor to match it to a different arch. The only way to match it to another arch is to build for another arch.

That message doesn’t mean that files are not analyzed, however some rules related to size of types may raise some false positives.

Hi Massimo,
thanks for the details. Is there a list of supported architectures? I’m not sure if, and how I can build with different target - but I will check.

There are some wired false positives and I thought they might be related. Like where a used variable is flagged as unused or uninitialized

Kind regards, Andreas.

Hi @Andreas_Mandel,

sorry for the delay.

as we are based on Clang we support Clang supported architectures.

Maybe but not sure it is the cause.

If you want you could try to set sonar.verbose=true property to enable debug logging during analysis and see if some errors occurs during analysis.

Hi @mpaladin,
thanks for the feedback - no hurry. Thanks for your support!

I’ve added the the verbose option and it showed that some include files from external libraries had not been found. It was due to the sed modifications in the build-wrapper-dump.json. Now I do

sed -i 's|OpenBikeSensorFirmware/bin|OpenBikeSensorFirmware|g' \
sed -i 's|\.pio/|bin/.pio/|g' \

and the header file is found - at least there are no complaints any more in the verbose log. And the strange false positives vanished. :tada:

I also tried to replace xtensa-esp32-elf with le32-unknown-nacl in the build-wrapper-dump.json but with no luck - I assume the target arch is not detected via information from the build-wrapper-dump.json?

Kind regards, Andreas.

Hi @Andreas_Mandel,


We take the target from the gcc you are using, when you run the gcc compiler you are using with -v option you can see in the output something like:

Target: x86_64-apple-darwin19

We take the architecture from there.

Hi Massimo,

thanks again for the details. Easy would be to be able to set the arch via property. :wink:

Based on your input, I’ve created a fake c++ that calls the original compiler but modifies the output of the Target to le32-unknown-nacl. The script is here and the sed line that causes SQ to use the fake-cc as compiler is:

# replace gcc with our script that reports the fake arch "le32-unknown-nacl"
sed -i "s|/github/home/.platformio/packages/toolchain-xtensa32/bin/xtensa-esp32-elf-g..|`pwd`/.github/fake-cc|g" \

All can be found in out GitHub action at

Kind regards,

Hi @Andreas_Mandel,

it is not easy to choose what should be configurable by property and at the same time avoid misuse of the product.

Not ideal workaround but I can understand, did you get the intended result?

Yes it helped. Warnings are gone, results look, like the size of the types is now detected correctly.
There is now one complaint remaining in the logs, about one file missing: stdbool.h. I can not find it either - it seems all OK anyway.

Kind regards, Andreas.

Ok, thank you for the update.