lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK7LNARTX+2Z=pnGbbUepxskE+KZ1f5YsfQukJ88ijPBQt9_GA@mail.gmail.com>
Date:   Wed, 7 Sep 2022 03:08:36 +0900
From:   Masahiro Yamada <masahiroy@...nel.org>
To:     Miguel Ojeda <ojeda@...nel.org>
Cc:     Linus Torvalds <torvalds@...ux-foundation.org>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        rust-for-linux@...r.kernel.org,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
        Jarkko Sakkinen <jarkko@...nel.org>,
        Alex Gaynor <alex.gaynor@...il.com>,
        Finn Behrens <me@...enk.de>,
        Adam Bratschi-Kaye <ark.email@...il.com>,
        Wedson Almeida Filho <wedsonaf@...gle.com>,
        Michael Ellerman <mpe@...erman.id.au>,
        Sven Van Asbroeck <thesven73@...il.com>,
        Gary Guo <gary@...yguo.net>,
        Boris-Chengbiao Zhou <bobo1239@....de>,
        Boqun Feng <boqun.feng@...il.com>,
        Douglas Su <d0u9.su@...look.com>,
        Dariusz Sosnowski <dsosnowski@...snowski.pl>,
        Antonio Terceiro <antonio.terceiro@...aro.org>,
        Daniel Xu <dxu@...uu.xyz>, Miguel Cano <macanroj@...il.com>,
        David Gow <davidgow@...gle.com>,
        Tiago Lam <tiagolam@...il.com>,
        Björn Roy Baron <bjorn3_gh@...tonmail.com>,
        Martin Rodriguez Reboredo <yakoyoku@...il.com>,
        Michal Marek <michal.lkml@...kovi.net>,
        Nick Desaulniers <ndesaulniers@...gle.com>,
        Russell King <linux@...linux.org.uk>,
        Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>,
        Benjamin Herrenschmidt <benh@...nel.crashing.org>,
        Paul Mackerras <paulus@...ba.org>,
        Paul Walmsley <paul.walmsley@...ive.com>,
        Palmer Dabbelt <palmer@...belt.com>,
        Albert Ou <aou@...s.berkeley.edu>,
        Richard Weinberger <richard@....at>,
        Anton Ivanov <anton.ivanov@...bridgegreys.com>,
        Johannes Berg <johannes@...solutions.net>,
        Thomas Gleixner <tglx@...utronix.de>,
        Ingo Molnar <mingo@...hat.com>, Borislav Petkov <bp@...en8.de>,
        Dave Hansen <dave.hansen@...ux.intel.com>,
        X86 ML <x86@...nel.org>, "H. Peter Anvin" <hpa@...or.com>,
        Linux Kbuild mailing list <linux-kbuild@...r.kernel.org>,
        linux-arm-kernel <linux-arm-kernel@...ts.infradead.org>,
        linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
        "open list:SIFIVE DRIVERS" <linux-riscv@...ts.infradead.org>,
        linux-um@...ts.infradead.org
Subject: Re: [PATCH v8 27/31] Kbuild: add Rust support

On Tue, Aug 2, 2022 at 10:53 AM Miguel Ojeda <ojeda@...nel.org> wrote:
>
> Having all the new files in place, we now enable Rust support
> in the build system, including `Kconfig` entries related to Rust,
> the Rust configuration printer, the target specification
> generation script, the version detection script and a few
> other bits.
>
> Co-developed-by: Alex Gaynor <alex.gaynor@...il.com>
> Signed-off-by: Alex Gaynor <alex.gaynor@...il.com>
> Co-developed-by: Finn Behrens <me@...enk.de>
> Signed-off-by: Finn Behrens <me@...enk.de>
> Co-developed-by: Adam Bratschi-Kaye <ark.email@...il.com>
> Signed-off-by: Adam Bratschi-Kaye <ark.email@...il.com>
> Co-developed-by: Wedson Almeida Filho <wedsonaf@...gle.com>
> Signed-off-by: Wedson Almeida Filho <wedsonaf@...gle.com>
> Co-developed-by: Michael Ellerman <mpe@...erman.id.au>
> Signed-off-by: Michael Ellerman <mpe@...erman.id.au>
> Co-developed-by: Sven Van Asbroeck <thesven73@...il.com>
> Signed-off-by: Sven Van Asbroeck <thesven73@...il.com>
> Co-developed-by: Gary Guo <gary@...yguo.net>
> Signed-off-by: Gary Guo <gary@...yguo.net>
> Co-developed-by: Boris-Chengbiao Zhou <bobo1239@....de>
> Signed-off-by: Boris-Chengbiao Zhou <bobo1239@....de>
> Co-developed-by: Boqun Feng <boqun.feng@...il.com>
> Signed-off-by: Boqun Feng <boqun.feng@...il.com>
> Co-developed-by: Douglas Su <d0u9.su@...look.com>
> Signed-off-by: Douglas Su <d0u9.su@...look.com>
> Co-developed-by: Dariusz Sosnowski <dsosnowski@...snowski.pl>
> Signed-off-by: Dariusz Sosnowski <dsosnowski@...snowski.pl>
> Co-developed-by: Antonio Terceiro <antonio.terceiro@...aro.org>
> Signed-off-by: Antonio Terceiro <antonio.terceiro@...aro.org>
> Co-developed-by: Daniel Xu <dxu@...uu.xyz>
> Signed-off-by: Daniel Xu <dxu@...uu.xyz>
> Co-developed-by: Miguel Cano <macanroj@...il.com>
> Signed-off-by: Miguel Cano <macanroj@...il.com>
> Co-developed-by: David Gow <davidgow@...gle.com>
> Signed-off-by: David Gow <davidgow@...gle.com>
> Co-developed-by: Tiago Lam <tiagolam@...il.com>
> Signed-off-by: Tiago Lam <tiagolam@...il.com>
> Co-developed-by: Björn Roy Baron <bjorn3_gh@...tonmail.com>
> Signed-off-by: Björn Roy Baron <bjorn3_gh@...tonmail.com>
> Co-developed-by: Martin Rodriguez Reboredo <yakoyoku@...il.com>
> Signed-off-by: Martin Rodriguez Reboredo <yakoyoku@...il.com>
> Signed-off-by: Miguel Ojeda <ojeda@...nel.org>
> ---
>  .gitignore                                   |   6 +
>  .rustfmt.toml                                |  12 +
>  Makefile                                     | 172 +++++++-
>  arch/Kconfig                                 |   6 +
>  arch/arm/Kconfig                             |   1 +
>  arch/arm64/Kconfig                           |   1 +
>  arch/powerpc/Kconfig                         |   1 +
>  arch/riscv/Kconfig                           |   1 +
>  arch/riscv/Makefile                          |   5 +
>  arch/um/Kconfig                              |   1 +
>  arch/x86/Kconfig                             |   1 +
>  arch/x86/Makefile                            |  10 +
>  include/linux/compiler_types.h               |   6 +-
>  init/Kconfig                                 |  46 +-
>  lib/Kconfig.debug                            |  82 ++++
>  rust/.gitignore                              |  10 +
>  rust/Makefile                                | 415 +++++++++++++++++++
>  rust/bindgen_parameters                      |  21 +
>  scripts/.gitignore                           |   1 +
>  scripts/Kconfig.include                      |   6 +-
>  scripts/Makefile                             |   3 +
>  scripts/Makefile.build                       |  60 +++
>  scripts/Makefile.debug                       |  10 +
>  scripts/Makefile.host                        |  34 +-
>  scripts/Makefile.lib                         |  12 +
>  scripts/Makefile.modfinal                    |   8 +-
>  scripts/cc-version.sh                        |  12 +-
>  scripts/generate_rust_target.rs              | 232 +++++++++++
>  scripts/is_rust_module.sh                    |  16 +
>  scripts/kconfig/confdata.c                   |  75 ++++
>  scripts/min-tool-version.sh                  |   6 +
>  scripts/rust-is-available-bindgen-libclang.h |   2 +
>  scripts/rust-is-available.sh                 | 160 +++++++
>  33 files changed, 1408 insertions(+), 26 deletions(-)
>  create mode 100644 .rustfmt.toml
>  create mode 100644 rust/.gitignore
>  create mode 100644 rust/Makefile
>  create mode 100644 rust/bindgen_parameters
>  create mode 100644 scripts/generate_rust_target.rs
>  create mode 100755 scripts/is_rust_module.sh
>  create mode 100644 scripts/rust-is-available-bindgen-libclang.h
>  create mode 100755 scripts/rust-is-available.sh
>






> @@ -151,7 +162,8 @@ config WERROR
>         default COMPILE_TEST
>         help
>           A kernel build should not cause any compiler warnings, and this
> -         enables the '-Werror' flag to enforce that rule by default.
> +         enables the '-Werror' (for C) and '-Dwarnings' (for Rust) flags
> +         to enforce that rule by default.
>
>           However, if you have a new (or very old) compiler with odd and
>           unusual warnings, or you have some architecture with problems,
> @@ -1898,6 +1910,38 @@ config PROFILING
>           Say Y here to enable the extended profiling support mechanisms used
>           by profilers.
>
> +config RUST
> +       bool "Rust support"
> +       depends on HAVE_RUST
> +       depends on RUST_IS_AVAILABLE
> +       depends on !MODVERSIONS
> +       depends on !GCC_PLUGINS
> +       depends on !RANDSTRUCT
> +       depends on !DEBUG_INFO_BTF
> +       select CONSTRUCTORS
> +       help
> +         Enables Rust support in the kernel.
> +
> +         This allows other Rust-related options, like drivers written in Rust,
> +         to be selected.
> +
> +         It is also required to be able to load external kernel modules
> +         written in Rust.
> +
> +         See Documentation/rust/ for more information.
> +
> +         If unsure, say N.
> +
> +config RUSTC_VERSION_TEXT
> +       string
> +       depends on RUST
> +       default $(shell,command -v $(RUSTC) >/dev/null 2>&1 && $(RUSTC) --version || echo n)
> +
> +config BINDGEN_VERSION_TEXT
> +       string
> +       depends on RUST
> +       default $(shell,command -v $(BINDGEN) >/dev/null 2>&1 && $(BINDGEN) --version || echo n)
> +



Where are these config options used?


I grep'ed but no hit.


masahiro@zoe:~/ref/linux-next$ git grep RUSTC_VERSION_TEXT
init/Kconfig:config RUSTC_VERSION_TEXT
masahiro@zoe:~/ref/linux-next$ git grep BINDGEN_VERSION_TEXT
init/Kconfig:config BINDGEN_VERSION_TEXT



> --
> 2.37.1
>


--
Best Regards
Masahiro Yamada

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ