[llvm] [Flang-rt] Forward `libomp-mod` dependency for non-default runtime builds (PR #137035)
Joseph Huber via llvm-commits
llvm-commits at lists.llvm.org
Wed Apr 23 11:18:34 PDT 2025
https://github.com/jhuber6 created https://github.com/llvm/llvm-project/pull/137035
Summary:
Currently this is required to inject the dependnecy so the object is
built when targeting OpenMP. This was only applied to the
`runtime_register_default_target` which only applies to
`LLVM_ENABLE_RUNTIMES`. The user could concievably do cross-compiling,
or just manually specify the host architecture and it would then error.
>From 0444226b7ed875613df6e678c04615e763e0fabe Mon Sep 17 00:00:00 2001
From: Joseph Huber <huberjn at outlook.com>
Date: Wed, 23 Apr 2025 13:15:56 -0500
Subject: [PATCH] [Flang-rt] Forward `libomp-mod` dependency for non-default
runtime builds
Summary:
Currently this is required to inject the dependnecy so the object is
built when targeting OpenMP. This was only applied to the
`runtime_register_default_target` which only applies to
`LLVM_ENABLE_RUNTIMES`. The user could concievably do cross-compiling,
or just manually specify the host architecture and it would then error.
---
llvm/runtimes/CMakeLists.txt | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 51433d1ec9831..83621cbf47939 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -320,6 +320,10 @@ function(runtime_register_target name)
set(install-${runtime_name}-${name} install-${runtime_name})
set(install-${runtime_name}-${name}-stripped install-${runtime_name}-stripped)
list(APPEND ${name}_extra_targets ${runtime_name}-${name} install-${runtime_name}-${name} install-${runtime_name}-${name}-stripped)
+ # We need the target 'libomp-mod' to run flang-rt OpenMP tests.
+ if(${runtime_name} STREQUAL "openmp")
+ list(APPEND ${name}_extra_targets "libomp-mod")
+ endif()
if(LLVM_INCLUDE_TESTS)
set(check-${runtime_name}-${name} check-${runtime_name} )
list(APPEND ${name}_test_targets check-${runtime_name}-${name})
More information about the llvm-commits
mailing list