Unknown_target warning

Hi, I’m using SonarCloud on my C project with GitLab CI.

I get these warnings about an unknown target

WARN: /builds/origem1/origem-fw/fw_orangoh/src/appConfig.c: with target "xtensa-esp32-elf": unknown target, using "x86_64-unknown-unknown" instead

I saw this post on the forum about the same situation, but the fix was a workaround made my the dev. Since the post was from 2021 I was wandering if there’s an official fix with a better solution

Hi @murilo_origem ,

the alternative is to build your project with a target that is supported by the Clang compiler, as we use the Clang frontend as the core of our analyzer.

Are you using platformio GCC Toolchain for Espressif ESP32 Xtensa MCUs?

Yes, but we are using a locked version

platform = https://github.com/platformio/platform-espressif32.git#v5.0.0

Here are the packages that we use, maybe they’re of some help

Resolving OrangOH_V0 dependencies...
Platform espressif32 @ 5.0.0+sha.db03cfd (required: git+https://github.com/platformio/platform-espressif32.git#v5.0.0)
├── framework-espidf @ 3.40401.0 (required: platformio/framework-espidf @ ~3.40401.0)
├── tool-cmake @ 3.16.4 (required: platformio/tool-cmake @ ~3.16.0)
├── tool-esptoolpy @ 1.30300.0 (required: platformio/tool-esptoolpy @ ~1.30300.0)
├── tool-mkfatfs @ 2.0.1 (required: platformio/tool-mkfatfs @ ~2.0.0)
├── tool-mklittlefs @ 1.203.210628 (required: platformio/tool-mklittlefs @ ~1.203.0)
├── tool-mkspiffs @ 2.230.0 (required: platformio/tool-mkspiffs @ ~2.230.0)
├── tool-ninja @ 1.7.1 (required: platformio/tool-ninja @ ^1.7.0)
├── toolchain-esp32ulp @ 1.22851.191205 (required: platformio/toolchain-esp32ulp @ ~1.22851.0)
└── toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3 (required: espressif/toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3)


Resolving native dependencies...
Platform native @ 1.2.1 (required: native)
├── contrib-piohome @ 3.4.4 (required: platformio/contrib-piohome)
├── framework-arduinoststm8 @ 0.50.210317 (required: platformio/framework-arduinoststm8)
├── framework-espidf @ 3.40402.0 (required: platformio/framework-espidf)
├── framework-espidf @ 3.40401.0 (required: platformio/framework-espidf)
├── framework-mbed @ 6.51401.200622+sha.811a3e7f (required: git+https://github.com/Origem-Motos/mbed-os-platformio#6.51401.0)
├── framework-stm32cubeg0 @ 1.3.0 (required: platformio/framework-stm32cubeg0)
├── tool-cmake @ 3.16.4 (required: platformio/tool-cmake)
├── tool-dfuutil @ 1.9.200310 (required: platformio/tool-dfuutil)
├── tool-esptoolpy @ 1.40201.0 (required: platformio/tool-esptoolpy)
├── tool-esptoolpy @ 1.30300.0 (required: platformio/tool-esptoolpy)
├── tool-ldscripts-ststm32 @ 0.1.0 (required: platformio/tool-ldscripts-ststm32)
├── tool-mkfatfs @ 2.0.1 (required: platformio/tool-mkfatfs)
├── tool-mklittlefs @ 1.203.210628 (required: platformio/tool-mklittlefs)
├── tool-mkspiffs @ 2.230.0 (required: platformio/tool-mkspiffs)
├── tool-ninja @ 1.7.1 (required: platformio/tool-ninja)
├── tool-openocd @ 2.1000.200630 (required: platformio/tool-openocd)
├── tool-scons @ 4.40502.0 (required: platformio/tool-scons)
├── tool-stm32duino @ 1.0.1 (required: platformio/tool-stm32duino)
├── tool-stm8binutils @ 0.230.0 (required: platformio/tool-stm8binutils)
├── toolchain-esp32ulp @ 1.22851.191205 (required: platformio/toolchain-esp32ulp)
├── toolchain-gccarmnoneeabi @ 1.90201.191206 (required: platformio/toolchain-gccarmnoneeabi)
├── toolchain-gccarmnoneeabi @ 1.70201.0 (required: platformio/toolchain-gccarmnoneeabi)
├── toolchain-sdcc @ 1.30901.11242 (required: platformio/toolchain-sdcc)
└── toolchain-xtensa-esp32 @ 8.4.0+2021r2-patch3 (required: espressif/toolchain-xtensa-esp32)

@murilo_origem would it be possible to use any other compiler supported by our analyzer?

Unfortunately no

@murilo_origem That is only a warning, that means that for some rules looking at types size, you may get some false positives on your context because we default to x86_64-unknown-unknown architecture.
Are you getting many false positives?

Hi @murilo_origem ,

any update?

Hello! Sorry for the late response,

We’re not getting many false positives. I wasn’t able to look at all code smells, but bugs and vulnerabilities seems fine.

Btw, is there a way to subscribe to the list of supported compilers? So that we’d know when/if the compiler we use becomes supported

Thank you for your help!

Hi @murilo_origem ,

I created a ticket to track it, I think we can easily map the unrecognized target: [CPP-4482] - Jira.

Awesome! Thanks!