rust-for-linux.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] rust: fix export of bss symbols
@ 2024-08-15  7:49 Andreas Hindborg
  2024-08-15  8:02 ` Alice Ryhl
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Andreas Hindborg @ 2024-08-15  7:49 UTC (permalink / raw)
  To: Jens Axboe, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho
  Cc: Andreas Hindborg, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Alice Ryhl, Behme Dirk (XC-CP/ESB5),
	linux-block@vger.kernel.org, rust-for-linux, linux-kernel

From: Andreas Hindborg <a.hindborg@samsung.com>

Symbols in the bss segment are not currently exported. This is a problem
for rust modules that link against statics, that are resident in the kernel
image. This patch enables export of symbols in the bss segment.

Fixes: 2f7ab1267dc9 ("Kbuild: add Rust support")
Signed-off-by: Andreas Hindborg <a.hindborg@samsung.com>
---
 rust/Makefile | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/rust/Makefile b/rust/Makefile
index 1f10f92737f2..c890ec4b3618 100644
--- a/rust/Makefile
+++ b/rust/Makefile
@@ -305,7 +305,7 @@ $(obj)/bindings/bindings_helpers_generated.rs: $(src)/helpers.c FORCE
 quiet_cmd_exports = EXPORTS $@
       cmd_exports = \
 	$(NM) -p --defined-only $< \
-		| awk '/ (T|R|D) / {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$3}' > $@
+		| awk '/ (T|R|D|B) / {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$3}' > $@
 
 $(obj)/exports_core_generated.h: $(obj)/core.o FORCE
 	$(call if_changed,exports)
-- 
2.46.0




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

* Re: [PATCH 1/2] rust: fix export of bss symbols
  2024-08-15  7:49 [PATCH 1/2] rust: fix export of bss symbols Andreas Hindborg
@ 2024-08-15  8:02 ` Alice Ryhl
  2024-08-15 18:24 ` Gary Guo
  2024-08-21 10:50 ` Miguel Ojeda
  2 siblings, 0 replies; 4+ messages in thread
From: Alice Ryhl @ 2024-08-15  8:02 UTC (permalink / raw)
  To: Andreas Hindborg
  Cc: Jens Axboe, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
	Andreas Hindborg, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Behme Dirk (XC-CP/ESB5),
	linux-block@vger.kernel.org, rust-for-linux, linux-kernel

On Thu, Aug 15, 2024 at 9:49 AM Andreas Hindborg <nmi@metaspace.dk> wrote:
>
> From: Andreas Hindborg <a.hindborg@samsung.com>
>
> Symbols in the bss segment are not currently exported. This is a problem
> for rust modules that link against statics, that are resident in the kernel
> image. This patch enables export of symbols in the bss segment.
>
> Fixes: 2f7ab1267dc9 ("Kbuild: add Rust support")
> Signed-off-by: Andreas Hindborg <a.hindborg@samsung.com>

Looks good to me. I was using this change myself for some period of
time when looking into loading Rust Binder as a module, so I've
verified that the change works as intended in that context. I also
tried it again just now. Thanks for sending this upstream.

Reviewed-by: Alice Ryhl <aliceryhl@google.com>
Tested-by: Alice Ryhl <aliceryhl@google.com>

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

* Re: [PATCH 1/2] rust: fix export of bss symbols
  2024-08-15  7:49 [PATCH 1/2] rust: fix export of bss symbols Andreas Hindborg
  2024-08-15  8:02 ` Alice Ryhl
@ 2024-08-15 18:24 ` Gary Guo
  2024-08-21 10:50 ` Miguel Ojeda
  2 siblings, 0 replies; 4+ messages in thread
From: Gary Guo @ 2024-08-15 18:24 UTC (permalink / raw)
  To: Andreas Hindborg
  Cc: Jens Axboe, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
	Andreas Hindborg, Boqun Feng, Björn Roy Baron, Benno Lossin,
	Alice Ryhl, Behme Dirk (XC-CP/ESB5), linux-block@vger.kernel.org,
	rust-for-linux, linux-kernel

On Thu, 15 Aug 2024 07:49:30 +0000
Andreas Hindborg <nmi@metaspace.dk> wrote:

> From: Andreas Hindborg <a.hindborg@samsung.com>
> 
> Symbols in the bss segment are not currently exported. This is a problem
> for rust modules that link against statics, that are resident in the kernel
> image. This patch enables export of symbols in the bss segment.
> 
> Fixes: 2f7ab1267dc9 ("Kbuild: add Rust support")
> Signed-off-by: Andreas Hindborg <a.hindborg@samsung.com>

Reviewed-by: Gary Guo <gary@garyguo.net>

> ---
>  rust/Makefile | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/rust/Makefile b/rust/Makefile
> index 1f10f92737f2..c890ec4b3618 100644
> --- a/rust/Makefile
> +++ b/rust/Makefile
> @@ -305,7 +305,7 @@ $(obj)/bindings/bindings_helpers_generated.rs: $(src)/helpers.c FORCE
>  quiet_cmd_exports = EXPORTS $@
>        cmd_exports = \
>  	$(NM) -p --defined-only $< \
> -		| awk '/ (T|R|D) / {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$3}' > $@
> +		| awk '/ (T|R|D|B) / {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$3}' > $@
>  
>  $(obj)/exports_core_generated.h: $(obj)/core.o FORCE
>  	$(call if_changed,exports)


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

* Re: [PATCH 1/2] rust: fix export of bss symbols
  2024-08-15  7:49 [PATCH 1/2] rust: fix export of bss symbols Andreas Hindborg
  2024-08-15  8:02 ` Alice Ryhl
  2024-08-15 18:24 ` Gary Guo
@ 2024-08-21 10:50 ` Miguel Ojeda
  2 siblings, 0 replies; 4+ messages in thread
From: Miguel Ojeda @ 2024-08-21 10:50 UTC (permalink / raw)
  To: Andreas Hindborg
  Cc: Jens Axboe, Miguel Ojeda, Alex Gaynor, Wedson Almeida Filho,
	Andreas Hindborg, Boqun Feng, Gary Guo, Björn Roy Baron,
	Benno Lossin, Alice Ryhl, Behme Dirk (XC-CP/ESB5),
	linux-block@vger.kernel.org, rust-for-linux, linux-kernel

On Thu, Aug 15, 2024 at 9:49 AM Andreas Hindborg <nmi@metaspace.dk> wrote:
>
> From: Andreas Hindborg <a.hindborg@samsung.com>
>
> Symbols in the bss segment are not currently exported. This is a problem
> for rust modules that link against statics, that are resident in the kernel
> image. This patch enables export of symbols in the bss segment.
>
> Fixes: 2f7ab1267dc9 ("Kbuild: add Rust support")
> Signed-off-by: Andreas Hindborg <a.hindborg@samsung.com>

Applied to `rust-fixes` -- thanks everyone!

(I am sending the notice twice for this series, since somehow the
email threads got split into two in Lore, which also broke `b4`)

    [ Reworded slightly. - Miguel ]

Cheers,
Miguel

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

end of thread, other threads:[~2024-08-21 10:50 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-08-15  7:49 [PATCH 1/2] rust: fix export of bss symbols Andreas Hindborg
2024-08-15  8:02 ` Alice Ryhl
2024-08-15 18:24 ` Gary Guo
2024-08-21 10:50 ` Miguel Ojeda

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).