[llvm] [Flang-RT] Make implicit PPC intrinsic uses explicit (PR #206493)

Michael Kruse via llvm-commits llvm-commits at lists.llvm.org
Mon Jun 29 06:36:49 PDT 2026


https://github.com/Meinersbur created https://github.com/llvm/llvm-project/pull/206493

The PPC-specific builtin moduls have implicit dependencies insert by flang. For CMake to correctly setup the build order, they must be made explicit.

This replicates the implicit modules uses in
https://github.com/llvm/llvm-project/blob/12b20b36737094b1c521adff0c8f58aaaf2f41fb/flang/lib/Semantics/semantics.cpp#L680-L693
in the modules themselves. The PPC-specific modules are listed here:
https://github.com/llvm/llvm-project/blob/12b20b36737094b1c521adff0c8f58aaaf2f41fb/flang-rt/lib/runtime/CMakeLists.txt#L213-L219

This should fix the intermittend build error mentioned in https://github.com/llvm/llvm-project/pull/205634#issuecomment-4829653483. Unfortunately I do not have a PowerPC (cross-)compilation build environment ready to test.

>From 1718eed7b93ca176c98238196da9dd7174dca54d Mon Sep 17 00:00:00 2001
From: Michael Kruse <llvm-project at meinersbur.de>
Date: Mon, 29 Jun 2026 15:22:04 +0200
Subject: [PATCH] [Flang-RT] Replicate PPC intrinsic dependencies

---
 flang-rt/lib/runtime/__ppc_intrinsics.f90 | 1 +
 flang-rt/lib/runtime/__ppc_types.f90      | 1 +
 flang-rt/lib/runtime/mma.f90              | 1 +
 3 files changed, 3 insertions(+)

diff --git a/flang-rt/lib/runtime/__ppc_intrinsics.f90 b/flang-rt/lib/runtime/__ppc_intrinsics.f90
index b3ff33b0619ff..ca87a673356ad 100644
--- a/flang-rt/lib/runtime/__ppc_intrinsics.f90
+++ b/flang-rt/lib/runtime/__ppc_intrinsics.f90
@@ -7,6 +7,7 @@
 !===------------------------------------------------------------------------===!
 
 module __ppc_intrinsics
+  use __fortran_builtins, __ppc_types ! implicit dependencies, made explicit for CMake
 
   private
 
diff --git a/flang-rt/lib/runtime/__ppc_types.f90 b/flang-rt/lib/runtime/__ppc_types.f90
index 7a7c7898ebf80..d98dd80182839 100644
--- a/flang-rt/lib/runtime/__ppc_types.f90
+++ b/flang-rt/lib/runtime/__ppc_types.f90
@@ -7,6 +7,7 @@
 !===------------------------------------------------------------------------===!
 
 module __ppc_types
+  use __fortran_builtins ! implicit dependency, made explicit for CMake
   implicit none
 
   ! Set PRIVATE by default to explicitly only export what is meant
diff --git a/flang-rt/lib/runtime/mma.f90 b/flang-rt/lib/runtime/mma.f90
index 4c41822e000a3..83c531581d3ad 100644
--- a/flang-rt/lib/runtime/mma.f90
+++ b/flang-rt/lib/runtime/mma.f90
@@ -7,6 +7,7 @@
 !===------------------------------------------------------------------------===!
 
 module mma
+  use __fortran_builtins, __ppc_types ! implicit dependencies, made explicit for CMake
   implicit none
   private
 



More information about the llvm-commits mailing list