[llvm] [Offload] Find libc relative to DeviceRTL path (PR #118497)

Jan Patrick Lehr via llvm-commits llvm-commits at lists.llvm.org
Tue Dec 3 07:22:20 PST 2024


https://github.com/jplehr created https://github.com/llvm/llvm-project/pull/118497

This was discussed as a potential solution in https://github.com/llvm/llvm-project/pull/118173

>From 0cd06554f398a7846f53dd57cea4d61cad0d79bb Mon Sep 17 00:00:00 2001
From: JP Lehr <JanPatrick.Lehr at amd.com>
Date: Tue, 3 Dec 2024 09:19:19 -0600
Subject: [PATCH] [Offload] Find libc relative to DeviceRTL path

---
 offload/DeviceRTL/CMakeLists.txt | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/offload/DeviceRTL/CMakeLists.txt b/offload/DeviceRTL/CMakeLists.txt
index 3da83e5c307132..b52305b9516fb1 100644
--- a/offload/DeviceRTL/CMakeLists.txt
+++ b/offload/DeviceRTL/CMakeLists.txt
@@ -131,7 +131,7 @@ set(bc_flags -c -foffload-lto -std=c++17 -fvisibility=hidden
              -DOMPTARGET_DEVICE_RUNTIME
              -I${include_directory}
              -I${devicertl_base_directory}/../include
-             -I${LLVM_MAIN_SRC_DIR}/../libc
+             -I${devicertl_base_directory}/../../libc
              ${LIBOMPTARGET_LLVM_INCLUDE_DIRS_DEVICERTL}
 )
 
@@ -276,7 +276,7 @@ function(compileDeviceRTLLibrary target_cpu target_name target_triple)
     target_compile_definitions(${ide_target_name} PRIVATE SHARED_SCRATCHPAD_SIZE=512)
     target_include_directories(${ide_target_name} PRIVATE
       ${include_directory}
-      ${LLVM_MAIN_SRC_DIR}/../libc
+      ${devicertl_base_directory}/../../libc
       ${devicertl_base_directory}/../include
       ${LIBOMPTARGET_LLVM_INCLUDE_DIRS}
     )



More information about the llvm-commits mailing list