Skip to content

fix: include spirv platform in clang branch of run_hipcc.cmake#13

Merged
pvelesko merged 1 commit into
chipStar-hip-7from
fix-run-hipcc-spirv-platform
May 9, 2026
Merged

fix: include spirv platform in clang branch of run_hipcc.cmake#13
pvelesko merged 1 commit into
chipStar-hip-7from
fix-run-hipcc-spirv-platform

Conversation

@pvelesko
Copy link
Copy Markdown
Collaborator

@pvelesko pvelesko commented May 3, 2026

Summary

  • run_hipcc.cmake checked only HIP_PLATFORM == "amd" to enter the clang compiler branch; chipStar sets HIP_PLATFORM=spirv, so it fell into the else (nvcc) branch
  • For shared libraries the nvcc branch appends --shared -Xcompiler '-fPIC'; when clang receives the quoted ''-fPIC'' as a positional argument it fails: clang++: error: no such file or directory: ''-fPIC''
  • Fix: extend the condition to also match spirv

Root cause

# before
if("${HIP_PLATFORM}" STREQUAL "amd")

# after
if("${HIP_PLATFORM}" STREQUAL "amd" OR "${HIP_PLATFORM}" STREQUAL "spirv")

Reproducer

Found while building SeisSol with chipStar. SeisSol's Device submodule uses hip_add_library(... SHARED) with HIP_SOURCE_PROPERTY_FORMAT set, which routes compilation through run_hipcc.cmake. A regression test is included in the companion chipStar PR.

Test plan

  • Build a SHARED HIP library via hip_add_library() with HIP_SOURCE_PROPERTY_FORMAT on chipStar (HIP_PLATFORM=spirv) — should compile without -fPIC quoting errors
  • Existing AMD (HIP_PLATFORM=amd) and CUDA (HIP_PLATFORM=nvidia) builds unaffected

HIP_PLATFORM=spirv (chipStar) was falling into the nvcc else-branch,
which appended '--compiler-options -fPIC' for shared libraries. clang
does not understand this nvcc-specific flag syntax, causing compilation
to fail with: clang++: error: no such file or directory: ''-fPIC''
@pvelesko pvelesko merged commit 1f2e7c5 into chipStar-hip-7 May 9, 2026
0 of 4 checks passed
@pvelesko pvelesko deleted the fix-run-hipcc-spirv-platform branch May 9, 2026 08:42
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.

1 participant