kbuild: remove unnecessary export of RUST_LIB_SRC
PATCH 1/1 kbuild: remove unnecessary export of RUST_LIB_SRC
If RUST_LIB_SRC is defined in the top-level Makefile (via an environment variable or command line), it is already exported.
The only situation where it is defined but not exported is when the top-level Makefile is wrapped by another Makefile (e.g., GNUmakefile). I cannot think of any other use cases.
I know some people use this tip to define custom variables. However, even in that case, you can export it directly in the wrapper Makefile.
Example GNUmakefile:
export RUST_LIB_SRC = /path/to/your/sysroot/lib/rustlib/src/rust/library include Makefile
---
This code was added by this commit:
https://github.com/Rust-for-Linux/linux/commit/3f46885dc03ed2d750085b2237078a1628323964
Please me know if I am missing something.
Makefile | 4 ---- 1 file changed, 4 deletions(-)
Makefile +0 -4
@@ -578,10 +578,6 @@ else RUSTC_OR_CLIPPY = $(RUSTC) endif -ifdef RUST_LIB_SRC - export RUST_LIB_SRC -endif - # Allows the usage of unstable features in stable compilers. export RUSTC_BOOTSTRAP := 1
Signature · 1 line
2.43.0
Quoted 15 lines · Masahiro Yamada
If
RUST_LIB_SRCis defined in the top-levelMakefile(via an environment variable or command line), it is already exported.The only situation where it is defined but not exported is when the top-level
Makefileis wrapped by anotherMakefile(e.g., GNUmakefile). I cannot think of any other use cases.I know some people use this tip to define custom variables. However, even in that case, you can export it directly in the wrapper
Makefile.Example GNUmakefile:
export
RUST_LIB_SRC= /path/to/your/sysroot/lib/rustlib/src/rust/library includeMakefile
Quoted 7 lines
Signed-off-by Masahiro Yamada <[email protected]>---
This code was added by this commit:https://github.com/Rust-for-Linux/linux/commit/3f46885dc03ed2d750085b2237078a1628323964
Please me know if I am missing something.
Looks good to me.
Quoted 11 lines · Masahiro Yamada
If
RUST_LIB_SRCis defined in the top-levelMakefile(via an environment variable or command line), it is already exported.The only situation where it is defined but not exported is when the top-level
Makefileis wrapped by anotherMakefile(e.g., GNUmakefile). I cannot think of any other use cases.I know some people use this tip to define custom variables. However, even in that case, you can export it directly in the wrapper
Makefile.
Quoted 6 lines
Example GNUmakefile:
export
RUST_LIB_SRC= /path/to/your/sysroot/lib/rustlib/src/rust/library includeMakefileSigned-off-by Masahiro Yamada <[email protected]>
Quoted 6 lines · Masahiro Yamada
This code was added by this commit:
https://github.com/Rust-for-Linux/linux/commit/3f46885dc03ed2d750085b2237078a1628323964
Please me know if I am missing something.
I think it is OK -- unless Fiona recalls something:
Thanks Masahiro for the simplification!
Cheers,
Miguel
Fiona Behrens
Acked-byQuoted 9 lines · Miguel Ojeda
Quoted 6 lines · Masahiro Yamada
This code was added by this commit:
https://github.com/Rust-for-Linux/linux/commit/3f46885dc03ed2d750085b2237078a1628323964
Please me know if I am missing something.
I think it is OK -- unless Fiona recalls something:
As long as the export to rustc and the rust analyzer script works this looks good.
Quoted 8 lines
Acked-by Miguel Ojeda <[email protected]>Tested-by Miguel Ojeda <[email protected]>Thanks Masahiro for the simplification!
Cheers,
Miguel