LLVM libunwind: CXX_SUPPORTS_FNO_EXCEPTIONS_FLAG test on CMake 3.25+
The issue appeared first time when compiling libunwind
as part of LLVM project using CMake >= 3.25.2 built from source. Version 3.24.3 works fine. The compiler toolchain on which the issue can be reproduced is GCC 11.0 or newer with or without multilib on Ubuntu 22.04. This compiler toolchain supports both -fno-exceptions
and -funwind-tables
flags on simplest C++ program. However, during configuration of libunwind
during LLVM build process the test CXX_SUPPORTS_FUNWIND_TABLES_FLAG
is passed whether test for CXX_SUPPORTS_FNO_EXCEPTIONS_FLAG
fails, then stopping the build.
This is reported as CMake issue because the simplest CMakeLists.txt
sample:
Project("noexcepttest")
If(NOT CXX_SUPPORTS_FNO_EXCEPTIONS_FLAG)
message(FATAL_ERROR "Not supported")
endif
run on freshly built CMake also fails on versions >= 3.25.2 and works fine on version 3.24