lkml.org 
[lkml]   [2022]   [Dec]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4] rust: compiler_builtins: make stubs non-global
On Mon, Dec 05, 2022 at 09:50:00PM +0000, Gary Guo wrote:
> Currently we define a number of stubs for compiler-builtin intrinsics
> that compiled libcore generates. The defined stubs are weak so they will
> not conflict with genuine implementation of these intrinsics, but their
> effect is global and will cause non-libcore code that accidently
> generate these intrinsics calls compile and bug on runtime.
>
> Instead of defining a stub that can affect all code, this patch uses
> objcopy's `--redefine-sym` flag to redirect these calls (from libcore
> only) to a prefixed version (e.g. redirect `__multi3` to `__rust_multi3`),
> so we can define panciking stubs that are only visible to libcore.
>
> This patch was previously discussed on GitHub [1]. This approach was also
> independently proposed by Nick Desaulniers in [2].
>
> Link: https://github.com/Rust-for-Linux/linux/pull/779 [1]
> Link: https://lore.kernel.org/lkml/CAKwvOdkc0Qhwu=gfe1+H23TnAa6jnO6A3ZCO687dH6mSrATmDA@mail.gmail.com/
> Suggested-by: Nick Desaulniers <ndesaulniers@google.com>
> Acked-by: Nick Desaulniers <ndesaulniers@google.com>
> Signed-off-by: Gary Guo <gary@garyguo.net>

Reviewed-by: Wei Liu <wei.liu@kernel.org>

It seems that the only difference between v3 and v4 is Nick's ack.

You can put a changelog by adding a `---` section -- it will be stripped
by git-am automatically.

Thanks,
Wei.

\
 
 \ /
  Last update: 2022-12-07 13:41    [W:0.043 / U:0.132 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site