Enable rust parallel front-end

See https://blog.rust-lang.org/2023/11/09/parallel-rustc.html
This commit is contained in:
LoveSy 2023-11-29 22:44:17 +08:00 committed by John Wu
parent e77cbd0c15
commit 334554697d

View File

@ -256,7 +256,7 @@ def run_cargo(cmds, triple="aarch64-linux-android"):
env = os.environ.copy()
env["PATH"] = f'{rust_bin}{os.pathsep}{env["PATH"]}'
env["CARGO_BUILD_RUSTC"] = op.join(rust_bin, "rustc" + EXE_EXT)
env["RUSTFLAGS"] = "-Clinker-plugin-lto"
env["RUSTFLAGS"] = f"-Clinker-plugin-lto -Zthreads={min(8, cpu_count)}"
env["TARGET_CC"] = op.join(llvm_bin, "clang" + EXE_EXT)
env["TARGET_CFLAGS"] = f"--target={triple}23"
return execv([cargo, *cmds], env)