Skip to content

Commit 0da6d91

Browse files
authored
RuntimeLibcalls: Fix stacksmash on arm64ec (#152116)
Fix after 5478da9
1 parent 13600c7 commit 0da6d91

File tree

2 files changed

+20
-1
lines changed

2 files changed

+20
-1
lines changed

llvm/include/llvm/IR/RuntimeLibcalls.td

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1247,9 +1247,12 @@ defset list<RuntimeLibcallImpl> WinArm64ECDefaultRuntimeLibcallImpls = {
12471247
}
12481248
}
12491249

1250+
def arm64ec___stack_chk_fail : DuplicateLibcallImplWithPrefix<__stack_chk_fail, "#">;
1251+
12501252
def WindowsARM64ECSystemLibrary
12511253
: SystemRuntimeLibrary<isWindowsArm64EC,
1252-
(add WinArm64ECDefaultRuntimeLibcallImpls)>;
1254+
(add WinArm64ECDefaultRuntimeLibcallImpls,
1255+
arm64ec___stack_chk_fail)>;
12531256

12541257
//===----------------------------------------------------------------------===//
12551258
// AMDGPU Runtime Libcalls
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
; RUN: llc -mtriple=arm64ec-unknown-windows-gnu < %s | FileCheck %s
2+
3+
; CHECK-LABEL: func = "#func"
4+
; CHECK: bl "#other"
5+
; CHECK: bl "#__stack_chk_fail"
6+
define void @func() #0 {
7+
entry:
8+
%buf = alloca [10 x i8], align 1
9+
call void @other(ptr %buf) #1
10+
ret void
11+
}
12+
13+
declare void @other(ptr) #1
14+
15+
attributes #0 = { nounwind sspstrong }
16+
attributes #1 = { nounwind }

0 commit comments

Comments
 (0)