guix_mirror_bot pushed a commit to branch master
in repository guix.

commit 46716f0dbaae984c67609641e8e422b3367ffb4a
Author: Sergio Pastor Pérez <[email protected]>
AuthorDate: Fri Jun 5 16:13:02 2026 +0200

    gnu: rocm-hipcc: Allow other packages to wrap the package binaries.
    
    * gnu/packages/llvm.scm (rocm-hipcc): Allow other packages to wrap the 
package
    binaries.
    
    Change-Id: Ie41fb7a07146c8741fb59fa25bb7ce1d687d9ae6
    Signed-off-by: Ludovic Courtès <[email protected]>
---
 gnu/packages/llvm.scm | 28 ++++++++++++++++++++--------
 1 file changed, 20 insertions(+), 8 deletions(-)

diff --git a/gnu/packages/llvm.scm b/gnu/packages/llvm.scm
index 8742abce0b..e7d9b18ea9 100644
--- a/gnu/packages/llvm.scm
+++ b/gnu/packages/llvm.scm
@@ -1619,19 +1619,31 @@ AMDGPU code objects.")
 
                      ;;(list "HIP_ROCCLR_HOME" '= (list #$rocm-hip-runtime))
 
-                     ;; HACK: allow `rocm-hip-runtime' to wrap this program
-                     ;; with its own `HIP_PATH'.
+                     ;; HACK: allow other packages (eg: `rocm-hip-runtime' or
+                     ;; `rocm-toolchain') to wrap this program with its own
+                     ;; paths.
                      (list "HIP_PATH" '= (list (string-append "${HIP_PATH:-" 
#$output "}")))
+                     ;; XXX: `hipconfig' searches for `llc' which is provided
+                     ;; by `llvm-rocm', we cannot wrap that here since it
+                     ;; searches it from the `HIP_CLANG_PATH'.  At this level
+                     ;; we don't have the complete `rocm-toolchain' which will
+                     ;; have the union of `llvm-rocm' and `clang-rocm', the
+                     ;; contents of both derivation outputs are expected to
+                     ;; live under `HIP_CLANG_PATH'.
                      (list "HIP_CLANG_PATH"
                            '=
-                           (list (string-append
-                                  #$(this-package-input "clang-rocm")
-                                  "/bin")))
+                           (list
+                            (string-append "${HIP_CLANG_PATH:-"
+                                           #$(file-append (this-package-input 
"clang-rocm")
+                                                          "/bin")
+                                           "}")))
                      (list "DEVICE_LIB_PATH"
                            '=
-                           (list (string-append
-                                  #$(this-package-input "rocm-device-libs")
-                                  "/amdgcn/bitcode")))
+                           (list
+                            (string-append "${DEVICE_LIB_PATH:-"
+                                           #$(file-append (this-package-input 
"rocm-device-libs")
+                                                          "/amdgcn/bitcode")
+                                           "}")))
 
                      ;; This is done in order to please check_config, which
                      ;; checks that HSA_PATH is in LD_LIBRARY_PATH

Reply via email to