From 0444226b7ed875613df6e678c04615e763e0fabe Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Wed, 23 Apr 2025 13:15:56 -0500 Subject: [PATCH 1/2] [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}) From 48e83f612729bd63e4a3b7b814fe75d8a4018e94 Mon Sep 17 00:00:00 2001 From: Joseph Huber Date: Thu, 24 Apr 2025 07:23:52 -0500 Subject: [PATCH 2/2] Update llvm/runtimes/CMakeLists.txt Co-authored-by: Michael Kruse --- llvm/runtimes/CMakeLists.txt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt index 83621cbf47939..6bfc9dd0aaf14 100644 --- a/llvm/runtimes/CMakeLists.txt +++ b/llvm/runtimes/CMakeLists.txt @@ -320,7 +320,7 @@ 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. + # We need the target 'libomp-mod' to run flang OpenMP tests. if(${runtime_name} STREQUAL "openmp") list(APPEND ${name}_extra_targets "libomp-mod") endif()