[clang] [Clang] Ensure that .fini_array is available with -fno-use-cxa-atexit (PR #211963)
via cfe-commits
cfe-commits at lists.llvm.org
Sat Jul 25 23:28:13 PDT 2026
github-actions[bot] wrote:
<!--PREMERGE ADVISOR COMMENT: Windows-->
# :window: Windows x64 Test Results
* 55808 tests passed
* 1425 tests skipped
* 2 tests failed
## Failed Tests
(click on a test name to see its output)
### Clang
<details>
<summary>Clang.CodeGenCXX/global-dtor-no-atexit.cpp</summary>
```
Exit Code: 1
Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\24\include -nostdsysteminc -triple x86_64 C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\global-dtor-no-atexit.cpp -fno-use-cxa-atexit -emit-llvm -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\global-dtor-no-atexit.cpp
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\24\include' -nostdsysteminc -triple x86_64 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\global-dtor-no-atexit.cpp' -fno-use-cxa-atexit -emit-llvm -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\global-dtor-no-atexit.cpp'
# .---command stderr------------
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\global-dtor-no-atexit.cpp:7:16: error: CHECK-NEXT: expected string not found in input
# | // CHECK-NEXT: call i32 @atexit(ptr @__dtor_a)
# | ^
# | <stdin>:20:73: note: scanning from here
# | call void @_ZN1AC1Ev(ptr noundef nonnull align 1 dereferenceable(1) @a)
# | ^
# | <stdin>:30:1: note: possible intended match here
# | define internal void @__dtor_a() #0 {
# | ^
# | C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\global-dtor-no-atexit.cpp:36:58: error: undefined variable: NUW
# | // CHECK: define internal void @__dtor__ZZ4funcvE2a1() [[NUW]]
# | ^
# | <stdin>:92:1: note: possible intended match here
# | define internal void @__dtor__ZZ4funcvE2a1() #0 {
# | ^
# |
# | Input file: <stdin>
# | Check file: C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\global-dtor-no-atexit.cpp
# |
# | -dump-input=help explains the following input dump.
# |
# | Input was:
# | <<<<<<
# | .
# | .
# | .
# | 15: @llvm.global_dtors = appending global [2 x { i32, ptr, ptr }] [{ i32, ptr, ptr } { i32 65535, ptr @__dtor_a, ptr null }, { i32, ptr, ptr } { i32 65535, ptr @__dtor_b, ptr null }]
# | 16:
# | 17: ; Function Attrs: noinline nounwind
# | 18: define internal void @__cxx_global_var_init() #0 {
# | 19: entry:
# | 20: call void @_ZN1AC1Ev(ptr noundef nonnull align 1 dereferenceable(1) @a)
# | next:7'0 { search range start (exclusive)
# | next:7'1 error: no match found in search range
# | 21: ret void
# | 22: }
# | 23:
# | 24: declare void @_ZN1AC1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #1
# | 25:
# | 26: ; Function Attrs: nounwind
# | 27: declare void @_ZN1AD1Ev(ptr noundef nonnull align 1 dereferenceable(1)) unnamed_addr #2
# | 28:
# | 29: ; Function Attrs: noinline nounwind
# | 30: define internal void @__dtor_a() #0 {
# | next:7'2 ? possible intended match
# | 31: entry:
# | 32: call void @_ZN1AD1Ev(ptr @a)
# | 33: ret void
# | 34: }
# | 35:
# | .
# | .
# | .
# | 46: call void @_ZN1AD1Ev(ptr @b)
# | 47: ret void
# | 48: }
# | 49:
# | 50: ; Function Attrs: mustprogress noinline nounwind optnone
# | 51: define dso_local void @_Z4funcv() #3 {
# | next:7'3 } search range end (exclusive)
# | 52: entry:
# | 53: %0 = load atomic i8, ptr @_ZGVZ4funcvE2a1 acquire, align 8
# | 54: %guard.uninitialized = icmp eq i8 %0, 0
# | 55: br i1 %guard.uninitialized, label %init.check, label %init.end, !prof !1
# | 56:
# | .
# | .
# | .
# | 76: br i1 %tobool3, label %init4, label %init.end5
# | 77:
# | 78: init4: ; preds = %init.check2
# | 79: call void @_ZN1AC1Ev(ptr noundef nonnull align 1 dereferenceable(1) @_ZZ4funcvE2a2)
# | 80: %5 = call i32 @atexit(ptr @__dtor__ZZ4funcvE2a2) #4
# | 81: call void @__cxa_guard_release(ptr @_ZGVZ4funcvE2a2) #4
# | check:36'0 { search range start (exclusive)
# | check:36'1 error: match failed for invalid pattern
# | check:36'2 undefined variable: NUW
# | 82: br label %init.end5
# | 83:
# | 84: init.end5: ; preds = %init4, %init.check2, %init.end
# | 85: ret void
# | 86: }
# | 87:
# | 88: ; Function Attrs: nounwind
# | 89: declare i32 @__cxa_guard_acquire(ptr) #4
# | 90:
# | 91: ; Function Attrs: noinline nounwind
# | 92: define internal void @__dtor__ZZ4funcvE2a1() #0 {
# | check:36'3 ? possible intended match
# | 93: entry:
# | 94: call void @_ZN1AD1Ev(ptr @_ZZ4funcvE2a1)
# | 95: ret void
# | 96: }
# | 97:
# | .
# | .
# | .
# | 123: attributes #4 = { nounwind }
# | 124:
# | 125: !llvm.ident = !{!0}
# | 126:
# | 127: !0 = !{!"clang version 24.0.0git (https://github.com/llvm/llvm-project 722b25546bcf3f25dfedfb540ecd01a58b8e8a77)"}
# | 128: !1 = !{!"branch_weights", i32 1, i32 1048575}
# | check:36'4 } search range end (exclusive)
# | >>>>>>
# `-----------------------------
# error: command failed with exit status: 1
--
```
</details>
<details>
<summary>Clang.CodeGenCXX/ptrauth-static-destructors.cpp</summary>
```
Exit Code: 2
Command Output (stdout):
--
# RUN: at line 1
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\24\include -nostdsysteminc -triple arm64-apple-ios -fptrauth-calls -emit-llvm -std=c++11 C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp --check-prefix=CXAATEXIT
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\24\include' -nostdsysteminc -triple arm64-apple-ios -fptrauth-calls -emit-llvm -std=c++11 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp' --check-prefix=CXAATEXIT
# note: command had no output on stdout or stderr
# RUN: at line 4
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\24\include -nostdsysteminc -triple arm64-apple-ios -fptrauth-calls -emit-llvm -std=c++11 C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp -o - -fno-use-cxa-atexit | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp --check-prefixes=ATEXIT,ATEXIT_DARWIN
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\24\include' -nostdsysteminc -triple arm64-apple-ios -fptrauth-calls -emit-llvm -std=c++11 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp' -o - -fno-use-cxa-atexit
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp' --check-prefixes=ATEXIT,ATEXIT_DARWIN
# note: command had no output on stdout or stderr
# RUN: at line 7
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\24\include -nostdsysteminc -triple aarch64-linux-gnu -fptrauth-calls -emit-llvm -std=c++11 C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp -o - | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp --check-prefix=CXAATEXIT
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\24\include' -nostdsysteminc -triple aarch64-linux-gnu -fptrauth-calls -emit-llvm -std=c++11 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp' -o -
# note: command had no output on stdout or stderr
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp' --check-prefix=CXAATEXIT
# note: command had no output on stdout or stderr
# RUN: at line 10
c:\_work\llvm-project\llvm-project\build\bin\clang.exe -cc1 -internal-isystem C:\_work\llvm-project\llvm-project\build\lib\clang\24\include -nostdsysteminc -triple aarch64-linux-gnu -fptrauth-calls -emit-llvm -std=c++11 C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp -o - -fno-use-cxa-atexit | c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp --check-prefixes=ATEXIT,ATEXIT_ELF
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\clang.exe' -cc1 -internal-isystem 'C:\_work\llvm-project\llvm-project\build\lib\clang\24\include' -nostdsysteminc -triple aarch64-linux-gnu -fptrauth-calls -emit-llvm -std=c++11 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp' -o - -fno-use-cxa-atexit
# .---command stderr------------
# | Assertion failed: isa<To>(Val) && "cast<Ty>() argument of incompatible type!", file C:\_work\llvm-project\llvm-project\llvm\include\llvm/Support/Casting.h, line 572
# | PLEASE submit a bug report to https://github.com/llvm/llvm-project/issues/ and include the crash backtrace and dumped files.
# | Stack dump:
# | 0. Program arguments: c:\\_work\\llvm-project\\llvm-project\\build\\bin\\clang.exe -cc1 -internal-isystem C:\\_work\\llvm-project\\llvm-project\\build\\lib\\clang\\24\\include -nostdsysteminc -triple aarch64-linux-gnu -fptrauth-calls -emit-llvm -std=c++11 C:\\_work\\llvm-project\\llvm-project\\clang\\test\\CodeGenCXX\\ptrauth-static-destructors.cpp -o - -fno-use-cxa-atexit
# | 1. <eof> parser at end of file
# | 2. C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp:33:5: LLVM IR generation of declaration 'global'
# | 3. C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp:33:5: Generating code for declaration 'global'
# | Exception Code: 0xC000001D
# | #0 0x00007ff65f21e7f6 (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x86e7f6)
# | #1 0x00007ff8fbedbb04 (C:\Windows\System32\ucrtbase.dll+0x7bb04)
# | #2 0x00007ff8fbedcad1 (C:\Windows\System32\ucrtbase.dll+0x7cad1)
# | #3 0x00007ff8fbede4a1 (C:\Windows\System32\ucrtbase.dll+0x7e4a1)
# | #4 0x00007ff8fbede6e1 (C:\Windows\System32\ucrtbase.dll+0x7e6e1)
# | #5 0x00007ff663852222 (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x4ea2222)
# | #6 0x00007ff6636d425c (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x4d2425c)
# | #7 0x00007ff6638509bc (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x4ea09bc)
# | #8 0x00007ff66385362d (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x4ea362d)
# | #9 0x00007ff663852c5b (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x4ea2c5b)
# | #10 0x00007ff6612504b1 (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x28a04b1)
# | #11 0x00007ff661243a02 (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x2893a02)
# | #12 0x00007ff661249d2b (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x2899d2b)
# | #13 0x00007ff6612422b0 (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x28922b0)
# | #14 0x00007ff6648cc68b (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x5f1c68b)
# | #15 0x00007ff6618ce2f7 (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x2f1e2f7)
# | #16 0x00007ff664820839 (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x5e70839)
# | #17 0x00007ff66182d9df (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x2e7d9df)
# | #18 0x00007ff65f36a780 (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x9ba780)
# | #19 0x00007ff65f4152ac (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0xa652ac)
# | #20 0x00007ff65e9b87ce (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x87ce)
# | #21 0x00007ff65e9b4144 (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x4144)
# | #22 0x00007ff65e9b28fa (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x28fa)
# | #23 0x00007ff65e9c78cc (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x178cc)
# | #24 0x00007ff665fbcc00 (c:\_work\llvm-project\llvm-project\build\bin\clang.exe+0x760cc00)
# | #25 0x00007ff8fc734cb0 (C:\Windows\System32\KERNEL32.DLL+0x14cb0)
# | #26 0x00007ff90f65edcb (C:\Windows\SYSTEM32\ntdll.dll+0x7edcb)
# `-----------------------------
# error: command failed with exit status: 0xc000001d
# executed command: 'c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe' 'C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp' --check-prefixes=ATEXIT,ATEXIT_ELF
# .---command stderr------------
# | FileCheck error: '<stdin>' is empty.
# | FileCheck command line: c:\_work\llvm-project\llvm-project\build\bin\filecheck.exe C:\_work\llvm-project\llvm-project\clang\test\CodeGenCXX\ptrauth-static-destructors.cpp --check-prefixes=ATEXIT,ATEXIT_ELF
# `-----------------------------
# error: command failed with exit status: 2
--
```
</details>
If these failures are unrelated to your changes (for example tests are broken or flaky at HEAD), please open an issue at https://github.com/llvm/llvm-project/issues and add the `infrastructure` label.
https://github.com/llvm/llvm-project/pull/211963
More information about the cfe-commits
mailing list