]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_codegen_cranelift/scripts/cargo.sh
Auto merge of #76345 - okready:sgx-mem-range-overflow-checks, r=joshtriplett
[rust.git] / compiler / rustc_codegen_cranelift / scripts / cargo.sh
1 #!/bin/bash
2
3 dir=$(dirname "$0")
4 source "$dir/config.sh"
5
6 # read nightly compiler from rust-toolchain file
7 TOOLCHAIN=$(cat "$dir/rust-toolchain")
8
9 cmd=$1
10 shift || true
11
12 if [[ "$cmd" = "jit" ]]; then
13 cargo "+${TOOLCHAIN}" rustc "$@" -- -Cllvm-args=mode=jit -Cprefer-dynamic
14 elif [[ "$cmd" = "lazy-jit" ]]; then
15 cargo "+${TOOLCHAIN}" rustc "$@" -- -Cllvm-args=mode=jit-lazy -Cprefer-dynamic
16 else
17 cargo "+${TOOLCHAIN}" "$cmd" "$@"
18 fi