Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions ck_build_interceptor.py
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,14 @@ def main():
# checker must go straight to the real compiler — don't route through
# _handle_link_step which may fail when there's no -o argument.
if len(argv) == 2 and argv[1] in ("-v", "-V", "--version", "--help"):
# In CXX role (not hipcc), CK_JIT_CXX may be hipcc captured from the

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

The code here is identical to run_real_compiler except using CK_JIT_CXX env, so it is better add optional argument to run_real_compiler(argv, version_check=False) that will skip env for version_check.
The problem is also not in fake rocm PATH but it is a bug in ROCm clang++: /opt/rocm/llvm/bin/clang++ -v fails w/o CK_JIT as well. It is seen with ROCm 7.2.3 but seems fixed in ROCm 7.13

# outer build env. hipcc requires a real ROCM_PATH, but we've set
# ROCM_PATH to a fake directory, so "hipcc -v" fails. Use the system
# C++ compiler directly for version probes; it always succeeds and
# gives AITER's ABI checker a usable answer.
if os.path.basename(argv[0]) not in {"hipcc", "ck_build_interceptor.py"}:
compiler = _find_cxx()
return subprocess.run([compiler] + argv[1:], check=False).returncode
return run_real_compiler(argv)

source, output = parse_compile_command(argv)
Expand Down