Skip to content

[Offload] Find libc relative to DeviceRTL path #118497

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
Dec 3, 2024

Conversation

jplehr
Copy link
Contributor

@jplehr jplehr commented Dec 3, 2024

This was discussed as a potential solution in #118173

@jplehr jplehr requested review from mgorny and jhuber6 December 3, 2024 15:22
@llvmbot llvmbot added the offload label Dec 3, 2024
@llvmbot
Copy link
Member

llvmbot commented Dec 3, 2024

@llvm/pr-subscribers-offload

Author: Jan Patrick Lehr (jplehr)

Changes

This was discussed as a potential solution in #118173


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

1 Files Affected:

  • (modified) offload/DeviceRTL/CMakeLists.txt (+2-2)
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}
     )

Copy link
Member

@mgorny mgorny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. This solves the problem for me.

@jplehr jplehr merged commit c7babfa into llvm:main Dec 3, 2024
8 checks passed
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.

4 participants