[Openmp-commits] [openmp] [openmp][arm64ec] Fix arm64x when PER_TARGET_RUNTIME_DIR=On (PR #207747)
David Truby via Openmp-commits
openmp-commits at lists.llvm.org
Mon Jul 6 07:56:33 PDT 2026
https://github.com/DavidTruby created https://github.com/llvm/llvm-project/pull/207747
This patch fixes an issue where the combination of LIBOMP_ENABLE_ARM64X and LLVM_PER_TARGET_RUNTIME_DIR=On led to only the arm64 library being installed. With this fix, the arm64ec and arm64 .lib files are both installed, and the arm64x dll is the one installed to the binary dir.
>From 6d284cc441ec3be53bbb2ad7b31066c942f9ed50 Mon Sep 17 00:00:00 2001
From: David Truby <david.truby at arm.com>
Date: Thu, 2 Jul 2026 16:00:56 +0100
Subject: [PATCH] [openmp][arm64ec] Fix arm64x when PER_TARGET_RUNTIME_DIR=On
This patch fixes an issue where the combination of LIBOMP_ENABLE_ARM64X and
LLVM_PER_TARGET_RUNTIME_DIR=On led to only the arm64 library being
installed. With this fix, the arm64ec and arm64 .lib files are both
installed, and the arm64x dll is the one installed to the binary dir.
---
openmp/runtime/cmake/arm64x.cmake | 2 +-
openmp/runtime/src/CMakeLists.txt | 5 ++++-
2 files changed, 5 insertions(+), 2 deletions(-)
diff --git a/openmp/runtime/cmake/arm64x.cmake b/openmp/runtime/cmake/arm64x.cmake
index b52ebb7f70bd4..89a7f3f95a7c6 100644
--- a/openmp/runtime/cmake/arm64x.cmake
+++ b/openmp/runtime/cmake/arm64x.cmake
@@ -11,7 +11,7 @@ set(arm64ReproDir "${LLVM_BINARY_DIR}/runtimes/repros-arm64ec")
# Don't install the runtime if we are doing an arm64ec build for arm64x.
# The hybrid arm64x runtime will get installed by the host (default) runtime build
-if (LIBOMP_ARCH STREQUAL "arm64ec")
+if (LIBOMP_ARCH STREQUAL "arm64ec" AND NOT LLVM_ENABLE_PER_TARGET_RUNTIME_DIR)
set(CMAKE_SKIP_INSTALL_RULES On)
endif()
diff --git a/openmp/runtime/src/CMakeLists.txt b/openmp/runtime/src/CMakeLists.txt
index f8b9260af8c17..42729674481e5 100644
--- a/openmp/runtime/src/CMakeLists.txt
+++ b/openmp/runtime/src/CMakeLists.txt
@@ -413,7 +413,10 @@ set_property(GLOBAL APPEND PROPERTY LLVM_EXPORTS omp)
# We want to install libomp in ${DESTDIR}/${CMAKE_INSTALL_FULL_LIBDIR}
# We want to install headers in ${DESTDIR}/${CMAKE_INSTALL_FULL_INCLUDEDIR}
if(WIN32)
- install(TARGETS omp ${export_to_llvmexports} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT openmp)
+ # Do not install arm64ec openmp library if building for arm64x; we need to only install the arm64x one.
+ if(NOT LIBOMP_ENABLE_ARM64X OR LIBOMP_ARCH STREQUAL "aarch64")
+ install(TARGETS omp ${export_to_llvmexports} RUNTIME DESTINATION "${CMAKE_INSTALL_BINDIR}" COMPONENT openmp)
+ endif()
install(TARGETS ${LIBOMP_IMP_LIB_TARGET} ARCHIVE DESTINATION "${OPENMP_INSTALL_LIBDIR}" COMPONENT openmp)
# Create aliases (regular copies) of the library for backwards compatibility
set(LIBOMP_ALIASES "libiomp5md")
More information about the Openmp-commits
mailing list