Skip to content

Conversation

@mgorny
Copy link
Member

@mgorny mgorny commented Sep 10, 2025

Per the logic in top-level CMakeLists, libomptarget is placed into LLVM_LIBRARY_OUTPUT_INTDIR when this variable is set. Adjust the test logic to include this directory in -L and -Wl,-rpath arguments as well, in order to fix finding tests when building via the runtimes top-level directory.

Per the logic in top-level CMakeLists, `libomptarget` is placed
into `LLVM_LIBRARY_OUTPUT_INTDIR` when this variable is set.  Adjust
the test logic to include this directory in `-L` and `-Wl,-rpath`
arguments as well, in order to fix finding tests when building
via the `runtimes` top-level directory.

Signed-off-by: Michał Górny <[email protected]>
@mgorny
Copy link
Member Author

mgorny commented Sep 10, 2025

@jhuber6, this hopefully is the last piece of the puzzle.

@llvmbot
Copy link
Member

llvmbot commented Sep 10, 2025

@llvm/pr-subscribers-offload

Author: Michał Górny (mgorny)

Changes

Per the logic in top-level CMakeLists, libomptarget is placed into LLVM_LIBRARY_OUTPUT_INTDIR when this variable is set. Adjust the test logic to include this directory in -L and -Wl,-rpath arguments as well, in order to fix finding tests when building via the runtimes top-level directory.


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

1 Files Affected:

  • (modified) offload/test/lit.cfg (+2)
diff --git a/offload/test/lit.cfg b/offload/test/lit.cfg
index a41bcb9c0d064..c0290bfdab3ff 100644
--- a/offload/test/lit.cfg
+++ b/offload/test/lit.cfg
@@ -83,6 +83,7 @@ config.test_format = lit.formats.ShTest()
 config.test_flags = " -I " + config.test_source_root + \
     " -I " + config.omp_header_directory + \
     " -L " + config.library_dir + \
+    " -L " + config.llvm_library_intdir + \
     " -L " + config.llvm_lib_directory
 
 # compiler specific flags
@@ -165,6 +166,7 @@ else: # Unices
         config.test_flags += " -nogpulib"
     config.test_flags += " -Wl,-rpath," + config.library_dir
     config.test_flags += " -Wl,-rpath," + config.omp_host_rtl_directory
+    config.test_flags += " -Wl,-rpath," + config.llvm_library_intdir
     config.test_flags += " -Wl,-rpath," + config.llvm_lib_directory
     if config.cuda_libdir:
         config.test_flags += " -Wl,-rpath," + config.cuda_libdir

@mgorny
Copy link
Member Author

mgorny commented Sep 10, 2025

Thanks!

@mgorny mgorny merged commit 312b561 into llvm:main Sep 10, 2025
11 checks passed
@mgorny mgorny deleted the offload-test-path branch September 10, 2025 14:32
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