mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* __ubsan_handle_type_mismatch converted to  __ubsan_handle_type_mismatch_v1
@ 2017-10-06  2:29 Sodagudi Prasad
  2017-10-06  8:45 ` Andrey Ryabinin
  0 siblings, 1 reply; 4+ messages in thread
From: Sodagudi Prasad @ 2017-10-06  2:29 UTC (permalink / raw)
  To: aryabinin, nicolas.iooss_linux, akpm, mingo; +Cc: linux-kernel

Hi All,

Based on below links __ubsan_handle_type_mismatch has been renamed to  
__ubsan_handle_type_mismatch_v1.

https://github.com/llvm-mirror/compiler-rt/commit/56faee71af1888ba12ab076b3d1f9bbe223493df#diff-21369cc6f3917b27df3ced8de89cf134
https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg535130.html


When I tried to compile the kernel with LLVM seen following errors.
arch/arm64/kernel/traps.o: In function `dump_backtrace':
kernel/arch/arm64/kernel/traps.c:192: undefined reference to 
`__ubsan_handle_type_mismatch_v1'
kernel/arch/arm64/kernel/traps.c:192: undefined reference to 
`__ubsan_handle_type_mismatch_v1'
kernel/arch/arm64/kernel/traps.c:192: undefined reference to 
`__ubsan_handle_type_mismatch_v1'
kernel/arch/arm64/kernel/traps.c:192: undefined reference to 
`__ubsan_handle_type_mismatch_v1'
arch/arm64/kernel/traps.o: In function `dump_mem':


Can I add __ubsan_handle_type_mismatch_v1 API similar to  
__ubsan_handle_type_mismatch()(I will send path for review)?
If both apis are present, then there will be backward compatibility.  
Let me know if you have any other suggestions for this issue.

-Thanks, Prasad

-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora 
Forum,
Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: __ubsan_handle_type_mismatch converted to __ubsan_handle_type_mismatch_v1
  2017-10-06  2:29 __ubsan_handle_type_mismatch converted to __ubsan_handle_type_mismatch_v1 Sodagudi Prasad
@ 2017-10-06  8:45 ` Andrey Ryabinin
  2017-10-10  7:06   ` [PATCH] UBSAN: Add __ubsan_handle_type_mismatch_v1 handler Prasad Sodagudi
  0 siblings, 1 reply; 4+ messages in thread
From: Andrey Ryabinin @ 2017-10-06  8:45 UTC (permalink / raw)
  To: Sodagudi Prasad, nicolas.iooss_linux, akpm, mingo; +Cc: linux-kernel



On 10/06/2017 05:29 AM, Sodagudi Prasad wrote:
> Hi All,
> 
> Based on below links __ubsan_handle_type_mismatch has been renamed to  __ubsan_handle_type_mismatch_v1.
> 
> https://github.com/llvm-mirror/compiler-rt/commit/56faee71af1888ba12ab076b3d1f9bbe223493df#diff-21369cc6f3917b27df3ced8de89cf134
> https://www.mail-archive.com/gcc-bugs@gcc.gnu.org/msg535130.html
> 
> 
> When I tried to compile the kernel with LLVM seen following errors.
> arch/arm64/kernel/traps.o: In function `dump_backtrace':
> kernel/arch/arm64/kernel/traps.c:192: undefined reference to `__ubsan_handle_type_mismatch_v1'
> kernel/arch/arm64/kernel/traps.c:192: undefined reference to `__ubsan_handle_type_mismatch_v1'
> kernel/arch/arm64/kernel/traps.c:192: undefined reference to `__ubsan_handle_type_mismatch_v1'
> kernel/arch/arm64/kernel/traps.c:192: undefined reference to `__ubsan_handle_type_mismatch_v1'
> arch/arm64/kernel/traps.o: In function `dump_mem':
> 
> 
> Can I add __ubsan_handle_type_mismatch_v1 API similar to  __ubsan_handle_type_mismatch()(I will send path for review)?
> If both apis are present, then there will be backward compatibility.  Let me know if you have any other suggestions for this issue.

Sounds good, send the patch please.

> 
> -Thanks, Prasad
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH] UBSAN: Add __ubsan_handle_type_mismatch_v1 handler
  2017-10-06  8:45 ` Andrey Ryabinin
@ 2017-10-10  7:06   ` Prasad Sodagudi
  2017-10-10 12:22     ` Andrey Ryabinin
  0 siblings, 1 reply; 4+ messages in thread
From: Prasad Sodagudi @ 2017-10-10  7:06 UTC (permalink / raw)
  To: aryabinin, nicolas.iooss_linux, akpm, mingo; +Cc: linux-kernel, psodagud

In LLVM __ubsan_handle_type_mismatch handler is renamed to
 __ubsan_handle_type_mismatch_v1. Add support for
__ubsan_handle_type_mismatch_v1 handler to avoid compilation
issues with latest llvm tool chain. Also keeping
__ubsan_handle_type_mismatch handler for backward compatibility.

Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
---
 lib/ubsan.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/lib/ubsan.c b/lib/ubsan.c
index fb0409d..9baf17d 100644
--- a/lib/ubsan.c
+++ b/lib/ubsan.c
@@ -328,6 +328,14 @@ void __ubsan_handle_type_mismatch(struct type_mismatch_data *data,
 }
 EXPORT_SYMBOL(__ubsan_handle_type_mismatch);
 
+void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data *data,
+				unsigned long ptr)
+{
+	__ubsan_handle_type_mismatch(data, ptr);
+}
+EXPORT_SYMBOL(__ubsan_handle_type_mismatch_v1);
+
+
 void __ubsan_handle_nonnull_return(struct nonnull_return_data *data)
 {
 	unsigned long flags;
-- 
The Qualcomm Innovation Center, Inc. is a member of the Code Aurora Forum,
a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] UBSAN: Add __ubsan_handle_type_mismatch_v1 handler
  2017-10-10  7:06   ` [PATCH] UBSAN: Add __ubsan_handle_type_mismatch_v1 handler Prasad Sodagudi
@ 2017-10-10 12:22     ` Andrey Ryabinin
  0 siblings, 0 replies; 4+ messages in thread
From: Andrey Ryabinin @ 2017-10-10 12:22 UTC (permalink / raw)
  To: Prasad Sodagudi, nicolas.iooss_linux, akpm, mingo; +Cc: linux-kernel

On 10/10/2017 10:06 AM, Prasad Sodagudi wrote:
> In LLVM __ubsan_handle_type_mismatch handler is renamed to
>  __ubsan_handle_type_mismatch_v1. Add support for
> __ubsan_handle_type_mismatch_v1 handler to avoid compilation
> issues with latest llvm tool chain. Also keeping
> __ubsan_handle_type_mismatch handler for backward compatibility.
> 
> Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
> ---

NACK. It wasn't *just* the rename, that wouldn't make any sense.
It was renamed because of the change in the ABI, which is not reflected in your patch,
so it can't work.


>  lib/ubsan.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/lib/ubsan.c b/lib/ubsan.c
> index fb0409d..9baf17d 100644
> --- a/lib/ubsan.c
> +++ b/lib/ubsan.c
> @@ -328,6 +328,14 @@ void __ubsan_handle_type_mismatch(struct type_mismatch_data *data,
>  }
>  EXPORT_SYMBOL(__ubsan_handle_type_mismatch);
>  
> +void __ubsan_handle_type_mismatch_v1(struct type_mismatch_data *data,
> +				unsigned long ptr)
> +{
> +	__ubsan_handle_type_mismatch(data, ptr);
> +}
> +EXPORT_SYMBOL(__ubsan_handle_type_mismatch_v1);
> +
> +
>  void __ubsan_handle_nonnull_return(struct nonnull_return_data *data)
>  {
>  	unsigned long flags;
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2017-10-10 12:19 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-10-06  2:29 __ubsan_handle_type_mismatch converted to __ubsan_handle_type_mismatch_v1 Sodagudi Prasad
2017-10-06  8:45 ` Andrey Ryabinin
2017-10-10  7:06   ` [PATCH] UBSAN: Add __ubsan_handle_type_mismatch_v1 handler Prasad Sodagudi
2017-10-10 12:22     ` Andrey Ryabinin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

Powered by JetHome