Skip to content

[libc] Update install directory for offloading versions of libraries #83592

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Mar 1, 2024

Conversation

jhuber6
Copy link
Contributor

@jhuber6 jhuber6 commented Mar 1, 2024

Summary:
These currently go to lib/, but if the user has lib/<triple> they
should go there because it's always searched first.

Summary:
These currently go to `lib/`, but if the user has `lib/<triple>` they
should go there because it's always searched first.
@llvmbot
Copy link
Member

llvmbot commented Mar 1, 2024

@llvm/pr-subscribers-libc

Author: Joseph Huber (jhuber6)

Changes

Summary:
These currently go to lib/, but if the user has lib/&lt;triple&gt; they
should go there because it's always searched first.


Full diff: https://github.com/llvm/llvm-project/pull/83592.diff

2 Files Affected:

  • (modified) libc/CMakeLists.txt (+1-1)
  • (modified) libc/lib/CMakeLists.txt (+5-1)
diff --git a/libc/CMakeLists.txt b/libc/CMakeLists.txt
index 75fcc91757b807..7c7322e3043393 100644
--- a/libc/CMakeLists.txt
+++ b/libc/CMakeLists.txt
@@ -232,7 +232,7 @@ else()
     set(LIBC_LIBRARY_DIR ${CMAKE_BINARY_DIR}/lib${LLVM_LIBDIR_SUFFIX})
   endif()
   if(LIBC_TARGET_OS_IS_GPU)
-    set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LLVM_DEFAULT_TARGET_TRIPLE})
+    set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR}/${LIBC_TARGET_TRIPLE})
   else()
     set(LIBC_INSTALL_INCLUDE_DIR ${CMAKE_INSTALL_INCLUDEDIR})
   endif()
diff --git a/libc/lib/CMakeLists.txt b/libc/lib/CMakeLists.txt
index e5ebd1e10084d7..37acf3950b4602 100644
--- a/libc/lib/CMakeLists.txt
+++ b/libc/lib/CMakeLists.txt
@@ -77,9 +77,13 @@ install(
 )
 
 if(LIBC_TARGET_OS_IS_GPU)
+  set(gpu_install_dir lib${LLVM_LIBDIR_SUFFIX})
+  if(LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
+    set(gpu_install_dir lib${LLVM_LIBDIR_SUFFIX}/${LLVM_HOST_TRIPLE})
+  endif()
   install(
     TARGETS ${added_gpu_archive_targets}
-    ARCHIVE DESTINATION lib${LLVM_LIBDIR_SUFFIX}
+    ARCHIVE DESTINATION ${gpu_install_dir}
     COMPONENT libc
   )
   foreach(file ${added_gpu_bitcode_targets})

@jhuber6 jhuber6 merged commit 18d0d9b into llvm:main Mar 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants