<feed xmlns='http://www.w3.org/2005/Atom'>
<title>user/sven/linux.git/scripts/is_rust_module.sh, branch v6.4.3</title>
<subtitle>Linux Kernel
</subtitle>
<id>https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.4.3</id>
<link rel='self' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/atom?h=v6.4.3'/>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/'/>
<updated>2023-04-19T17:28:49Z</updated>
<entry>
<title>rust: fix regexp in scripts/is_rust_module.sh</title>
<updated>2023-04-19T17:28:49Z</updated>
<author>
<name>Andrea Righi</name>
<email>andrea.righi@canonical.com</email>
</author>
<published>2023-02-10T15:26:22Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=ccc4505454db10402d5284f22d8b7db62e636fc5'/>
<id>urn:sha1:ccc4505454db10402d5284f22d8b7db62e636fc5</id>
<content type='text'>
nm can use "R" or "r" to show read-only data sections, but
scripts/is_rust_module.sh can only recognize "r", so with some versions
of binutils it can fail to detect if a module is a Rust module or not.

Right now we're using this script only to determine if we need to skip
BTF generation (that is disabled globally if CONFIG_RUST is enabled),
but it's still nice to fix this script to do the proper job.

Moreover, with this patch applied I can also relax the constraint of
"RUST depends on !DEBUG_INFO_BTF" and build a kernel with Rust and BTF
enabled at the same time (of course BTF generation is still skipped for
Rust modules).

[ Miguel: The actual reason is likely to be a change on the Rust
  compiler between 1.61.0 and 1.62.0:

    echo '#[used] static S: () = ();' |
        rustup run 1.61.0 rustc --emit=obj --crate-type=lib - &amp;&amp;
        nm rust_out.o

    echo '#[used] static S: () = ();' |
        rustup run 1.62.0 rustc --emit=obj --crate-type=lib - &amp;&amp;
        nm rust_out.o

  Gives:

    0000000000000000 r _ZN8rust_out1S17h48027ce0da975467E
    0000000000000000 R _ZN8rust_out1S17h58e1f3d9c0e97cefE

  See https://godbolt.org/z/KE6jneoo4. ]

Signed-off-by: Andrea Righi &lt;andrea.righi@canonical.com&gt;
Reviewed-by: Vincenzo Palazzo &lt;vincenzopalazzodev@gmail.com&gt;
Reviewed-by: Eric Curtin &lt;ecurtin@redhat.com&gt;
Reviewed-by: Martin Rodriguez Reboredo &lt;yakoyoku@gmail.com&gt;
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
<entry>
<title>scripts: add `is_rust_module.sh`</title>
<updated>2022-09-28T07:02:06Z</updated>
<author>
<name>Daniel Xu</name>
<email>dxu@dxuuu.xyz</email>
</author>
<published>2022-08-04T10:55:07Z</published>
<link rel='alternate' type='text/html' href='https://git.stealer.net/cgit.cgi/user/sven/linux.git/commit/?id=e4b69cb9a99a567d1611f9cced92f475ae224cdb'/>
<id>urn:sha1:e4b69cb9a99a567d1611f9cced92f475ae224cdb</id>
<content type='text'>
This script is used to detect whether a kernel module is written
in Rust.

It will later be used to disable BTF generation on Rust modules as
BTF does not yet support Rust.

Reviewed-by: Kees Cook &lt;keescook@chromium.org&gt;
Reviewed-by: Greg Kroah-Hartman &lt;gregkh@linuxfoundation.org&gt;
Co-developed-by: Alex Gaynor &lt;alex.gaynor@gmail.com&gt;
Signed-off-by: Alex Gaynor &lt;alex.gaynor@gmail.com&gt;
Co-developed-by: Wedson Almeida Filho &lt;wedsonaf@google.com&gt;
Signed-off-by: Wedson Almeida Filho &lt;wedsonaf@google.com&gt;
Signed-off-by: Daniel Xu &lt;dxu@dxuuu.xyz&gt;
Co-developed-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
Signed-off-by: Miguel Ojeda &lt;ojeda@kernel.org&gt;
</content>
</entry>
</feed>
