Skip to content

Cannot build native clang-tidy-confusable-chars-gen when cross-compiling standalone clang #160530

@rossburton

Description

@rossburton

In the situation where you're cross-compiling clang standalone (that is, from inside clang/ against an existing llvm) the build doesn't know that it needs to build clang-tidy-confusable-chars-gen natively and instead builds it for the target and then fails when it tried to run the target binary.

I chased that down to LLVM_USE_HOST_TOOLS not actually being set outside of the top-level llvm/CMakeLists.txt, so a standalone clang build doesn't actually have that set.

If I then manually set that, it fails to find get_native_tool_path, which is easily solved by adding include(CrossCompile) to the standalone case in clang/CMakeLists.txt.

But now it's failing with:

ninja: error: 'tools/extra/clang-tidy/misc/CONFIGURE_Clang_NATIVE', needed by '/bin/clang-tidy-confusable-chars-gen', missing and no known rule to make it

This I can't seem to figure out. A top-level cross-compile of clang certainly does do the right thing though, so this should be possible to make work.

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