Skip to content

[hipcc] Add HIP_CLANG_LAUNCHER for launching Clang through a wrapper executable#1490

Merged
lamb-j merged 1 commit intoROCm:amd-stagingfrom
GZGavinZhao:gzgz/hipcc-hip-clang-launcher
Mar 4, 2026
Merged

[hipcc] Add HIP_CLANG_LAUNCHER for launching Clang through a wrapper executable#1490
lamb-j merged 1 commit intoROCm:amd-stagingfrom
GZGavinZhao:gzgz/hipcc-hip-clang-launcher

Conversation

@GZGavinZhao
Copy link

Fixes #72. Originally #14. Moved from ROCm/HIPCC#148.

This allows Clang to be called through a compiler wrapper/launcher. This is most commonly used to run clang through a compiler launcher that can cache compilations, such as ccache and sccache, to allow caching of compilation artifacts.

@github-actions
Copy link

Thank you for submitting a Pull Request (PR) to the LLVM Project!

This PR will be automatically labeled and the relevant teams will be notified.

If you wish to, you can add reviewers by using the "Reviewers" section on this page.

If this is not working for you, it is probably because you do not have write permissions for the repository. In which case you can instead tag reviewers by name in a comment by using @ followed by their GitHub username.

If you have received no comments on your PR for a week, you can request a review by "ping"ing the PR by adding a comment “Ping”. The common courtesy "ping" rate is once a week. Please remember that you are asking for valuable time from other developers.

If you have further questions, they may be answered by the LLVM GitHub User Guide.

You can also ask questions in a comment on this PR, on the LLVM Discord or on the forums.

@z1-cciauto
Copy link
Collaborator

@lamb-j
Copy link
Collaborator

lamb-j commented Feb 20, 2026

This seems fine to me. To check my understanding, when using hipcc we're adding the capability to automatically prepend strings to the generated clang command via an environment variable?

One major caveat: hipcc as a clang wrapper is being sunset. Moving forward, we'd like users to use clang/amdclang directly, and eventually we'd like to remove hipcc (or replace it with a symlink to clang).

That could simplify things like this, where you could just alias clang or something similar instead of using this launcher mechanism.

I'm still fine with this landing in the meantime, but will leave final approval to @david-salinas

@david-salinas
Copy link

This seems fine to me. To check my understanding, when using hipcc we're adding the capability to automatically prepend strings to the generated clang command via an environment variable?

One major caveat: hipcc as a clang wrapper is being sunset. Moving forward, we'd like users to use clang/amdclang directly, and eventually we'd like to remove hipcc (or replace it with a symlink to clang).

That could simplify things like this, where you could just alias clang or something similar instead of using this launcher mechanism.

I'm still fine with this landing in the meantime, but will leave final approval to @david-salinas

There are env vars HIPCC_COMPILE_FLAGS_APPEND and HIPCC_LINK_FLAGS_APPEND, but those just add flags/args to the clang invocation. This env var would prepend it to the clang command.

I'm also fine with this change, but there are other ways to accomplish the same thing: change the HIPCC command in your cmake file, or creating a command alias in your environment. We are deprecating hipcc in favour of amdclang (in a future release), so eventually you will need to use one of the other mechanisms anyway when hipcc is removed.

Copy link

@david-salinas david-salinas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

@GZGavinZhao
Copy link
Author

eventually you will need to use one of the other mechanisms anyway when hipcc is removed.

Yep,for these situations, we have CMAKE_CXX_COMPILER_LAUNCHER and CMAKE_HIP_COMPILER_LAUNCHER that are used when the compiler is amdclang. This PR is solely for legacy projects that still need to rely on hipcc.

@lamb-j lamb-j merged commit 97275e5 into ROCm:amd-staging Mar 4, 2026
36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Feature]: Support executing Clang through a wrapper/launcher for caching

4 participants