Skip to content

Conversation

@aengelke
Copy link
Contributor

This avoids looking at the individual sources for mixed C/C++ libraries.

The previous code was written ~2014. Generator expressions were added in CMake 3.3 (2015). We currently require CMake 3.20 and therefore can rely on more modern features.

Apart from simplifying the code, this is preliminary work to make more use of pre-compiled headers (#173868).

This avoids looking at the individual sources for mixed C/C++ libraries.

The previous code was written ~2014. Generator expressions were added in
CMake 3.3 (2015). We currently require CMake 3.20 and therefore can rely
on more modern features.
@aengelke aengelke requested review from chapuni and rnk December 29, 2025 14:32
@aengelke aengelke added the cmake Build system in general and CMake in particular label Dec 29, 2025
Copy link
Contributor

@nikic nikic left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@aengelke aengelke merged commit 54faa75 into llvm:main Dec 30, 2025
12 checks passed
@aengelke aengelke deleted the cmake-genexpr branch December 30, 2025 08:48
@llvm-ci
Copy link
Collaborator

llvm-ci commented Dec 30, 2025

LLVM Buildbot has detected a new failure on builder clang-m68k-linux-cross running on suse-gary-m68k-cross while building llvm at step 5 "ninja check 1".

Full details are available at: https://lab.llvm.org/buildbot/#/builders/27/builds/20837

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
...
[137/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/SymbolCollectorTests.cpp.o
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp: In member function ‘virtual void clang::clangd::{anonymous}::SymbolCollectorTest_SpelledReferences_Test::TestBody()’:
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp:1148:8: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
 1148 |     if (!SpelledRanges.empty())
      |        ^
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang-tools-extra/clangd/unittests/SymbolCollectorTests.cpp:1151:8: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]
 1151 |     if (!ImplicitRanges.empty())
      |        ^
[138/1251] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Lex/LexHLSLRootSignatureTest.cpp.o
[139/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/CodeCompleteTests.cpp.o
FAILED: tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/CodeCompleteTests.cpp.o 
/usr/bin/c++ -DGTEST_HAS_RTTI=0 -DLLVM_BUILD_STATIC -D_DEBUG -D_GLIBCXX_ASSERTIONS -D_GLIBCXX_USE_CXX11_ABI=1 -D_GNU_SOURCE -D__STDC_CONSTANT_MACROS -D__STDC_FORMAT_MACROS -D__STDC_LIMIT_MACROS -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/tools/extra/clangd/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang-tools-extra/clangd/unittests -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang-tools-extra/clangd/../include-cleaner/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/tools/extra/clangd/../clang-tidy -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/llvm/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang-tools-extra/clangd -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/stage1/tools/clang/tools/extra/clangd -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googletest/include -I/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/third-party/unittest/googlemock/include -fPIC -fno-semantic-interposition -fvisibility-inlines-hidden -Werror=date-time -Wall -Wextra -Wno-unused-parameter -Wwrite-strings -Wcast-qual -Wno-missing-field-initializers -pedantic -Wno-long-long -Wimplicit-fallthrough -Wno-uninitialized -Wno-nonnull -Wno-class-memaccess -Wno-dangling-reference -Wno-redundant-move -Wno-pessimizing-move -Wno-array-bounds -Wno-stringop-overread -Wno-noexcept-type -Wdelete-non-virtual-dtor -Wsuggest-override -Wno-comment -Wno-misleading-indentation -Wctad-maybe-unsupported -fdiagnostics-color -ffunction-sections -fdata-sections -fno-common -Woverloaded-virtual -O3 -DNDEBUG -std=c++17 -UNDEBUG -Wno-variadic-macros -fno-exceptions -funwind-tables -fno-rtti -Wno-suggest-override -MD -MT tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/CodeCompleteTests.cpp.o -MF tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/CodeCompleteTests.cpp.o.d -o tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/CodeCompleteTests.cpp.o -c /var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang-tools-extra/clangd/unittests/CodeCompleteTests.cpp
c++: fatal error: Killed signal terminated program cc1plus
compilation terminated.
[140/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/ObjCLocalizeStringLiteralTests.cpp.o
[141/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/OverridePureVirtualsTests.cpp.o
[142/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/DumpSymbolTests.cpp.o
[143/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/PopulateSwitchTests.cpp.o
[144/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/RawStringLiteralTests.cpp.o
[145/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/RemoveUsingNamespaceTests.cpp.o
[146/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/TweakTests.cpp.o
[147/1251] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Lex/LexerTest.cpp.o
[148/1251] Building CXX object tools/clang/unittests/CMakeFiles/AllClangUnitTests.dir/Lex/ModuleDeclStateTest.cpp.o
[149/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/SwapIfBranchesTests.cpp.o
[150/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/SwapBinaryOperandsTests.cpp.o
[151/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/ShowSelectionTreeTests.cpp.o
[152/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/TweakTesting.cpp.o
[153/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/TestWorkspace.cpp.o
[154/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/MemberwiseConstructorTests.cpp.o
[155/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/ScopifyEnumTests.cpp.o
[156/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/SpecialMembersTests.cpp.o
[157/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/AnnotateHighlightingsTests.cpp.o
[158/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/ObjCMemberwiseInitializerTests.cpp.o
[159/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/ExtractFunctionTests.cpp.o
[160/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/DumpASTTests.cpp.o
[161/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/ExpandMacroTests.cpp.o
[162/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/DumpRecordLayoutTests.cpp.o
[163/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/ExtractVariableTests.cpp.o
[164/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/ExpandDeducedTypeTests.cpp.o
[165/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/SyncAPI.cpp.o
[166/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/TypeHierarchyTests.cpp.o
[167/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/AddUsingTests.cpp.o
[168/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/DefineOutlineTests.cpp.o
[169/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/tweaks/DefineInlineTests.cpp.o
[170/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/TestTU.cpp.o
[171/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/XRefsTests.cpp.o
[172/1251] Building CXX object tools/clang/tools/extra/clangd/unittests/CMakeFiles/ClangdTests.dir/TUSchedulerTests.cpp.o
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp: In member function ‘virtual void clang::clangd::{anonymous}::TUSchedulerTests_PublishWithStalePreamble_Test::TestBody()::BlockPreambleThread::onPreambleAST(clang::clangd::PathRef, llvm::StringRef, clang::clangd::CapturedASTCtx, std::shared_ptr<const clang::include_cleaner::PragmaIncludes>)’:
/var/lib/buildbot/workers/suse-gary-m68k-cross/clang-m68k-linux-cross/llvm/clang-tools-extra/clangd/unittests/TUSchedulerTests.cpp:1219:10: warning: suggest explicit braces to avoid ambiguous ‘else’ [-Wdangling-else]

@krasimirgg
Copy link
Contributor

We have a bot to build the rust compiler with LLVM close to HEAD.

Looks like starting from this commit, we're seeing some new linker errors like:

librustc_driver-c05f028e6e8d2de9.so: undefined reference to `typeinfo for llvm::AssemblyAnnotationWriter'

Some sort of RTTI mismatch between how we build LLVM and the rust llvm-wrapper.

The builder uses this configuration:

cmake "${BUILD_DIR}/src/llvm-project/llvm" -G Ninja \
  -DLLVM_ENABLE_ASSERTIONS=OFF \
  -DLLVM_TARGETS_TO_BUILD='AArch64;ARM;Hexagon;LoongArch;MSP430;Mips;NVPTX;PowerPC;RISCV;Sparc;SystemZ;WebAssembly;X86' \
  -DLLVM_EXPERIMENTAL_TARGETS_TO_BUILD='Xtensa' \
  -DLLVM_INCLUDE_EXAMPLES=OFF \
  -DLLVM_INCLUDE_DOCS=OFF \
  -DLLVM_INCLUDE_BENCHMARKS=OFF \
  -DLLVM_ENABLE_TERMINFO=OFF \
  -DLLVM_ENABLE_LIBEDIT=OFF \
  -DLLVM_ENABLE_BINDINGS=OFF \
  -DLLVM_ENABLE_Z3_SOLVER=OFF \
  -DLLVM_PARALLEL_COMPILE_JOBS=72 \
  -DLLVM_TARGET_ARCH=x86_64 \
  -DLLVM_DEFAULT_TARGET_TRIPLE=x86_64-unknown-linux-gnu \
  -DLLVM_ENABLE_ZLIB=ON \
  -DLLVM_ENABLE_LIBXML2=OFF \
  -DLLVM_VERSION_SUFFIX=-rust-dev \
  -DLLVM_CCACHE_BUILD=ON \
  -DCMAKE_INSTALL_MESSAGE=LAZY \
  -DCMAKE_C_COMPILER=/usr/bin/clang-21 \
  -DCMAKE_CXX_COMPILER=/usr/bin/clang++-21 \
  -DCMAKE_ASM_COMPILER=/usr/bin/clang-21 \
  -DCMAKE_C_FLAGS='-ffunction-sections -fdata-sections -fPIC --target=x86_64-unknown-linux-gnu' \
  -DCMAKE_CXX_FLAGS='-ffunction-sections -fdata-sections -fPIC --target=x86_64-unknown-linux-gnu -stdlib=libc++' \
  -DCMAKE_AR=/usr/bin/ar \
  -DCMAKE_INSTALL_PREFIX="${BUILD_DIR}/llvm-installed" \
  -DCMAKE_ASM_FLAGS=' -ffunction-sections -fdata-sections -fPIC --target=x86_64-unknown-linux-gnu' \
  -DCMAKE_BUILD_TYPE=Release \
  -DLIBUNWIND_ENABLE_SHARED=false \
  -DLLVM_INSTALL_UTILS=true

Adding -DLLVM_ENABLE_RTTI=ON fixes the build; but I'm not sure if it's expected that for rustc, the underlying LLVM really needs to be built with RTTI. cc @nikic

@nikic
Copy link
Contributor

nikic commented Dec 31, 2025

@krasimirgg Rust shouldn't need LLVM built with RTTI. I'm not sure how this PR changed things. It looks like https://github.com/rust-lang/rust/blob/main/compiler/rustc_llvm/build.rs (the LLVM bindings build) doesn't set -fno-exceptions or -fno-rtti, but the LLVM build also doesn't change the defaults (exceptions and RTTI disabled), so it's not clear to me how it worked before...

It would be good to get a full build log with the compiler invocations, so the used flags are visible.

@aengelke
Copy link
Contributor Author

aengelke commented Dec 31, 2025

llvm-config uses get_property(COMPILE_FLAGS TARGET llvm-config PROPERTY COMPILE_FLAGS) in CMake, but the options are now in COMPILE_OPTIONS, so llvm-config --cxxflags doesn't include them anymore. I'm not aware of a way to evaluate generator expressions in CMake... (and even if, it would also include things like -UNDEBUG which we'd need to filter out again...)

And this amount of trouble just so that two unittests (/flang/unittests/Evaluate, /clang/unittests/Interpreter/ExceptionTests) can compile with exceptions (which, btw, also seem to work fine without RTTI) -- otherwise we could just set the flags globally and wouldn't need this llvm_update_compile_flags hack.

@aengelke
Copy link
Contributor Author

aengelke commented Dec 31, 2025

A tangentially related questions is whether llvm-config --cxxflags should actually include -fno-exceptions -funwind-tables, because IIUC these is not required to link against LLVM, only -fno-rtti is. So I think the fix is to add the RTTI flag separately, as this is the only important flag that we need to emit?

(And when using find_package(LLVM), linking against LLVM doesn't cause the -fno-rtti flag to be added, so probably this should also go into PUBLIC options, not PRIVATE? Just shows how messy this code path is...)

aengelke added a commit that referenced this pull request Jan 1, 2026
Fix for #173869.

If there's no strong reason, we should get rid of per-target RTTI later.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jan 1, 2026
Fix for llvm/llvm-project#173869.

If there's no strong reason, we should get rid of per-target RTTI later.
ronlieb pushed a commit to ROCm/llvm-project that referenced this pull request Jan 2, 2026
Fix for llvm#173869.

If there's no strong reason, we should get rid of per-target RTTI later.
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jan 6, 2026
…m#173869)

This avoids looking at the individual sources for mixed C/C++ libraries.

The previous code was written ~2014. Generator expressions were added in
CMake 3.3 (2015). We currently require CMake 3.20 and therefore can rely
on more modern features.

Apart from simplifying the code, this is preliminary work to make more
use of pre-compiled headers (llvm#173868).
mahesh-attarde pushed a commit to mahesh-attarde/llvm-project that referenced this pull request Jan 6, 2026
Fix for llvm#173869.

If there's no strong reason, we should get rid of per-target RTTI later.
navaneethshan pushed a commit to qualcomm/cpullvm-toolchain that referenced this pull request Jan 8, 2026
Fix for llvm/llvm-project#173869.

If there's no strong reason, we should get rid of per-target RTTI later.
navaneethshan pushed a commit to qualcomm/cpullvm-toolchain that referenced this pull request Jan 9, 2026
Fix for llvm/llvm-project#173869.

If there's no strong reason, we should get rid of per-target RTTI later.

(cherry picked from commit d1b88ca)
nikic added a commit that referenced this pull request Jan 16, 2026
#173869 accidentally dropped
rtti and eh flags from `llvm-config --cxxflags`. Then
#174084 restored the rtti
flags. The eh flags were not included with the rationale that they are
not ABI relevant.

This PR restores the eh flags as well. While they are not strictly
necessary, I believe that code that directly interfaces with LLVM almost
certainly does not want to build with exceptions if LLVM is not built
with exceptions. Building in the peculiar `-fexceptions -fno-rtti`
configuration is rarely useful and likely not intended.

On MacOS, this is also relevant because it's not possible to use C++17
headers without `-fno-exceptions` when using older deployment targets.
In that configuration, `-fno-exceptions` is required to interact with
LLVM.
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jan 16, 2026
…(#176195)

llvm/llvm-project#173869 accidentally dropped
rtti and eh flags from `llvm-config --cxxflags`. Then
llvm/llvm-project#174084 restored the rtti
flags. The eh flags were not included with the rationale that they are
not ABI relevant.

This PR restores the eh flags as well. While they are not strictly
necessary, I believe that code that directly interfaces with LLVM almost
certainly does not want to build with exceptions if LLVM is not built
with exceptions. Building in the peculiar `-fexceptions -fno-rtti`
configuration is rarely useful and likely not intended.

On MacOS, this is also relevant because it's not possible to use C++17
headers without `-fno-exceptions` when using older deployment targets.
In that configuration, `-fno-exceptions` is required to interact with
LLVM.
kkwli pushed a commit to kkwli/llvm-project that referenced this pull request Jan 16, 2026
llvm#173869 accidentally dropped
rtti and eh flags from `llvm-config --cxxflags`. Then
llvm#174084 restored the rtti
flags. The eh flags were not included with the rationale that they are
not ABI relevant.

This PR restores the eh flags as well. While they are not strictly
necessary, I believe that code that directly interfaces with LLVM almost
certainly does not want to build with exceptions if LLVM is not built
with exceptions. Building in the peculiar `-fexceptions -fno-rtti`
configuration is rarely useful and likely not intended.

On MacOS, this is also relevant because it's not possible to use C++17
headers without `-fno-exceptions` when using older deployment targets.
In that configuration, `-fno-exceptions` is required to interact with
LLVM.
Priyanshu3820 pushed a commit to Priyanshu3820/llvm-project that referenced this pull request Jan 18, 2026
llvm#173869 accidentally dropped
rtti and eh flags from `llvm-config --cxxflags`. Then
llvm#174084 restored the rtti
flags. The eh flags were not included with the rationale that they are
not ABI relevant.

This PR restores the eh flags as well. While they are not strictly
necessary, I believe that code that directly interfaces with LLVM almost
certainly does not want to build with exceptions if LLVM is not built
with exceptions. Building in the peculiar `-fexceptions -fno-rtti`
configuration is rarely useful and likely not intended.

On MacOS, this is also relevant because it's not possible to use C++17
headers without `-fno-exceptions` when using older deployment targets.
In that configuration, `-fno-exceptions` is required to interact with
LLVM.
c-rhodes pushed a commit to llvmbot/llvm-project that referenced this pull request Jan 19, 2026
llvm#173869 accidentally dropped
rtti and eh flags from `llvm-config --cxxflags`. Then
llvm#174084 restored the rtti
flags. The eh flags were not included with the rationale that they are
not ABI relevant.

This PR restores the eh flags as well. While they are not strictly
necessary, I believe that code that directly interfaces with LLVM almost
certainly does not want to build with exceptions if LLVM is not built
with exceptions. Building in the peculiar `-fexceptions -fno-rtti`
configuration is rarely useful and likely not intended.

On MacOS, this is also relevant because it's not possible to use C++17
headers without `-fno-exceptions` when using older deployment targets.
In that configuration, `-fno-exceptions` is required to interact with
LLVM.

(cherry picked from commit 9bbea75)
llvm-sync bot pushed a commit to arm/arm-toolchain that referenced this pull request Jan 19, 2026
…(#176195)

llvm/llvm-project#173869 accidentally dropped
rtti and eh flags from `llvm-config --cxxflags`. Then
llvm/llvm-project#174084 restored the rtti
flags. The eh flags were not included with the rationale that they are
not ABI relevant.

This PR restores the eh flags as well. While they are not strictly
necessary, I believe that code that directly interfaces with LLVM almost
certainly does not want to build with exceptions if LLVM is not built
with exceptions. Building in the peculiar `-fexceptions -fno-rtti`
configuration is rarely useful and likely not intended.

On MacOS, this is also relevant because it's not possible to use C++17
headers without `-fno-exceptions` when using older deployment targets.
In that configuration, `-fno-exceptions` is required to interact with
LLVM.

(cherry picked from commit 9bbea75)
BStott6 pushed a commit to BStott6/llvm-project that referenced this pull request Jan 22, 2026
llvm#173869 accidentally dropped
rtti and eh flags from `llvm-config --cxxflags`. Then
llvm#174084 restored the rtti
flags. The eh flags were not included with the rationale that they are
not ABI relevant.

This PR restores the eh flags as well. While they are not strictly
necessary, I believe that code that directly interfaces with LLVM almost
certainly does not want to build with exceptions if LLVM is not built
with exceptions. Building in the peculiar `-fexceptions -fno-rtti`
configuration is rarely useful and likely not intended.

On MacOS, this is also relevant because it's not possible to use C++17
headers without `-fno-exceptions` when using older deployment targets.
In that configuration, `-fno-exceptions` is required to interact with
LLVM.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

cmake Build system in general and CMake in particular

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants