Skip to content

Conversation

@aengelke
Copy link
Contributor

@aengelke aengelke commented Dec 31, 2025

Fix for #173869.

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

@aengelke aengelke requested a review from nikic December 31, 2025 11:25
@llvmbot llvmbot added the cmake Build system in general and CMake in particular label Dec 31, 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.

I'm somewhat confused by how this code works, including for the existing LLVM_CONFIG_HAS_RTTI flag. If LLVM_REQUIRES_RTTI is used somewhere, does this depend on whether the last target for which llvm_update_compile_flags is called happens to have that set or not?

Should llvm-config only be using the global LLVM_ENABLE_RTTI instead of this second LLVM_CONFIG_HAS_RTTI variable that also uses LLVM_REQUIRES_RTTI? And if so, can we extract determining the corresponding compiler flag into a separate function that gets explicitly called from the llvm-config cmake instead of relying on the side-effect here?

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@aengelke
Copy link
Contributor Author

aengelke commented Jan 1, 2026

CI failure was a spurious link error, worked fine on second try.

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 d1b88ca into llvm:main Jan 1, 2026
13 of 14 checks passed
@aengelke aengelke deleted the fix-cmake-llvm-config branch January 1, 2026 21:24
@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 2, 2026

LLVM Buildbot has detected a new failure on builder ppc64le-flang-rhel-clang running on ppc64le-flang-rhel-test while building llvm at step 6 "test-build-unified-tree-check-flang".

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

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-flang) failure: 1200 seconds without output running [b'ninja', b'check-flang'], attempting to kill
...
PASS: Flang :: Semantics/modfile73.f90 (4061 of 4071)
PASS: Flang :: Semantics/numeric_storage_size.f90 (4062 of 4071)
PASS: Flang :: Driver/mrecip.f90 (4063 of 4071)
PASS: Flang :: Driver/use-module-error.f90 (4064 of 4071)
PASS: Flang :: Driver/mcmodel.f90 (4065 of 4071)
PASS: Flang :: Driver/fopenmp.f90 (4066 of 4071)
PASS: Flang :: Driver/use-module.f90 (4067 of 4071)
PASS: Flang :: Intrinsics/math-codegen.fir (4068 of 4071)
PASS: Flang :: Driver/linker-options.f90 (4069 of 4071)
PASS: Flang :: Driver/omp-driver-offload.f90 (4070 of 4071)
command timed out: 1200 seconds without output running [b'ninja', b'check-flang'], attempting to kill
process killed by signal 9
program finished with exit code -1
elapsedTime=2791.351677

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 2, 2026

LLVM Buildbot has detected a new failure on builder clang-ppc64le-linux-test-suite running on ppc64le-clang-test-suite while building llvm at step 6 "test-build-unified-tree-check-all".

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

Here is the relevant piece of the build log for the reference
Step 6 (test-build-unified-tree-check-all) failure: test (failure)
******************** TEST 'LeakSanitizer-Standalone-powerpc64le :: TestCases/create_thread_leak.cpp' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 3
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang  --driver-mode=g++ -O0  -m64 -fno-function-sections  -gline-tables-only -fsanitize=leak -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/../ -pthread /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp
# executed command: /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/./bin/clang --driver-mode=g++ -O0 -m64 -fno-function-sections -gline-tables-only -fsanitize=leak -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/../ -pthread /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp
# RUN: at line 4
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 1 0 0 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK123
# executed command: not /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 1 0 0
# executed command: FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK123
# RUN: at line 5
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 1 0 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# executed command: not /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 1 0
# executed command: FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# RUN: at line 6
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 0 1 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# executed command: not /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/build/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LELsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 0 1
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
# executed command: FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-test-suite/clang-ppc64le-test-suite/llvm-project/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# `-----------------------------
# error: command failed with exit status: 2

--

********************


ronlieb added a commit to ROCm/llvm-project that referenced this pull request Jan 2, 2026
ronlieb added a commit to ROCm/llvm-project that referenced this pull request Jan 2, 2026
@aengelke
Copy link
Contributor Author

aengelke commented Jan 2, 2026

Buildbot failures seem unrelated: first is just a timeout, second is spurious (tests pass in next build). @ronlieb you noted that this breaks your build -- what's happening and is this a pure downstream thing?

@llvm-ci
Copy link
Collaborator

llvm-ci commented Jan 2, 2026

LLVM Buildbot has detected a new failure on builder clang-ppc64le-linux-multistage running on ppc64le-clang-multistage-test while building llvm at step 5 "ninja check 1".

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

Here is the relevant piece of the build log for the reference
Step 5 (ninja check 1) failure: stage 1 checked (failure)
******************** TEST 'LeakSanitizer-AddressSanitizer-powerpc64le :: TestCases/create_thread_leak.cpp' FAILED ********************
Exit Code: 2

Command Output (stdout):
--
# RUN: at line 3
/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/./bin/clang  --driver-mode=g++ -O0  -m64 -fno-function-sections  -gline-tables-only -fsanitize=address -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/../ -pthread /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LEAsanConfig/TestCases/Output/create_thread_leak.cpp.tmp
# executed command: /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/./bin/clang --driver-mode=g++ -O0 -m64 -fno-function-sections -gline-tables-only -fsanitize=address -I/home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/../ -pthread /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp -o /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LEAsanConfig/TestCases/Output/create_thread_leak.cpp.tmp
# RUN: at line 4
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LEAsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 1 0 0 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK123
# executed command: not /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LEAsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 1 0 0
# executed command: FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK123
# RUN: at line 5
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LEAsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 1 0 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# executed command: not /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LEAsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 1 0
# executed command: FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# RUN: at line 6
not  /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LEAsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 0 1 2>&1 | FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# executed command: not /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/stage1/runtimes/runtimes-bins/compiler-rt/test/lsan/POWERPC64LEAsanConfig/TestCases/Output/create_thread_leak.cpp.tmp 10 0 0 1
# note: command had no output on stdout or stderr
# error: command failed with exit status: 1
# executed command: FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line:  FileCheck /home/buildbots/llvm-external-buildbots/workers/ppc64le-clang-multistage-test/clang-ppc64le-multistage/llvm/compiler-rt/test/lsan/TestCases/create_thread_leak.cpp --check-prefixes=LEAK,LEAK234
# `-----------------------------
# error: command failed with exit status: 2

--

********************


@RKSimon
Copy link
Collaborator

RKSimon commented Jan 2, 2026

@aengelke This is spamming MSVC builds with exception override warnings https://lab.llvm.org/buildbot/#/builders/46/builds/28456

[3188/18/878/4083]Building CXX object lib\Analysi...eFiles\LLVMAnalysis.dir\MemoryProfileInfo.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[3187/18/879/4083]Building CXX object lib\Analysis\CMakeFiles\LLVMAnalysis.dir\MemoryBuiltins.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[3186/18/880/4083]Building CXX object lib\Analysis\CMakeFiles\LLVMAnalysis.dir\LoopInfo.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[3185/18/881/4083]Building CXX object lib\Analysis\CMakeFiles\LLVMAnalysis.dir\ObjCARCInstKind.cpp.ob
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[3184/18/882/4083]Building CXX object lib\Analysi...LLVMAnalysis.dir\MemoryDependenceAnalysis.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[3183/18/883/4083]Building CXX object lib\Analysi...les\LLVMAnalysis.dir\ObjCARCAliasAnalysis.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[3182/18/884/4083]Building CXX object lib\Analysi...keFiles\LLVMAnalysis.dir\MemorySSAUpdater.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'
[3181/18/885/4083]Building CXX object lib\Analysi...Files\LLVMAnalysis.dir\LoopAccessAnalysis.cpp.obj
cl : Command line warning D9025 : overriding '/EHs' with '/EHs-'
cl : Command line warning D9025 : overriding '/EHc' with '/EHc-'

@aengelke
Copy link
Contributor Author

aengelke commented Jan 2, 2026

Thanks for noticing, hopefully fixed with 2b903df.

@RKSimon
Copy link
Collaborator

RKSimon commented Jan 2, 2026

Thanks for noticing, hopefully fixed with 2b903df.

Thanks - that fixed it

@ronlieb
Copy link
Contributor

ronlieb commented Jan 2, 2026

Buildbot failures seem unrelated: first is just a timeout, second is spurious (tests pass in next build). @ronlieb you noted that this breaks your build -- what's happening and is this a pure downstream thing?

seems to be purely downstream, i think i am seeing an additionaly flag "-fno-rtti" during our build of offload

@kuhar
Copy link
Member

kuhar commented Jan 2, 2026

Same, I can see failures downstream even with the commit above, which causes:

 Found erroneous configuration for source file PassPlugin.cpp

 LLVM's build system enforces that all source files are added to a build
 target, that exactly one build target exists in each directory, and that
 this target lists all files in that directory.  If you want multiple
 targets in the same directory, add PARTIAL_SOURCES_INTENDED to the target
 specification, though it is discouraged.

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.
@aengelke
Copy link
Contributor Author

aengelke commented Jan 2, 2026

@ronlieb that's unexpected, that should've been there all the time? offload/CMakeLists.txt makes its decision purely on LLVM_ENABLE_RTTI, which was unchanged?

@kuhar but... PassPlugin.cpp is referenced in llvm/lib/Plugins/CMakeLists.txt?

@kuhar
Copy link
Member

kuhar commented Jan 2, 2026

@kuhar but... PassPlugin.cpp is referenced in llvm/lib/Plugins/CMakeLists.txt?

to me this indicates something's off with cmake, let me try a clean build, maybe these rtti changes messed up the cache etc.

kuhar added a commit to iree-org/llvm-project that referenced this pull request Jan 2, 2026
kuhar added a commit to iree-org/iree that referenced this pull request Jan 2, 2026
New reverts:
* llvm/llvm-project#174084 -- causes linker
errors related to rtti in stablehlo code
*
llvm/llvm-project@2b903df
-- follow up fix to the above (doesn't fix it for us)
 
 Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.
Abhishek-Varma pushed a commit to iree-org/llvm-project that referenced this pull request Jan 5, 2026
Yu-Zhewen pushed a commit to iree-org/iree that referenced this pull request Jan 10, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.
* llvm/llvm-project#174084 -- causes linker
errors related to rtti in stablehlo code
*
llvm/llvm-project@2b903df
-- follow up fix to the above (doesn't fix it for us)

Signed-off-by: Abhishek Varma <[email protected]>

Signed-off-by: Abhishek Varma <[email protected]>
@dtcxzyw
Copy link
Member

dtcxzyw commented Jan 11, 2026

I also hit a linking error on my downstream project. I have to add -fno-rtti manually.

Abhishek-Varma pushed a commit to iree-org/llvm-project that referenced this pull request Jan 11, 2026
Abhishek-Varma added a commit to Abhishek-Varma/iree that referenced this pull request Jan 11, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due to llvm/llvm-project#172932.
* llvm/llvm-project#174084 -- causes linker errors related to rtti in stablehlo code
* llvm/llvm-project@2b903df -- follow up fix to the above (doesn't fix it for us)

Signed-off-by: Abhishek Varma <[email protected]>
aengelke added a commit that referenced this pull request Jan 12, 2026
This should help users who use AddLLVM.cmake without HandleLLVMOptions.
Note that remains MSVC is unlikely to work.

Follow up of #174084.
krzysz00 pushed a commit to iree-org/iree that referenced this pull request Jan 12, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.
* llvm/llvm-project#174084 -- causes linker
errors related to rtti in stablehlo code
*
llvm/llvm-project@2b903df
-- follow up fix to the above (doesn't fix it for us)

Signed-off-by: Abhishek Varma <[email protected]>

Signed-off-by: Abhishek Varma <[email protected]>
krzysz00 added a commit to iree-org/iree that referenced this pull request Jan 12, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
  to llvm/llvm-project#172932.

Reverts dropped:
* llvm/llvm-project#174084 and followups - it
  works now
Abhishek-Varma added a commit to Abhishek-Varma/iree that referenced this pull request Jan 13, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due to llvm/llvm-project#172932.
* llvm/llvm-project#174084 -- causes linker errors related to rtti in stablehlo code
* llvm/llvm-project@2b903df -- follow up fix to the above (doesn't fix it for us)

Signed-off-by: Abhishek Varma <[email protected]>
krzysz00 added a commit to iree-org/iree that referenced this pull request Jan 13, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.

Reverts dropped:
* llvm/llvm-project#174084 and followups - it
works now

Local workarounds dropped:
* Remove copying around some Python DLLs since upstream seems to put
them in the right place now
@nikic
Copy link
Contributor

nikic commented Jan 15, 2026

I do wonder whether omitting the exception flags from llvm-config is really the right choice. While not strictly necessary for ABI compatibility, it does seem pretty likely that code directly interfacing with LLVM also wants to use -fno-exceptions. Especially as the specific combination of -fexceptions with -fno-rtti is pretty exotic and barely useful.

I ran into this change due to a build failure in LLVM bindings on MacOS, because C++17 with deployment target 10.12 is only supported with -fno-exceptions (otherwise libc++ headers will error).

Manually setting -fno-exceptions for that specific case is simple enough, but disabling exceptions for all the compilers would effectively replicate this LLVM code.

@nikic
Copy link
Contributor

nikic commented Jan 15, 2026

I'm not fully confident on whether we should include the EH flags or not, but I've put up #176195 anyway, before I start introducing workarounds downstream.

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
This should help users who use AddLLVM.cmake without HandleLLVMOptions.
Note that remains MSVC is unlikely to work.

Follow up of llvm#174084.
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.
keshavvinayak01 pushed a commit to iree-org/iree that referenced this pull request Jan 27, 2026
New reverts:
* llvm/llvm-project#174084 -- causes linker
errors related to rtti in stablehlo code
*
llvm/llvm-project@2b903df
-- follow up fix to the above (doesn't fix it for us)

 Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.

Signed-off-by: Keshav Vinayak Jha <[email protected]>
keshavvinayak01 pushed a commit to iree-org/iree that referenced this pull request Jan 27, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.
* llvm/llvm-project#174084 -- causes linker
errors related to rtti in stablehlo code
*
llvm/llvm-project@2b903df
-- follow up fix to the above (doesn't fix it for us)

Signed-off-by: Abhishek Varma <[email protected]>

---------

Signed-off-by: Abhishek Varma <[email protected]>
Co-authored-by: Jakub Kuderski <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
keshavvinayak01 pushed a commit to iree-org/iree that referenced this pull request Jan 27, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.
* llvm/llvm-project#174084 -- causes linker
errors related to rtti in stablehlo code
*
llvm/llvm-project@2b903df
-- follow up fix to the above (doesn't fix it for us)

Signed-off-by: Abhishek Varma <[email protected]>

---------

Signed-off-by: Abhishek Varma <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
keshavvinayak01 pushed a commit to iree-org/iree that referenced this pull request Jan 27, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.
* llvm/llvm-project#174084 -- causes linker
errors related to rtti in stablehlo code
*
llvm/llvm-project@2b903df
-- follow up fix to the above (doesn't fix it for us)

-- Along with the above, IREE header fixes were done to
accomodate changes introduced via
llvm/llvm-project#82190
   for `Affine/Transforms/Passes.h`.

NOTE: [Twine fix
commit](iree-org/llvm-project@2eaa29c)
was dropped from our fork since
llvm/llvm-project#175077 got merged upstream.

Signed-off-by: Abhishek Varma <[email protected]>

Signed-off-by: Abhishek Varma <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
keshavvinayak01 pushed a commit to iree-org/iree that referenced this pull request Jan 27, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.
* llvm/llvm-project#174084 -- causes linker
errors related to rtti in stablehlo code
*
llvm/llvm-project@2b903df
-- follow up fix to the above (doesn't fix it for us)

Signed-off-by: Abhishek Varma <[email protected]>

Signed-off-by: Abhishek Varma <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
keshavvinayak01 pushed a commit to iree-org/iree that referenced this pull request Jan 27, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.
* llvm/llvm-project#174084 -- causes linker
errors related to rtti in stablehlo code
*
llvm/llvm-project@2b903df
-- follow up fix to the above (doesn't fix it for us)

Signed-off-by: Abhishek Varma <[email protected]>

Signed-off-by: Abhishek Varma <[email protected]>
Signed-off-by: Keshav Vinayak Jha <[email protected]>
keshavvinayak01 pushed a commit to iree-org/iree that referenced this pull request Jan 27, 2026
Existing local reverts carried forward:
* Local revert of llvm/llvm-project#169614 due
to llvm/llvm-project#172932.

Reverts dropped:
* llvm/llvm-project#174084 and followups - it
works now

Local workarounds dropped:
* Remove copying around some Python DLLs since upstream seems to put
them in the right place now

Signed-off-by: Keshav Vinayak Jha <[email protected]>
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.

10 participants