diff options
| author | Miguel Ojeda <[email protected]> | 2024-09-02 16:55:28 +0000 |
|---|---|---|
| committer | Miguel Ojeda <[email protected]> | 2024-09-05 20:44:18 +0000 |
| commit | 6e74c6b5a42e6a7313fcd29e814f211b392a00f5 (patch) | |
| tree | 3513d3a3f1ce1fb1b627f9742d09b0869cea63d4 /scripts/generate_rust_target.rs | |
| parent | rust: avoid `box_uninit_write` feature (diff) | |
| download | kernel-6e74c6b5a42e6a7313fcd29e814f211b392a00f5.tar.gz kernel-6e74c6b5a42e6a7313fcd29e814f211b392a00f5.zip | |
kbuild: rust: add `CONFIG_RUSTC_VERSION`
Now that we support several Rust versions, introduce
`CONFIG_RUSTC_VERSION` so that it can be used in Kconfig to enable and
disable configuration options based on the `rustc` version.
The approach taken resembles `pahole`'s -- see commit 613fe1692377
("kbuild: Add CONFIG_PAHOLE_VERSION"), i.e. a simple version parsing
without trying to identify several kinds of compilers, since so far
there is only one (`rustc`).
However, unlike `pahole`'s, we also print a zero if executing failed for
any reason, rather than checking if the command is found and executable
(which still leaves things like a file that exists and is executable,
but e.g. is built for another platform [1]). An equivalent approach to
the one here was also submitted for `pahole` [2].
Link: https://lore.kernel.org/rust-for-linux/CANiq72=4vX_tJMJLE6e+bg7ZECHkS-AQpm8GBzuK75G1EB7+Nw@mail.gmail.com/ [1]
Link: https://lore.kernel.org/linux-kbuild/[email protected]/ [2]
Reviewed-by: Nicolas Schier <[email protected]>
Tested-by: Alice Ryhl <[email protected]>
Acked-by: Masahiro Yamada <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Miguel Ojeda <[email protected]>
Diffstat (limited to 'scripts/generate_rust_target.rs')
0 files changed, 0 insertions, 0 deletions
