Skip to content

[cmake] Fix host tool path with driver build on Windows#199152

Open
rnk wants to merge 1 commit into
llvm:mainfrom
rnk:llvm-driver-win-host-tool
Open

[cmake] Fix host tool path with driver build on Windows#199152
rnk wants to merge 1 commit into
llvm:mainfrom
rnk:llvm-driver-win-host-tool

Conversation

@rnk
Copy link
Copy Markdown
Contributor

@rnk rnk commented May 22, 2026

On Windows, the llvm-shlib dylib build uses the llvm-nm host tool to
make all symbols visible by default. The LLVM_TOOL_LLVM_DRIVER_BUILD=ON
build would fail because $<TARGET_FILE:llvm-nm> was invalid. This change
passes the name of the symlink / executable copy as a custom property so
things work out and the llvm-nm.exe host tool can be found.

On Windows, the llvm-shlib dylib build uses the llvm-nm host tool to
make all symbols visible by default. The LLVM_TOOL_LLVM_DRIVER_BUILD=ON
build would fail because $<TARGET_FILE:llvm-nm> was invalid. This change
passes the name of the symlink / executable copy as a custom property so
things work out and the llvm-nm.exe host tool can be found.
@llvmorg-github-actions llvmorg-github-actions Bot added the cmake Build system in general and CMake in particular label May 22, 2026
@rnk rnk requested review from Prince781, antoniofrighetto, matts1 and petrhosek and removed request for petrhosek May 22, 2026 02:31
@github-actions
Copy link
Copy Markdown

🐧 Linux x64 Test Results

The build failed before running any tests. Detailed information about the build failure could not be automatically obtained.

Download the build's log file to see the details.

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

@github-actions
Copy link
Copy Markdown

🪟 Windows x64 Test Results

The build failed before running any tests. Detailed information about the build failure could not be automatically obtained.

Download the build's log file to see the details.

If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the infrastructure label.

@matts1 matts1 removed their request for review May 22, 2026 03:27
@matts1
Copy link
Copy Markdown
Contributor

matts1 commented May 22, 2026

Sorry, I'm not the right person to review this

@rnk rnk requested a review from ilovepi May 22, 2026 21:27
@ilovepi
Copy link
Copy Markdown
Contributor

ilovepi commented May 22, 2026

Hmm, looks like theres an issue in some other spots. This seems fine to me, so not too sure what the problem would be. cc: @petrhosek do you grok why this went off the rails?

 CMake Error at cmake/modules/AddLLVM.cmake:2801 (get_target_property):
    get_target_property() called with non-existent target
    "clang-tidy-confusable-chars-gen".
  Call Stack (most recent call first):
    cmake/modules/AddLLVM.cmake:2815 (get_host_tool_path)
    /home/gha/actions-runner/_work/llvm-project/llvm-project/clang-tools-extra/clang-tidy/misc/CMakeLists.txt:6 (setup_host_tool)

@rnk
Copy link
Copy Markdown
Contributor Author

rnk commented May 26, 2026

Hmm, looks like theres an issue in some other spots. This seems fine to me, so not too sure what the problem would be. cc: @petrhosek do you grok why this went off the rails?

Sorry, I didn't expect to get premerge errors from Linux, I guess I'll dig into that. The change was tested and drafted on Windows. I was trying to build the biggest possible llvm.exe so I could optimize LLD, and I ran into this.

Also, I think I owe Petr reviews on the governance docs, so I didn't want to bother him with trivial cmake stuff. :)

@petrhosek
Copy link
Copy Markdown
Member

Hmm, looks like theres an issue in some other spots. This seems fine to me, so not too sure what the problem would be. cc: @petrhosek do you grok why this went off the rails?

Sorry, I didn't expect to get premerge errors from Linux, I guess I'll dig into that. The change was tested and drafted on Windows. I was trying to build the biggest possible llvm.exe so I could optimize LLD, and I ran into this.

Also, I think I owe Petr reviews on the governance docs, so I didn't want to bother him with trivial cmake stuff. :)

I see two issues:

  1. clang-tidy-confusable-chars-gen is referenced before it's defined in ConfusableTable:

    setup_host_tool(clang-tidy-confusable-chars-gen CLANG_TIDY_CONFUSABLE_CHARS_GEN clang_tidy_confusable_chars_gen clang_tidy_confusable_chars_gen_target)
    add_subdirectory(ConfusableTable)

  2. clang-tidy-confusable-chars-gen is defined using add_llvm_executable rather than add_llvm_tool:

    add_llvm_executable(clang-tidy-confusable-chars-gen
    BuildConfusableTable.cpp
    )

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmake Build system in general and CMake in particular

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants