rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Gary Guo <gary@garyguo.net>
Cc: "Miguel Ojeda" <ojeda@kernel.org>,
	"Alex Gaynor" <alex.gaynor@gmail.com>,
	"Wedson Almeida Filho" <wedsonaf@gmail.com>,
	"Boqun Feng" <boqun.feng@gmail.com>,
	"Björn Roy Baron" <bjorn3_gh@protonmail.com>,
	rust-for-linux@vger.kernel.org, linux-kernel@vger.kernel.org,
	"Nick Desaulniers" <ndesaulniers@google.com>,
	"Wei Liu" <wei.liu@kernel.org>
Subject: Re: [PATCH v4] rust: compiler_builtins: make stubs non-global
Date: Wed, 7 Dec 2022 12:38:30 +0000	[thread overview]
Message-ID: <Y5CJRuwJlneWifEO@liuwe-devbox-debian-v2> (raw)
In-Reply-To: <20221205215000.2563281-1-gary@garyguo.net>

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.

      reply	other threads:[~2022-12-07 12:39 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-12-05 21:50 [PATCH v4] rust: compiler_builtins: make stubs non-global Gary Guo
2022-12-07 12:38 ` Wei Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y5CJRuwJlneWifEO@liuwe-devbox-debian-v2 \
    --to=wei.liu@kernel.org \
    --cc=alex.gaynor@gmail.com \
    --cc=bjorn3_gh@protonmail.com \
    --cc=boqun.feng@gmail.com \
    --cc=gary@garyguo.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=ndesaulniers@google.com \
    --cc=ojeda@kernel.org \
    --cc=rust-for-linux@vger.kernel.org \
    --cc=wedsonaf@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).