Skip to content

[clang-tidy] Errors on cross-compilation flags #101185

@tq-steina

Description

@tq-steina

When using clang-tidy while cross-compiling, e.g. arm-none-eabi-gcc (ARM toolchain arm-gnu-toolchain-12.2.rel1-x86_64-arm-none-eabi for ARMv7) clangy-tidy errors out on unsupported (target-specific) compiler-flags. I was able to bisect it to commit fbea5aa.

Apparently cross-compilation flags, e.g. -mcpu are validated against host-toolchain of clang-tidy

commit fbea5aa

error: unsupported option '-mcpu=' for target 'x86_64-unknown-linux-gnu' [clang-diagnostic-error]

commit a2a5144

warning: argument unused during compilation: '-mcpu=cortex-m7' [clang-diagnostic-unused-command-line-argument]

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions