Skip to content

Commit e332938

Browse files
GONG, Ruiqirostedt
authored andcommitted
samples: ftrace: Replace bti assembly with hint for older compiler
When cross-building the arm64 kernel with allmodconfig using GCC 9.4, the following error occurs on multiple files under samples/ftrace/: /tmp/ccPC1ODs.s: Assembler messages: /tmp/ccPC1ODs.s:8: Error: selected processor does not support `bti c' Fix this issue by replacing `bti c` with `hint 34`, which is compatible for the older compiler. Link: https://lore.kernel.org/linux-trace-kernel/20230820111509.1470826-1-gongruiqi@huaweicloud.com Cc: Masami Hiramatsu <mhiramat@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: Florent Revest <revest@chromium.org> Fixes: 8c3526f ("arm64: ftrace: Add direct call trampoline samples support") Acked-by: Mark Rutland <mark.rutland@arm.com> Signed-off-by: GONG, Ruiqi <gongruiqi1@huawei.com> Signed-off-by: Steven Rostedt (Google) <rostedt@goodmis.org>
1 parent c2489bb commit e332938

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

samples/ftrace/ftrace-direct-modify.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,7 @@ asm (
105105
" .type my_tramp1, @function\n"
106106
" .globl my_tramp1\n"
107107
" my_tramp1:"
108-
" bti c\n"
108+
" hint 34\n" // bti c
109109
" sub sp, sp, #16\n"
110110
" stp x9, x30, [sp]\n"
111111
" bl my_direct_func1\n"
@@ -117,7 +117,7 @@ asm (
117117
" .type my_tramp2, @function\n"
118118
" .globl my_tramp2\n"
119119
" my_tramp2:"
120-
" bti c\n"
120+
" hint 34\n" // bti c
121121
" sub sp, sp, #16\n"
122122
" stp x9, x30, [sp]\n"
123123
" bl my_direct_func2\n"

samples/ftrace/ftrace-direct-multi-modify.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ asm (
112112
" .type my_tramp1, @function\n"
113113
" .globl my_tramp1\n"
114114
" my_tramp1:"
115-
" bti c\n"
115+
" hint 34\n" // bti c
116116
" sub sp, sp, #32\n"
117117
" stp x9, x30, [sp]\n"
118118
" str x0, [sp, #16]\n"
@@ -127,7 +127,7 @@ asm (
127127
" .type my_tramp2, @function\n"
128128
" .globl my_tramp2\n"
129129
" my_tramp2:"
130-
" bti c\n"
130+
" hint 34\n" // bti c
131131
" sub sp, sp, #32\n"
132132
" stp x9, x30, [sp]\n"
133133
" str x0, [sp, #16]\n"

samples/ftrace/ftrace-direct-multi.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ asm (
7575
" .type my_tramp, @function\n"
7676
" .globl my_tramp\n"
7777
" my_tramp:"
78-
" bti c\n"
78+
" hint 34\n" // bti c
7979
" sub sp, sp, #32\n"
8080
" stp x9, x30, [sp]\n"
8181
" str x0, [sp, #16]\n"

samples/ftrace/ftrace-direct-too.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ asm (
8181
" .type my_tramp, @function\n"
8282
" .globl my_tramp\n"
8383
" my_tramp:"
84-
" bti c\n"
84+
" hint 34\n" // bti c
8585
" sub sp, sp, #48\n"
8686
" stp x9, x30, [sp]\n"
8787
" stp x0, x1, [sp, #16]\n"

samples/ftrace/ftrace-direct.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ asm (
7272
" .type my_tramp, @function\n"
7373
" .globl my_tramp\n"
7474
" my_tramp:"
75-
" bti c\n"
75+
" hint 34\n" // bti c
7676
" sub sp, sp, #32\n"
7777
" stp x9, x30, [sp]\n"
7878
" str x0, [sp, #16]\n"

0 commit comments

Comments
 (0)