Skip to content

Commit dc7d034

Browse files
authored
Merge pull request llvm#519 from AMD-Lightning-Internal/amd/merge/upstream_merge_20250205235759
merge main into amd-staging
2 parents 853d495 + afd29e7 commit dc7d034

File tree

503 files changed

+27304
-6382
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

503 files changed

+27304
-6382
lines changed

bolt/test/AArch64/exceptions-plt.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
// REQUIRES: system-linux
44

5-
// RUN: %clangxx %cxxflags -O1 -Wl,-q,-znow %s -o %t.exe
5+
// RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
6+
// Link against a DSO to ensure PLT entries.
7+
// RUN: %clangxx %cxxflags -O1 -Wl,-q,-znow %s %t.so -o %t.exe
68
// RUN: llvm-bolt %t.exe -o %t.bolt.exe --plt=all --print-only=.*main.* \
79
// RUN: --print-finalized 2>&1 | FileCheck %s
810

bolt/test/AArch64/plt-call.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Verify that PLTCall optimization works.
22

3-
RUN: %clang %cflags %p/../Inputs/plt-tailcall.c \
3+
RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
4+
// Link against a DSO to ensure PLT entries.
5+
RUN: %clang %cflags %p/../Inputs/plt-tailcall.c %t.so \
46
RUN: -o %t -Wl,-q
57
RUN: llvm-bolt %t -o %t.bolt --plt=all --print-plt --print-only=foo | FileCheck %s
68

bolt/test/X86/callcont-fallthru.s

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
## Ensures that a call continuation fallthrough count is set when using
22
## pre-aggregated perf data.
33

4-
# RUN: %clangxx %cxxflags %s -o %t -Wl,-q -nostdlib
4+
# RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
5+
## Link against a DSO to ensure PLT entries.
6+
# RUN: %clangxx %cxxflags %s %t.so -o %t -Wl,-q -nostdlib
57
# RUN: link_fdata %s %t %t.pa1 PREAGG
68
# RUN: link_fdata %s %t %t.pa2 PREAGG2
79
# RUN: link_fdata %s %t %t.pa3 PREAGG3

bolt/test/X86/cfi-instrs-reordered.s

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,9 @@
33

44
# RUN: llvm-mc -filetype=obj -triple x86_64-unknown-unknown %s -o %t.o
55
# RUN: llvm-strip --strip-unneeded %t.o
6-
# RUN: %clangxx %cflags %t.o -o %t.exe
6+
# RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
7+
## Link against a DSO to ensure PLT entries.
8+
# RUN: %clangxx %cflags %t.o %t.so -o %t.exe
79
# RUN: llvm-bolt %t.exe -o %t --reorder-blocks=cache --print-after-lowering \
810
# RUN: --print-only=_Z10SolveCubicddddPiPd 2>&1 | FileCheck %s
911
#

bolt/test/X86/plt-call.test

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
// Verify that PLTCall optimization works.
22

3-
RUN: %clang %cflags %p/../Inputs/plt-tailcall.c \
3+
RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
4+
// Link against a DSO to ensure PLT entries.
5+
RUN: %clang %cflags %p/../Inputs/plt-tailcall.c %t.so \
46
RUN: -o %t -Wl,-q
57
RUN: llvm-bolt %t -o %t.bolt --plt=all --print-plt --print-only=foo | FileCheck %s
68

bolt/test/runtime/exceptions-plt.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@
22

33
// REQUIRES: system-linux
44

5-
// RUN: %clangxx %cxxflags -O1 -Wl,-q,-znow %s -o %t.exe
5+
// RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
6+
// Link against a DSO to ensure PLT entries.
7+
// RUN: %clangxx %cxxflags -O1 -Wl,-q,-znow %s %t.so -o %t.exe
68
// RUN: llvm-bolt %t.exe -o %t.bolt.exe --plt=all
79
// RUN: %t.bolt.exe
810

bolt/test/runtime/plt-lld.test

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,15 @@
11
// This test checks that the pointers to PLT are properly updated.
2-
// The test is using lld linker.
2+
// The test uses lld and links against a DSO to ensure PLT entries.
3+
RUN: %clang %cflags -fpic -shared -xc /dev/null -o %t.so
34

45
// Non-PIE:
5-
RUN: %clang %cflags -no-pie %p/../Inputs/plt.c -fuse-ld=lld \
6+
RUN: %clang %cflags -no-pie %p/../Inputs/plt.c %t.so -fuse-ld=lld \
67
RUN: -o %t.lld.exe -Wl,-q
78
RUN: llvm-bolt %t.lld.exe -o %t.lld.bolt.exe --use-old-text=0 --lite=0
89
RUN: %t.lld.bolt.exe | FileCheck %s
910

1011
// PIE:
11-
RUN: %clang %cflags -fPIC -pie %p/../Inputs/plt.c -fuse-ld=lld \
12+
RUN: %clang %cflags -fPIC -pie %p/../Inputs/plt.c %t.so -fuse-ld=lld \
1213
RUN: -o %t.lld.pie.exe -Wl,-q
1314
RUN: llvm-bolt %t.lld.pie.exe -o %t.lld.bolt.pie.exe --use-old-text=0 --lite=0
1415
RUN: %t.lld.bolt.pie.exe | FileCheck %s

clang/docs/ControlFlowIntegrity.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -336,6 +336,15 @@ cross-DSO function address equality. These properties make KCFI easier to
336336
adopt in low-level software. KCFI is limited to checking only function
337337
pointers, and isn't compatible with executable-only memory.
338338

339+
``-fsanitize-kcfi-arity``
340+
-----------------------------
341+
342+
For supported targets, this feature extends kCFI by telling the compiler to
343+
record information about each indirect-callable function's arity (i.e., the
344+
number of arguments passed in registers) into the binary. Some kernel CFI
345+
techniques, such as FineIBT, may be able to use this information to provide
346+
enhanced security.
347+
339348
Member Function Pointer Call Checking
340349
=====================================
341350

clang/docs/ReleaseNotes.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,8 @@ Bug Fixes to Attribute Support
145145
Bug Fixes to C++ Support
146146
^^^^^^^^^^^^^^^^^^^^^^^^
147147

148+
- Clang is now better at keeping track of friend function template instance contexts. (#GH55509)
149+
148150
Bug Fixes to AST Handling
149151
^^^^^^^^^^^^^^^^^^^^^^^^^
150152

@@ -241,6 +243,11 @@ Static Analyzer
241243
New features
242244
^^^^^^^^^^^^
243245

246+
A new flag - `-static-libclosure` was introduced to support statically linking
247+
the runtime for the Blocks extension on Windows. This flag currently only
248+
changes the code generation, and even then, only on Windows. This does not
249+
impact the linker behaviour like the other `-static-*` flags.
250+
244251
Crash and bug fixes
245252
^^^^^^^^^^^^^^^^^^^
246253

clang/docs/UsersManual.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2223,6 +2223,12 @@ are listed below.
22232223

22242224
This option is currently experimental.
22252225

2226+
.. option:: -fsanitize-kcfi-arity
2227+
2228+
Extends kernel indirect call forward-edge control flow integrity with
2229+
additional function arity information (for supported targets). See
2230+
:doc:`ControlFlowIntegrity` for more details.
2231+
22262232
.. option:: -fstrict-vtable-pointers
22272233

22282234
Enable optimizations based on the strict rules for overwriting polymorphic

0 commit comments

Comments
 (0)