Skip to content

Conversation

@nikic
Copy link
Contributor

@nikic nikic commented Jan 15, 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.

@nikic nikic requested a review from aengelke January 15, 2026 16:04
@llvmbot llvmbot added the cmake Build system in general and CMake in particular label Jan 15, 2026
Copy link
Contributor

@aengelke aengelke left a comment

Choose a reason for hiding this comment

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

LGTM. The whole thing is just incredibly messy and if this causes breakage, let's not try to win points for purity here.

A summary of the messiness:

  • -fno-exceptions/-fno-rtti are only exposed via llvm-config, not via CMake when linking against LLVM. CMake users have to add these manually.
  • CMake by-default adds /EHsc for MSVC (/GR was dropped with CMake 3.20, which we require).
  • MSVC warns about option mismatch, this warning can't be disabled.
  • One unittest unconditionally wants exceptions, with MSVC this forces us to do this per-target flag update and prevent us from just setting it in the global CMAKE_CXX_FLAGS.
  • Many Linux distributions build with -frtti, because some users use rtti to avoid this incompatibility.

endif()
elseif(MSVC)
if(MSVC)
list(APPEND LLVM_COMPILE_DEFINITIONS _HAS_EXCEPTIONS=0)
Copy link
Contributor

Choose a reason for hiding this comment

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

Given that this is now the only use of LLVM_COMPILE_DEFINITIONS, just use target_compile_definitions(${name} PRIVATE _HAS_EXCEPTIONS=0) here?

@nikic nikic mentioned this pull request Jan 15, 2026
10 tasks
@nikic nikic merged commit 9bbea75 into llvm:main Jan 16, 2026
13 checks passed
@nikic nikic deleted the llvm-config-exceptions branch January 16, 2026 08:33
@nikic nikic added this to the LLVM 22.x Release milestone Jan 16, 2026
@nikic
Copy link
Contributor Author

nikic commented Jan 16, 2026

/cherry-pick 9bbea75

@llvmbot
Copy link
Member

llvmbot commented Jan 16, 2026

/pull-request #176328

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 16, 2026

LLVM Buildbot has detected a new failure on builder lldb-aarch64-windows running on linaro-armv8-windows-msvc-05 while building llvm at step 6 "test".

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

Here is the relevant piece of the build log for the reference
Step 6 (test) failure: build (failure)
...
UNSUPPORTED: lldb-api :: functionalities/thread/create_after_attach/TestCreateAfterAttach.py (693 of 2396)
PASS: lldb-api :: functionalities/thread/exit_during_break/TestExitDuringBreak.py (694 of 2396)
UNSUPPORTED: lldb-api :: functionalities/thread/exit_during_expression/TestExitDuringExpression.py (695 of 2396)
UNSUPPORTED: lldb-api :: functionalities/thread/exit_during_step/TestExitDuringStep.py (696 of 2396)
PASS: lldb-api :: functionalities/thread/finish-from-empty-func/TestEmptyFuncThreadStepOut.py (697 of 2396)
PASS: lldb-api :: functionalities/thread/ignore_suspended/TestIgnoreSuspendedThread.py (698 of 2396)
UNSUPPORTED: lldb-api :: functionalities/thread/create_during_step/TestCreateDuringStep.py (699 of 2396)
UNSUPPORTED: lldb-api :: functionalities/thread/main_thread_exit/TestMainThreadExit.py (700 of 2396)
UNSUPPORTED: lldb-api :: functionalities/thread/multi_break/TestMultipleBreakpoints.py (701 of 2396)
PASS: lldb-api :: functionalities/thread/num_threads/TestNumThreads.py (702 of 2396)
FAIL: lldb-api :: functionalities/thread/jump/TestThreadJump.py (703 of 2396)
******************** TEST 'lldb-api :: functionalities/thread/jump/TestThreadJump.py' FAILED ********************
Script:
--
C:/Users/tcwg/scoop/apps/python/current/python.exe C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/llvm-project/lldb\test\API\dotest.py -u CXXFLAGS -u CFLAGS --env LLVM_LIBS_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./lib --env LLVM_INCLUDE_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/include --env LLVM_TOOLS_DIR=C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin --arch aarch64 --build-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex --lldb-module-cache-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/module-cache-lldb\lldb-api --clang-module-cache-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/lldb-test-build.noindex/module-cache-clang\lldb-api --executable C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/lldb.exe --compiler C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/clang.exe --dsymutil C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin/dsymutil.exe --make C:/Users/tcwg/scoop/shims/make.exe --llvm-tools-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./bin --lldb-obj-root C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/tools/lldb --lldb-libs-dir C:/Users/tcwg/llvm-worker/lldb-aarch64-windows/build/./lib --cmake-build-type Release --skip-category=watchpoint C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\llvm-project\lldb\test\API\functionalities\thread\jump -p TestThreadJump.py
--
Exit Code: 1

Command Output (stdout):
--
lldb version 23.0.0git (https://github.com/llvm/llvm-project.git revision 9bbea753a4a45f9c7c7ca9730736c7792adaacf9)
  clang revision 9bbea753a4a45f9c7c7ca9730736c7792adaacf9
  llvm revision 9bbea753a4a45f9c7c7ca9730736c7792adaacf9
Skipping the following test categories: watchpoint, libc++, libstdcxx, dwo, dsym, gmodules, debugserver, objc, fork, pexpect


--
Command Output (stderr):
--
UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_dsym (TestThreadJump.ThreadJumpTestCase.test_dsym) (test case does not fall in any category of interest for this run) 

PASS: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_dwarf (TestThreadJump.ThreadJumpTestCase.test_dwarf)

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_dwo (TestThreadJump.ThreadJumpTestCase.test_dwo) (test case does not fall in any category of interest for this run) 

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_jump_offset_dsym (TestThreadJump.ThreadJumpTestCase.test_jump_offset_dsym) (test case does not fall in any category of interest for this run) 

FAIL: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_jump_offset_dwarf (TestThreadJump.ThreadJumpTestCase.test_jump_offset_dwarf)

UNSUPPORTED: LLDB (C:\Users\tcwg\llvm-worker\lldb-aarch64-windows\build\bin\clang.exe-aarch64) :: test_jump_offset_dwo (TestThreadJump.ThreadJumpTestCase.test_jump_offset_dwo) (test case does not fall in any category of interest for this run) 

======================================================================

FAIL: test_jump_offset_dwarf (TestThreadJump.ThreadJumpTestCase.test_jump_offset_dwarf)

   Test Thread Jump by negative or positive offset

----------------------------------------------------------------------


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)
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.
rust-bors bot pushed a commit to rust-lang/rust that referenced this pull request Jan 27, 2026
Update to LLVM 22

Scheduled release date: Feb 24
1.94 becomes stable: Mar 5

Changes:
 * Update to rc2, with one patch to work around our outdated illumos sysroot (rust-lang/llvm-project@41256ab).
 * Update the host toolchain as well, otherwise we lose cross-language LTO, in particular for jemalloc.
 * Adjust one loongarch assembly test. The split into r and s variants is based on the suggestion in #151134.

Depends on:

 * [x] #151410
 * [ ] #150756
 * [x] llvm/llvm-project#175190
 * [x] llvm/llvm-project#175912
 * [x] llvm/llvm-project#175965
 * [x] llvm/llvm-project#176195
 * [x] llvm/llvm-project#157073
 * [x] llvm/llvm-project#176421
 * [x] llvm/llvm-project#176925
 * [x] llvm/llvm-project#177187
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

Development

Successfully merging this pull request may close these issues.

4 participants