Commit aacf93e8 authored by Masahiro Yamada's avatar Masahiro Yamada Committed by Miguel Ojeda

rust: fix the default format for CONFIG_{RUSTC,BINDGEN}_VERSION_TEXT

Another oddity in these config entries is their default value can fall
back to 'n', which is a value for bool or tristate symbols.

The '|| echo n' is an incorrect workaround to avoid the syntax error.
This is not a big deal, as the entry is hidden by 'depends on RUST' in
situations where '$(RUSTC) --version' or '$(BINDGEN) --version' fails.
Anyway, it looks odd.

The default of a string type symbol should be a double-quoted string
literal. Turn it into an empty string when the version command fails.

Fixes: 2f7ab126 ("Kbuild: add Rust support")
Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
Link: https://lore.kernel.org/r/20240727140302.1806011-2-masahiroy@kernel.org
[ Rebased on top of v6.11-rc1. - Miguel ]
Signed-off-by: default avatarMiguel Ojeda <ojeda@kernel.org>
parent 5ce86c6c
...@@ -1919,7 +1919,7 @@ config RUST ...@@ -1919,7 +1919,7 @@ config RUST
config RUSTC_VERSION_TEXT config RUSTC_VERSION_TEXT
string string
depends on RUST depends on RUST
default $(shell,$(RUSTC) --version 2>/dev/null || echo n) default "$(shell,$(RUSTC) --version 2>/dev/null)"
config BINDGEN_VERSION_TEXT config BINDGEN_VERSION_TEXT
string string
...@@ -1927,7 +1927,7 @@ config BINDGEN_VERSION_TEXT ...@@ -1927,7 +1927,7 @@ config BINDGEN_VERSION_TEXT
# The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0 # The dummy parameter `workaround-for-0.69.0` is required to support 0.69.0
# (https://github.com/rust-lang/rust-bindgen/pull/2678). It can be removed when # (https://github.com/rust-lang/rust-bindgen/pull/2678). It can be removed when
# the minimum version is upgraded past that (0.69.1 already fixed the issue). # the minimum version is upgraded past that (0.69.1 already fixed the issue).
default $(shell,$(BINDGEN) --version workaround-for-0.69.0 2>/dev/null || echo n) default "$(shell,$(BINDGEN) --version workaround-for-0.69.0 2>/dev/null)"
# #
# Place an empty function call at each tracepoint site. Can be # Place an empty function call at each tracepoint site. Can be
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment