Re: [PATCH v4 3/4] rust: add a Kconfig function to test for support of bindgen options
From: Asuna Yang
Date: Sun Nov 23 2025 - 21:42:14 EST
On 11/24/25 9:48 AM, Miguel Ojeda wrote:
More importantly, should we just have a separate function for backend
flags? That would be easier and would avoid having to use the
environment variable, if I understand the commit message here
correctly. And, anyway, it is actually the only function we need so
far.
You are right, separated might be better.
Another reason is, in `scripts/Makefile.compiler`, there is a set of functions with the same name provided for use by Makefile. Since we currently do not need to check for bindgen options in Makefile, I didn't add function for bindgen there. If we add it in the future, the `bindgen-option` function in `Kconfig.include` will correspond to the `bindgen-option-yn` function in `Makefile.compiler`, and `bindgen-option` function in `Makefile.compiler` will return the selected option instead of yn.
If we don't separate them now, for consistency, in `Makefile.compiler`, `$(call bindgen-option,-- --some-flag-a,-- --some-flag-b)` will return an option prefixed with --, which makes it difficult to use.
I will separate them into two functions in the next revision, `bindgen-option` and `bindgen-backend-option` (or `bindgen-cc-option`? Which one do you prefer?).