void-packages/srcpkgs/llvm19/patches/flang-cross.patch

29 lines
1.4 KiB
Diff

commit 92984acc52fb95566d9387948c2655507328438b
Author: Daniel Martinez <danielmartinez@cock.li>
Date: Wed Jul 31 21:14:52 2024 -0400
Allow flang-new binary to be specified for omp modules
This allows the path of the flang-new binary to be specified as a
cmake configuration.
This is useful when cross compiling, as flang-new may exist
on the build machine, which should be used instead of the host.
For example, by passing "-DFLANG_NEW_NATIVE_EXE=/usr/bin/flang-new",
that binary will be used instead of just built host compiler.
diff --git a/llvm/runtimes/CMakeLists.txt b/llvm/runtimes/CMakeLists.txt
index 42b1b86ebaad..41921aaeaeb2 100644
--- a/llvm/runtimes/CMakeLists.txt
+++ b/llvm/runtimes/CMakeLists.txt
@@ -498,7 +498,7 @@ if(build_runtimes)
if("openmp" IN_LIST LLVM_ENABLE_RUNTIMES)
if (${LLVM_TOOL_FLANG_BUILD})
message(STATUS "Configuring build of omp_lib.mod and omp_lib_kinds.mod via flang-new")
- set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang-new")
+ set(LIBOMP_FORTRAN_MODULES_COMPILER "${CMAKE_BINARY_DIR}/bin/flang-new" CACHE INTERNAL "")
set(LIBOMP_MODULES_INSTALL_PATH "${CMAKE_INSTALL_INCLUDEDIR}/flang")
# TODO: This is a workaround until flang becomes a first-class project
# in llvm/CMakeList.txt. Until then, this line ensures that flang-new is