summaryrefslogtreecommitdiff
path: root/var
diff options
context:
space:
mode:
Diffstat (limited to 'var')
-rw-r--r--var/spack/repos/builtin/packages/llvm/package.py11
1 files changed, 10 insertions, 1 deletions
diff --git a/var/spack/repos/builtin/packages/llvm/package.py b/var/spack/repos/builtin/packages/llvm/package.py
index 16ab6177f7..a4a89f17bc 100644
--- a/var/spack/repos/builtin/packages/llvm/package.py
+++ b/var/spack/repos/builtin/packages/llvm/package.py
@@ -756,7 +756,6 @@ class Llvm(CMakePackage, CudaPackage):
cmake_args = [
define("LLVM_REQUIRES_RTTI", True),
define("LLVM_ENABLE_RTTI", True),
- define("LLVM_ENABLE_EH", True),
define("LLVM_ENABLE_LIBXML2", False),
define("CLANG_DEFAULT_OPENMP_RUNTIME", "libomp"),
define("PYTHON_EXECUTABLE", python.command.path),
@@ -765,6 +764,16 @@ class Llvm(CMakePackage, CudaPackage):
from_variant("LLVM_ENABLE_ZSTD", "zstd"),
]
+ # Flang does not support exceptions from core llvm.
+ # LLVM_ENABLE_EH=True when building flang will soon
+ # fail (with changes at the llvm-project level).
+ # Only enable exceptions in LLVM if we are *not*
+ # building flang. FYI: LLVM <= 16.x will build flang
+ # successfully but the executable will suffer from
+ # link errors looking for C++ EH support.
+ if "+flang" not in spec:
+ cmake_args.append(define("LLVM_ENABLE_EH", True))
+
version_suffix = spec.variants["version_suffix"].value
if version_suffix != "none":
cmake_args.append(define("LLVM_VERSION_SUFFIX", version_suffix))