Handle -Cflag syntax and use prebuilt cargo.
* Accept both "-C flag" and "-Cflag" syntax.
* Newer cargo uses "-Cembed-bitcode=no".
* Some -C flags are filtered out, not used in .bp file,
because they are meaningless in .bp file build system.
* Remaining -C flags are passed to rustc in .bp files,
which was missing before this change.
* Look up cargo in the prebuilts directory.
* Now limit this script to run only on linux.
* Try to find cargo/rust version from
build/soong/rust/config/global.go first.
* Otherwise, use the latest (largest) version in prebuilt.
* Add a new --cargo_bin flag to use any user-selected cargo.
* Add the selected cargo directory to PATH before calling cargo,
so it can find rustc in the same directory.
Bug: 161825397
Bug: 161927172
Test: regenerate and check .bp files in external/rust/crates
Change-Id: Ica46f536c2b37b62238d1245ced59685deebad33
1 file changed