@@ -124,15 +124,28 @@ typedef s64 s_max;
124
124
typedef u64 u_max ;
125
125
#endif
126
126
127
- void __ubsan_handle_divrem_overflow (void * _data , void * lhs , void * rhs );
128
- void __ubsan_handle_type_mismatch (struct type_mismatch_data * data , void * ptr );
129
- void __ubsan_handle_type_mismatch_v1 (void * _data , void * ptr );
130
- void __ubsan_handle_out_of_bounds (void * _data , void * index );
131
- void __ubsan_handle_shift_out_of_bounds (void * _data , void * lhs , void * rhs );
132
- void __ubsan_handle_builtin_unreachable (void * _data );
133
- void __ubsan_handle_load_invalid_value (void * _data , void * val );
134
- void __ubsan_handle_alignment_assumption (void * _data , unsigned long ptr ,
135
- unsigned long align ,
136
- unsigned long offset );
127
+ /*
128
+ * When generating Runtime Calls, Clang doesn't respect the -mregparm=3
129
+ * option used on i386: https://github.com/llvm/llvm-project/issues/89670
130
+ * Fix this for earlier Clang versions by forcing the calling convention
131
+ * to use non-register arguments.
132
+ */
133
+ #if defined(CONFIG_X86_32 ) && \
134
+ defined(CONFIG_CC_IS_CLANG ) && CONFIG_CLANG_VERSION < 190000
135
+ # define ubsan_linkage asmlinkage
136
+ #else
137
+ # define ubsan_linkage
138
+ #endif
139
+
140
+ void ubsan_linkage __ubsan_handle_divrem_overflow (void * _data , void * lhs , void * rhs );
141
+ void ubsan_linkage __ubsan_handle_type_mismatch (struct type_mismatch_data * data , void * ptr );
142
+ void ubsan_linkage __ubsan_handle_type_mismatch_v1 (void * _data , void * ptr );
143
+ void ubsan_linkage __ubsan_handle_out_of_bounds (void * _data , void * index );
144
+ void ubsan_linkage __ubsan_handle_shift_out_of_bounds (void * _data , void * lhs , void * rhs );
145
+ void ubsan_linkage __ubsan_handle_builtin_unreachable (void * _data );
146
+ void ubsan_linkage __ubsan_handle_load_invalid_value (void * _data , void * val );
147
+ void ubsan_linkage __ubsan_handle_alignment_assumption (void * _data , unsigned long ptr ,
148
+ unsigned long align ,
149
+ unsigned long offset );
137
150
138
151
#endif
0 commit comments