[flang-commits] [PATCH] D146173: Flang cmake patch to handle LLVM_ENABLE_EH conflict (issue #59353)

Pat McCormick via Phabricator via flang-commits flang-commits at lists.llvm.org
Wed Mar 15 15:43:48 PDT 2023


pmccormick created this revision.
pmccormick added reviewers: sscalpone, kiranchandramohan, awarzynski, klausler, clementval, jeanPerier, PeteSteinfeld, tarunprabhu, AlexisPerry.
pmccormick added a project: Flang.
Herald added subscribers: sunshaoce, jdoerfert.
Herald added a project: All.
pmccormick requested review of this revision.

A quick fix to address issue #59353 <https://github.com/llvm/llvm-project/issues/59353>.

High-level summary:  don't allow Flang to build/configure when `LLVM_ENABLE_EH` is set.

As mentioned in the issue, this is aligned with the flang style guidelines (no exceptions).  We have a couple of recent use cases  (e..g, the spack <https://spack.io> managed install of llvm) that are actually producing versions of Flang w/ the link time failures mentioned in this issue.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D146173

Files:
  flang/CMakeLists.txt


Index: flang/CMakeLists.txt
===================================================================
--- flang/CMakeLists.txt
+++ flang/CMakeLists.txt
@@ -13,6 +13,14 @@
 set(CMAKE_CXX_STANDARD_REQUIRED TRUE)
 set(CMAKE_CXX_EXTENSIONS OFF)
 
+if (LLVM_ENABLE_EH)
+  # To match with the flang guidelines we currently disable  
+  # building with exception support in core LLVM.
+  message(FATAL_ERROR "Flang does not currently support building with \
+          LLVM exceptions enabled.  Please disable LLVM_ENABLE_EH when building \
+          flang.")
+endif()  
+
 set(FLANG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR})
 
 if (CMAKE_SOURCE_DIR STREQUAL CMAKE_BINARY_DIR AND NOT MSVC_IDE)


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D146173.505592.patch
Type: text/x-patch
Size: 680 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/flang-commits/attachments/20230315/cecde06e/attachment-0001.bin>


More information about the flang-commits mailing list