1 # Note to people running shellcheck: this file should only be sourced, not executed directly.
5 dylib=$(echo "" | rustc --print file-names --crate-type dylib --crate-name rustc_codegen_cranelift -)
7 if echo "$RUSTC_WRAPPER" | grep sccache; then
9 echo -e "\x1b[1;93m=== Warning: Unset RUSTC_WRAPPER to prevent interference with sccache ===\x1b[0m"
14 dir=$(cd "$(dirname "${BASH_SOURCE[0]}")"; pwd)
16 export RUSTC=$dir"/bin/cg_clif"
18 export RUSTDOCFLAGS=$linker' -Cpanic=abort -Zpanic-abort-tests '\
19 '-Zcodegen-backend='$dir'/lib/'$dylib' --sysroot '$dir
21 # FIXME fix `#[linkage = "extern_weak"]` without this
22 if [[ "$(uname)" == 'Darwin' ]]; then
23 export RUSTFLAGS="$RUSTFLAGS -Clink-arg=-undefined -Clink-arg=dynamic_lookup"
26 export LD_LIBRARY_PATH="$(rustc --print sysroot)/lib:"$dir"/lib"
27 export DYLD_LIBRARY_PATH=$LD_LIBRARY_PATH