rust: Use awk instead of recent xargs
PATCH v2 1/1 rust: Use awk instead of recent xargs
awk is already required by the kernel build, and the xargs feature used in current Rust detection is not present in all xargs (notably, toybox based xargs, used in the Android kernel build).
---
I absorbed the grep and cut into the awk command as well, as Joe Perches suggested.
rust/Makefile | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
rust/Makefile +1 -3
@@ -364,9 +364,7 @@ $(obj)/bindings/bindings_helpers_generated.rs: $(src)/helpers.c FORCE quiet_cmd_exports = EXPORTS $@ cmd_exports = \ $(NM) -p --defined-only $< \ - | grep -E ' (T|R|D) ' | cut -d ' ' -f 3 \ - | xargs -Isymbol \ - echo 'EXPORT_SYMBOL_RUST_GPL(symbol);' > $@ + | awk '/ (T|R|D) / {printf "EXPORT_SYMBOL_RUST_GPL(%s);\n",$$3}' > $@ $(obj)/exports_core_generated.h: $(obj)/core.o FORCE $(call if_changed,exports)
Signature · 1 line
2.42.0.582.g8ccd20d70d-goog
Quoted 7 lines · Matthew Maurer
awkis already required by the kernel build, and thexargsfeature used in current Rust detection is not present in allxargs(notably, toybox based xargs, used in the Android kernel build).Signed-off-by Matthew Maurer <[email protected]>---
[...]
Quoted 6 lines · Matthew Maurer
awkis already required by the kernel build, and thexargsfeature used in current Rust detection is not present in allxargs(notably, toybox based xargs, used in the Android kernel build).Signed-off-by Matthew Maurer <[email protected]>
Tested both in an Android and non-Android build.
Miguel Ojeda
AppliedQuoted 6 lines · Matthew Maurer
awkis already required by the kernel build, and thexargsfeature used in current Rust detection is not present in allxargs(notably, toybox based xargs, used in the Android kernel build).Signed-off-by Matthew Maurer <[email protected]>
Applied to rust-next -- thanks everyone!
Cheers,
Miguel