Meinersbur wrote:

> There is a change that also came with moving from the llvm to the runtimes 
> top cmake: exceptions seems to no be disabled by default (unless explicitly 
> asked for EH, LLVM sets `-fno-exceptions -funwind-tables -fno-rtti` in 
> [AddLLVM.cmake](https://github.com/llvm/llvm-project/blob/bf483ddb42065405e345393e022dc72357ec5a3a/llvm/cmake/modules/AddLLVM.cmake#L41).
>  This does not happen when building the runtime.) This causes issues in the 
> CUDA builds of the runtime (variant are dealt with differently with and 
> without exceptions enabled).
> 
> Given the Fortran runtime is meant to be free from the c++ runtime, I think 
> it should not be built with exception handling enabled (we do not want 
> try/catch in the runtime source). Is there a way to do for the runtime what 
> AddLLVM.cmake is doing for flang?

Exceptions are unconditionally disabled in `cmake/modules/AddFlangRT.cmake`: 
https://github.com/llvm/llvm-project/pull/110217/files#diff-be23c742c88da2fe1ce8d045ad3e39bed2c26ee02ffadcb4c04db40a4857cb55R70

![image](https://github.com/user-attachments/assets/21851576-34a9-4f3d-ad72-54cb026a8128)

The switches are the effective set of compile options with LLVM_ENABLE_EH=OFF, 
LLVM_ENABLE_UNWIND_TABLES=OFF and LLVM_ENABLE_RTTI=OFF. Even if the LLVM 
framework is configured with any of those enabled (because it is used as a 
library in an application that uses RTTI/exceptions), the artifacts produced by 
flang must still be identical.

https://github.com/llvm/llvm-project/pull/110217
_______________________________________________
llvm-branch-commits mailing list
llvm-branch-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-branch-commits

Reply via email to