Skip to content

Commit feeb833

Browse files
authored
[libc] Change the GPU loaders to LLVM executables (#101442)
Summary: I am going to rework these tools to just me LLVM tools. This patch is pretty much NFC to set up the CMake for that.
1 parent 0a5e572 commit feeb833

File tree

5 files changed

+18
-9
lines changed

5 files changed

+18
-9
lines changed

libc/utils/gpu/loader/CMakeLists.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@ target_include_directories(gpu_loader PUBLIC
44
${CMAKE_CURRENT_SOURCE_DIR}
55
${LIBC_SOURCE_DIR}/include
66
${LIBC_SOURCE_DIR}
7+
${LLVM_MAIN_INCLUDE_DIR}
8+
${LLVM_BINARY_DIR}/include)
79
)
810

911
find_package(hsa-runtime64 QUIET 1.2.0 HINTS ${CMAKE_INSTALL_PREFIX} PATHS /opt/rocm)

libc/utils/gpu/loader/amdgpu/CMakeLists.txt

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,11 @@
1-
add_executable(amdhsa-loader Loader.cpp)
1+
set(LLVM_LINK_COMPONENTS
2+
BinaryFormat
3+
Object
4+
Option
5+
Support
6+
)
7+
8+
add_llvm_executable(amdhsa-loader amdhsa-loader.cpp)
29

310
target_link_libraries(amdhsa-loader
411
PRIVATE
Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,15 @@
1-
add_executable(nvptx-loader Loader.cpp)
1+
set(LLVM_LINK_COMPONENTS
2+
BinaryFormat
3+
Object
4+
Option
5+
Support
6+
)
7+
8+
add_llvm_executable(nvptx-loader nvptx-loader.cpp)
29

3-
if(NOT LLVM_ENABLE_RTTI)
4-
target_compile_options(nvptx-loader PRIVATE -fno-rtti)
5-
endif()
6-
target_include_directories(nvptx-loader PRIVATE
7-
${LLVM_MAIN_INCLUDE_DIR} ${LLVM_BINARY_DIR}/include)
810
target_link_libraries(nvptx-loader
911
PRIVATE
1012
gpu_loader
1113
llvmlibc_rpc_server
1214
CUDA::cuda_driver
13-
LLVMObject
14-
LLVMSupport
1515
)

0 commit comments

Comments
 (0)