[flang-commits] [flang] [flang] Make flang module hidden dependency explicit to correct build… (PR #108129)

Peter Klausler via flang-commits flang-commits at lists.llvm.org
Tue Sep 10 18:45:03 PDT 2024


https://github.com/klausler created https://github.com/llvm/llvm-project/pull/108129

… failure

Any flang module with a derived type definition implicitly depends on flang/module/__fortran_type_info.f90.  Make this dependency explicit so that an unlucky build order doesn't cause a crash.

>From 6e5ff9a49178e7e2d16d7b40fb899f732136c9d4 Mon Sep 17 00:00:00 2001
From: Peter Klausler <pklausler at nvidia.com>
Date: Tue, 10 Sep 2024 18:42:36 -0700
Subject: [PATCH] [flang] Make flang module hidden dependency explicit to
 correct build failure

Any flang module with a derived type definition implicitly depends
on flang/module/__fortran_type_info.f90.  Make this dependency
explicit so that an unlucky build order doesn't cause a crash.
---
 flang/tools/f18/CMakeLists.txt | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/flang/tools/f18/CMakeLists.txt b/flang/tools/f18/CMakeLists.txt
index 344a781c41e957..4670362f7a103c 100644
--- a/flang/tools/f18/CMakeLists.txt
+++ b/flang/tools/f18/CMakeLists.txt
@@ -72,9 +72,6 @@ if (NOT CMAKE_CROSSCOMPILING)
       set(depends ${FLANG_INTRINSIC_MODULES_DIR}/__cuda_builtins.mod)
     else()
       set(depends ${FLANG_INTRINSIC_MODULES_DIR}/__fortran_builtins.mod)
-      if(NOT ${filename} STREQUAL "__fortran_type_info")
-        set(depends ${depends} ${FLANG_INTRINSIC_MODULES_DIR}/__fortran_type_info.mod)
-      endif()
       if(${filename} STREQUAL "iso_fortran_env")
         set(depends ${depends} ${FLANG_INTRINSIC_MODULES_DIR}/iso_fortran_env_impl.mod)
       endif()
@@ -83,6 +80,9 @@ if (NOT CMAKE_CROSSCOMPILING)
         set(depends ${depends} ${FLANG_INTRINSIC_MODULES_DIR}/__fortran_ieee_exceptions.mod)
       endif()
     endif()
+    if(NOT ${filename} STREQUAL "__fortran_type_info")
+      set(depends ${depends} ${FLANG_INTRINSIC_MODULES_DIR}/__fortran_type_info.mod)
+    endif()
 
     # The module contains PPC vector types that needs the PPC target.
     if(${filename} STREQUAL "__ppc_intrinsics" OR



More information about the flang-commits mailing list